Jobs warning tests failing on Windows with Python < 3.4
Flake8 issues warnings when the --jobs
option is used in an incompatible way (e.g. with the --diff
option). The tests for this feature are in flake8/tests/test_warnings.py
.
Under certain condition, the tests in test_warnings.py
fail.
Tests pass
Linux - Ubuntu 14.10
2.6, 2.7, 3.2, 3.3, 3.4
Windows - 8.1
3.4
Tests fail
Windows - 8.1
2.7, 3.3
They fail because the warnings are not issued, or are not captured. However, when the tests in test_warnings.py
are run alone, without the rest of the test suite, they pass. Using the nosetests --isolation
option does not help.
The nature of the tests (patching stdin, stdout) and the pattern of failure (Windows, Python < 3.4) makes me think the failure might have something to do with PEP 446 "Make newly created file descriptors non-inheritable".
One proposed solution (PR coming soon) is to run the tests in test_warnings.py
separately, in a separate line in the tox [testenv]
stanza.
Tracebacks
======================================================================
FAIL: test_jobs_verbose (flake8.tests.test_warnings.IntegrationTestCaseWarnings)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\Me\Documents\Documents\Computer\Projects\git\flake8\flake8\tests\test_warnings.py", line 190, in test_jobs_verbose
self.test_jobs(verbose=True)
File "C:\Users\Me\Documents\Documents\Computer\Projects\git\flake8\flake8\tests\test_warnings.py", line 160, in test_jobs
self._job_tester(2, verbose=verbose)
File "C:\Users\Me\Documents\Documents\Computer\Projects\git\flake8\flake8\tests\test_warnings.py", line 157, in _job_tester
self.verify_warnings(collected_warnings, expected_warings)
File "C:\Users\Me\Documents\Documents\Computer\Projects\git\flake8\flake8\tests\test_warnings.py", line 88, in verify_warnings
len(expected_warnings))
nose.proxy.AssertionError: 0 != 1
-------------------- >> begin captured stdout << ---------------------
local configuration: in C:\Users\Me\Documents\Documents\Computer\Projects\git\flake8
checking C:\Users\Me\Documents\Documents\Computer\Projects\git\flake8\flake8\tests\test_warnings.py
--------------------- >> end captured stdout << ----------------------
======================================================================
FAIL: test_stdin_jobs_warning_verbose (flake8.tests.test_warnings.IntegrationTestCaseWarnings)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\Me\Documents\Documents\Computer\Projects\git\flake8\flake8\tests\test_warnings.py", line 196, in test_stdin_jobs_warning_verbose
self.test_stdin_jobs_warning(verbose=True)
File "C:\Users\Me\Documents\Documents\Computer\Projects\git\flake8\flake8\tests\test_warnings.py", line 186, in test_stdin_jobs_warning
self.verify_warnings(collected_warnings, expected_warings)
File "C:\Users\Me\Documents\Documents\Computer\Projects\git\flake8\flake8\tests\test_warnings.py", line 88, in verify_warnings
len(expected_warnings))
nose.proxy.AssertionError: 1 != 2
-------------------- >> begin captured stdout << ---------------------
local configuration: in C:\Users\Me\Documents\Documents\Computer\Projects\git\flake8
checking -
--------------------- >> end captured stdout << ----------------------