Skip to content
New issue

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

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

Already on GitHub? # to your account

Add fix for extraneous parens in print() #122

Merged
merged 1 commit into from
Apr 8, 2019
Merged

Conversation

asottile
Copy link
Owner

@asottile asottile commented Apr 8, 2019

No description provided.

@asottile
Copy link
Owner Author

asottile commented Apr 8, 2019

This actually removes parens in more places, but I think that's fine too:

(for example, from pytest)

diff --git a/bench/bench_argcomplete.py b/bench/bench_argcomplete.py
index 2b30add0..335733df 100644
--- a/bench/bench_argcomplete.py
+++ b/bench/bench_argcomplete.py
@@ -16,4 +16,4 @@ run = 'fc("/d")'
 
 if __name__ == "__main__":
     print(timeit.timeit(run, setup=setup % imports[0], number=count))
-    print((timeit.timeit(run, setup=setup % imports[1], number=count)))
+    print(timeit.timeit(run, setup=setup % imports[1], number=count))
diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py
index a802a56f..44080247 100644
--- a/src/_pytest/pytester.py
+++ b/src/_pytest/pytester.py
@@ -1311,7 +1311,7 @@ class LineMatcher(object):
         raise ValueError("line %r not found in output" % fnline)
 
     def _log(self, *args):
-        self._log_output.append(" ".join((str(x) for x in args)))
+        self._log_output.append(" ".join(str(x) for x in args))
 
     @property
     def _log_text(self):
diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py
index d67d6f4a..b307d0af 100644
--- a/testing/python/fixtures.py
+++ b/testing/python/fixtures.py
@@ -1071,9 +1071,7 @@ class TestFixtureUsages(object):
         )
         result = testdir.runpytest_inprocess()
         result.stdout.fnmatch_lines(
-            (
                 "*Fixture 'badscope' from test_invalid_scope.py got an unexpected scope value 'functions'"
-            )
         )
 
     def test_funcarg_parametrized_and_used_twice(self, testdir):

@asottile asottile merged commit 6f4a4dd into master Apr 8, 2019
@asottile asottile deleted the fix_modernize_print branch April 8, 2019 17:24
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant