Skip to content

replacing '.format' with f-strings in some test files #30816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 8, 2020

Conversation

ssikdar1
Copy link
Contributor

@ssikdar1 ssikdar1 commented Jan 8, 2020

One format that I left untouched in pandas/tests/util/test_assert_frame_equal.py:

def test_frame_equal_unicode(df1, df2, msg, by_blocks_fixture, obj_fixture):
    # see gh-20503
    #
    # Test ensures that `tm.assert_frame_equals` raises the right exception
    # when comparing DataFrames containing differing unicode objects.
    msg = msg.format(obj=obj_fixture)
    with pytest.raises(AssertionError, match=msg):
        tm.assert_frame_equal(df1, df2, by_blocks=by_blocks_fixture, obj=obj_fixture)

However it looks the the test function isnt being used anywhere:

$ grep -rnw . -e "test_frame_equal_unicode"
./pandas/tests/util/test_assert_frame_equal.py:217:def test_frame_equal_unicode(df1, df2, msg, by_blocks_fixture, obj_fixture):

Wasn't sure if I should leave as is? or assume person calling the function will format msg properly before passing to the test function.

@ssikdar1 ssikdar1 changed the title replacing '.format' with f-strings in test files replacing '.format' with f-strings in some test files Jan 8, 2020
@WillAyd WillAyd added the Code Style Code style, linting, code_checks label Jan 8, 2020
@WillAyd WillAyd added this to the 1.0 milestone Jan 8, 2020
@WillAyd WillAyd merged commit 9109117 into pandas-dev:master Jan 8, 2020
@WillAyd
Copy link
Member

WillAyd commented Jan 8, 2020

Thanks @ssikdar1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants