diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-11-11 07:23:36 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-11-11 07:23:36 -0500 |
commit | 1b94835aac3268a32bfa4ce0df585dbb97457a06 (patch) | |
tree | adbc0aa1467460588e77aa6d574e1ae9abb74f0f /tests/test_phystokens.py | |
parent | 79f9f4575321fafc2ef770e3255f874db3d4b037 (diff) | |
download | python-coveragepy-git-1b94835aac3268a32bfa4ce0df585dbb97457a06.tar.gz |
style: convert more string formatting to f-strings
Diffstat (limited to 'tests/test_phystokens.py')
-rw-r--r-- | tests/test_phystokens.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py index 9950e655..91a9d3d9 100644 --- a/tests/test_phystokens.py +++ b/tests/test_phystokens.py @@ -171,7 +171,7 @@ class SourceEncodingTest(CoverageTest): def test_detect_source_encoding(self): for _, source, expected in ENCODING_DECLARATION_SOURCES: - assert source_encoding(source) == expected, "Wrong encoding in %r" % source + assert source_encoding(source) == expected, f"Wrong encoding in {source!r}" # PyPy3 gets this case wrong. Not sure what I can do about it, so skip the test. @pytest.mark.skipif(env.PYPY, reason="PyPy3 is wrong about non-comment encoding. Skip it.") @@ -233,7 +233,7 @@ class NeuterEncodingDeclarationTest(CoverageTest): # The neutered source will be detected as having no encoding # declaration. - assert source_encoding(neutered) == DEF_ENCODING, "Wrong encoding in %r" % neutered + assert source_encoding(neutered) == DEF_ENCODING, f"Wrong encoding in {neutered!r}" def test_two_encoding_declarations(self): input_src = textwrap.dedent("""\ |