3 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/04096e391ef1/ Changeset: 04096e391ef1 User: hpk42 Date: 2013-10-03 16:47:55 Summary: always dupfile if os.dup is available Affected #: 2 files
diff -r bc620a10f932bc0d961b92f2c0b741e2ae1c8715 -r 04096e391ef16aa7b7b492a2677b4cd0f3e0fc52 _pytest/terminal.py --- a/_pytest/terminal.py +++ b/_pytest/terminal.py @@ -37,7 +37,7 @@ # we try hard to make printing resilient against # later changes on FD level. (unless capturing is off/sys) stdout = sys.stdout - if config.option.capture == "fd" and hasattr(os, "dup"): + if hasattr(os, "dup"): try: newstdout = py.io.dupfile(stdout, buffering=1, encoding=stdout.encoding) diff -r bc620a10f932bc0d961b92f2c0b741e2ae1c8715 -r 04096e391ef16aa7b7b492a2677b4cd0f3e0fc52 testing/test_terminal.py --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -677,14 +677,6 @@ "*2 passed*" ]) -def test_nofd_manipulation_with_capture_disabled(testdir): - from _pytest.terminal import pytest_configure - config = testdir.parseconfig("--capture=no") - stdout = sys.stdout - pytest_configure(config) - reporter = config.pluginmanager.getplugin('terminalreporter') - assert reporter._tw._file == stdout - def test_tbstyle_native_setup_error(testdir): p = testdir.makepyfile(""" import pytest @@ -712,3 +704,14 @@ *==== hello ====* world """) + +@pytest.mark.xfail("not hasattr(os, 'dup')") +def test_fd_fixing(testdir): + testdir.makepyfile(""" + import os + os.close(1) + def test_fdclose(): + os.close(2) + """) + result = testdir.runpytest("-s") + result.stdout.fnmatch_lines("*1 pass*") https://bitbucket.org/hpk42/pytest/commits/ebceac32c5cd/ Changeset: ebceac32c5cd User: hpk42 Date: 2013-10-03 17:46:36 Summary: fix issue365 and depend on a newer py versions which uses colorama for coloring instead of its own ctypes hacks. Affected #: 3 files diff -r 04096e391ef16aa7b7b492a2677b4cd0f3e0fc52 -r ebceac32c5cdaec80fe3005af9618916068b4fa2 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,12 +1,15 @@ Changes between 2.4.1 and 2.4.2 ----------------------------------- +- on Windows require colorama and a newer py lib so that py.io.TerminalWriter() + now uses colorama instead of its own ctypes hacks. (fixes issue365) + - fix "-k" matching of tests where "repr" and "attr" and other names would cause wrong matches because of an internal implementation quirk (don't ask) which is now properly implemented. fixes issue345. - avoid "IOError: Bad Filedescriptor" on pytest shutdown by not closing - the internal dupped stdout (fix is slightly hand-wavy but work). + the internal dupped stdout (fix is slightly hand-wavy but works). - avoid tmpdir fixture to create too long filenames especially when parametrization is used (issue354) @@ -21,6 +24,7 @@ details of the node.keywords pseudo-dicts. Adapated docs. + Changes between 2.4.0 and 2.4.1 ----------------------------------- diff -r 04096e391ef16aa7b7b492a2677b4cd0f3e0fc52 -r ebceac32c5cdaec80fe3005af9618916068b4fa2 _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.4.2.dev1' +__version__ = '2.4.2' diff -r 04096e391ef16aa7b7b492a2677b4cd0f3e0fc52 -r ebceac32c5cdaec80fe3005af9618916068b4fa2 setup.py --- a/setup.py +++ b/setup.py @@ -3,15 +3,17 @@ long_description = open("README.rst").read() def main(): - install_requires = ["py>=1.4.16"] + install_requires = ["py>=1.4.17.dev2"] if sys.version_info < (2,7): install_requires.append("argparse") + if sys.platform == "win32": + install_requires.append("colorama") setup( name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.4.2.dev1', + version='2.4.2', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], https://bitbucket.org/hpk42/pytest/commits/d5a0e8a77e0f/ Changeset: d5a0e8a77e0f User: hpk42 Date: 2013-10-03 18:02:54 Summary: fix argcomplete-test to use sys.argv[0] if it looks like a py.test executable Affected #: 1 file diff -r ebceac32c5cdaec80fe3005af9618916068b4fa2 -r d5a0e8a77e0f2ccfea495c44a80b5a1409a0e832 testing/test_parseopt.py --- a/testing/test_parseopt.py +++ b/testing/test_parseopt.py @@ -1,4 +1,6 @@ from __future__ import with_statement +import sys +import os import py, pytest from _pytest import config as parseopt from textwrap import dedent @@ -250,14 +252,16 @@ def test_argcomplete(testdir, monkeypatch): if not py.path.local.sysfind('bash'): pytest.skip("bash not available") - import os script = str(testdir.tmpdir.join("test_argcomplete")) + pytest_bin = sys.argv[0] + if "py.test" not in os.path.basename(pytest_bin): + pytest.skip("need to be run with py.test executable, not %s" %(pytest_bin,)) + with open(str(script), 'w') as fp: # redirect output from argcomplete to stdin and stderr is not trivial # http://stackoverflow.com/q/12589419/1307905 # so we use bash - fp.write('COMP_WORDBREAKS="$COMP_WORDBREAKS" $(which py.test) ' - '8>&1 9>&2') + fp.write('COMP_WORDBREAKS="$COMP_WORDBREAKS" %s 8>&1 9>&2' % pytest_bin) # alternative would be exteneded Testdir.{run(),_run(),popen()} to be able # to handle a keyword argument env that replaces os.environ in popen or # extends the copy, advantage: could not forget to restore Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit