-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[9954] Fade to black #1381
[9954] Fade to black #1381
Conversation
Is this commit spoiling git blame for you? Check out .git-blame-ignore-revs in the root of the repository.
…backHandlesUTF8DecodeFailure Resolve this failure: Traceback (most recent call last): File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/logger/test/test_format.py", line 531, in test_formatTracebackHandlesUTF8DecodeFailure self.assertIn(r"CapturedError(b'\xff\xfet\x00e\x00s\x00t\x00')", eventText) File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/trial/_synctest.py", line 489, in assertIn raise self.failureException(msg or "%r not in %r" % (containee, container)) twisted.trial.unittest.FailTest: "CapturedError(b'\\xff\\xfet\\x00e\\x00s\\x00t\\x00')" not in '- This is a test log message\nTraceback (most recent call last):\n File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/trial/_asynctest.py", line 148, in deferTestMethod\n d = self._run(self._testMethodName, result)\n File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/trial/_asynctest.py", line 119, in _run\n utils.runWithWarningsSuppressed, self._getSuppress(), method\n File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/internet/defer.py", line 162, in maybeDeferred\n result = f(*args, **kw)\n File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/internet/utils.py", line 205, in runWithWarningsSuppressed\n result = f(*a, **kw)\n--- <exception caught here> ---\n File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/logger/test/test_format.py", line 523, in test_formatTracebackHandlesUTF8DecodeFailure\n raise CapturedError(b"\\xff\\xfet\\x00e\\x00s\\x00t\\x00")\ntwisted.logger.test.test_format.CapturedError: b\'\\xff\\xfet\\x00e\\x00s\\x00t\\x00\'\n' The solution is to update the expectation to use the double quotes Black has changed the code to use.
…cks failure Resolve this test failure: Traceback (most recent call last): File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/test/test_defer.py", line 1424, in test_inlineCallbacksTracebacks self.assertEqual("1/0", tb[2][3]) File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/trial/_synctest.py", line 424, in assertEqual super(_Assertions, self).assertEqual(first, second, msg) File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual assertion_func(first, second, msg=msg) File "/usr/lib/python3.6/unittest/case.py", line 1203, in assertMultiLineEqual self.fail(self._formatMessage(msg, standardMsg)) twisted.trial.unittest.FailTest: '1/0' != '1 / 0' - 1/0 + 1 / 0 ? + + Black added whitespace around the division operator. Update the assertion to match.
Resolve these two test failures: [FAIL] Traceback (most recent call last): File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/test/test_failure.py", line 859, in test_throwExceptionIntoGenerator self.assertEqual(traceback.extract_tb(stuff[0][2])[-1][-1], "1/0") File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/trial/_synctest.py", line 424, in assertEqual super(_Assertions, self).assertEqual(first, second, msg) File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual assertion_func(first, second, msg=msg) File "/usr/lib/python3.6/unittest/case.py", line 1203, in assertMultiLineEqual self.fail(self._formatMessage(msg, standardMsg)) twisted.trial.unittest.FailTest: '1 / 0' != '1/0' - 1 / 0 ? - - + 1/0 twisted.test.test_failure.ExtendedGeneratorTests.test_throwExceptionIntoGenerator =============================================================================== [FAIL] Traceback (most recent call last): File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/test/test_failure.py", line 404, in test_RaiseExceptionWithTB self.assertEqual(innerline, "1/0") File "/home/twm/dev/twisted/build/nocov/lib/python3.6/site-packages/twisted/trial/_synctest.py", line 424, in assertEqual super(_Assertions, self).assertEqual(first, second, msg) File "/usr/lib/python3.6/unittest/case.py", line 829, in assertEqual assertion_func(first, second, msg=msg) File "/usr/lib/python3.6/unittest/case.py", line 1203, in assertMultiLineEqual self.fail(self._formatMessage(msg, standardMsg)) twisted.trial.unittest.FailTest: '1 / 0' != '1/0' - 1 / 0 ? - - + 1/0 twisted.test.test_failure.FailureTests.test_RaiseExceptionWithTB These failures were caused by the addition of whitespace around the division operator by Black. I updated the test expectations.
A whole bunch of CI is failing with this change. For example:
Can those be fixed in this commit somehow? |
Can you add this patch to your branch:
|
Can you also add this patch to your branch? This should fix the mypy errors:
|
@rodrigc I am working through the failures. I haven't looked at the mypy failure yet, but I'd guess it's because I ran Black with Python 3.6. Perhaps it moved the comments around because they aren't part of the AST until Python 3.8. I'll test that theory tomorrow; I'm headed for bed now. |
Yes the mypy issues are because comments got shifted to a different line. Python 3.6 vs 3.8 is irrelevant. See this patch: #1381 (comment) |
Oh sorry, I didn't see your new comments! I'll apply those patches. Thanks for digging in! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the CI now passes.
Before merging, you may want to consider squashing some of the commits in this PR to clean up the history
e539cff
to
1d0734b
Compare
Thank you very much @rodrigc! I will merge this and begin the follow-up communications work. |
@twm Nice job! |
Following up on #1380.
@rodrigc I consolidated steps 1 and 2 from your comment to avoid creating separate tickets and newsfiles for them.
Contributor Checklist:
review
to the keywords field in Trac, and putting a link to this PR in the comment; it shows up in https://twisted.reviews/ now.