Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix twisted.logger.test.test_format.EventAsTextTests.test_formatTrace…
…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.
- Loading branch information