diff --git a/CHANGELOG b/CHANGELOG index 955d8f914..06140d513 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Changes between 2.1.3 and [next version] ---------------------------------------- +- fix pytest's own test suite to not leak FDs - fix issue83: link to generated funcarg list - fix issue74: pyarg module names are now checked against imp.find_module false positives diff --git a/_pytest/__init__.py b/_pytest/__init__.py index adeaf25bf..b8d360007 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.1.3' +__version__ = '2.1.4.dev1' diff --git a/_pytest/pytester.py b/_pytest/pytester.py index 3edfc6dd5..9966bb7f9 100644 --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -402,6 +402,15 @@ class TmpTestdir: config.pluginmanager.do_configure(config) self.request.addfinalizer(lambda: config.pluginmanager.do_unconfigure(config)) + # XXX we need to additionally reset FDs to prevent pen FDs + # during our test suite. see also capture.py's unconfigure XXX + # comment about logging + def finalize_capman(): + capman = config.pluginmanager.getplugin('capturemanager') + while capman._method2capture: + name, cap = capman._method2capture.popitem() + cap.reset() + self.request.addfinalizer(finalize_capman) return config def getitem(self, source, funcname="test_func"): diff --git a/setup.py b/setup.py index 1919362ef..e2eaad50b 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def main(): name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.1.3', + version='2.1.4.dev1', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff --git a/testing/conftest.py b/testing/conftest.py index 2e460585c..6d20b9a4d 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -35,7 +35,7 @@ def pytest_unconfigure(config, __multicall__): __multicall__.execute() out2 = py.process.cmdexec("lsof -p %d" % pid) len2 = getopenfiles(out2) - assert len2 < config._numfiles + 7, out2 + assert len2 < config._numfiles + 15, out2 def pytest_runtest_setup(item): diff --git a/tox.ini b/tox.ini index 6605d35bd..7f96af2bf 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ indexserver= [testenv] changedir=testing -commands= py.test -rfsxX --junitxml={envlogdir}/junit-{envname}.xml [] +commands= py.test --lsof -rfsxX --junitxml={envlogdir}/junit-{envname}.xml [] deps= :pypi:pexpect :pypi:nose