Message284437
I recently tried to port one of my packages to Python 3.6 and unit tests that worked in Python 2.7, 3.3-3.5 began failing in 3.6.
I originally thought it was a problem with coverage, but it turns out it was not. The full thread is: https://bitbucket.org/ned/coveragepy/issues/545/coverage-fails-on-python-36-travis-build
The highlight is this unit test causes Python to exit with status code 120 (which fails a Travis build):
class ParseArgumentsTestCase(unittest.TestCase):
def test_no_arguments(self): # type: () -> None
with self.assertRaises(SystemExit):
# Suppress argparse stderr.
class NullWriter:
def write(self, s): # type: (str) -> None
pass
sys.stderr = NullWriter()
parse_arguments()
Ned found this corresponding note in the Python 3.6 release notes:
Changed in version 3.6: If an error occurs in the cleanup after the Python interpreter has caught SystemExit (such as an error flushing buffered data in the standard streams), the exit status is changed to 120.
If this is indeed, correct behavior and Python 3.6 is catching something incorrect (I agree this is not necessarily the most elegant unit test) then I am happy to close this issue. Just wanted to be sure I at least reported it in case this was a real issue. |
|
Date |
User |
Action |
Args |
2017-01-02 00:28:18 | John Hagen | set | recipients:
+ John Hagen |
2017-01-02 00:28:18 | John Hagen | set | messageid: <1483316898.11.0.0292789374137.issue29130@psf.upfronthosting.co.za> |
2017-01-02 00:28:18 | John Hagen | link | issue29130 messages |
2017-01-02 00:28:17 | John Hagen | create | |
|