diff --git a/doc/download.txt b/doc/download.txt index 33c6ca193..519bd6309 100644 --- a/doc/download.txt +++ b/doc/download.txt @@ -5,7 +5,7 @@ Downloading "easy_install py" =================================================== -With a working `setuptools installation`_ you can install from the command line:: +If you have a working `setuptools installation`_ you can install from the command line:: easy_install -U py diff --git a/doc/test/extend.txt b/doc/test/extend.txt index eb485fa76..8e89dba1b 100644 --- a/doc/test/extend.txt +++ b/doc/test/extend.txt @@ -89,11 +89,11 @@ Available py.test hooks py.test calls hooks functions to implement its `test collection`_, running and reporting process. Upon loading of a plugin py.test performs strict checking on contained hook functions. Function and argument names -need to match exactly the `original definition of the hook`_. It thus +need to match exactly one of `hook definition specification`_. It thus provides useful error reporting on mistyped hook or argument names and minimizes version incompatibilites. -.. _`original definition of the hook`: http://bitbucket.org/hpk42/py-trunk/src/tip/py/test/plugin/hookspec.py +.. _`hook definition specification`: http://bitbucket.org/hpk42/py-trunk/src/tip/py/test/plugin/hookspec.py .. _`configuration hooks`: diff --git a/ez_setup.py b/ez_setup.py index 89cf056d9..d24e845e5 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -14,7 +14,7 @@ the appropriate options to ``use_setuptools()``. This file can also be run as a script to install or upgrade setuptools. """ import sys -DEFAULT_VERSION = "0.6c8" +DEFAULT_VERSION = "0.6c9" DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3] md5_data = { @@ -48,13 +48,18 @@ md5_data = { 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902', 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de', 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b', + 'setuptools-0.6c9-py2.3.egg': 'a83c4020414807b496e4cfbe08507c03', + 'setuptools-0.6c9-py2.4.egg': '260a2be2e5388d66bdaee06abec6342a', + 'setuptools-0.6c9-py2.5.egg': 'fe67c3e5a17b12c0e7c541b7ea43a8e6', + 'setuptools-0.6c9-py2.6.egg': 'ca37b1ff16fa2ede6e19383e7b59245a', } import sys, os +try: from hashlib import md5 +except ImportError: from md5 import md5 def _validate_md5(egg_name, data): if egg_name in md5_data: - from md5 import md5 digest = md5(data).hexdigest() if digest != md5_data[egg_name]: print >>sys.stderr, ( @@ -64,7 +69,6 @@ def _validate_md5(egg_name, data): sys.exit(2) return data - def use_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, download_delay=15 @@ -233,7 +237,6 @@ def update_md5(filenames): """Update our built-in md5 registry""" import re - from md5 import md5 for name in filenames: base = os.path.basename(name) @@ -270,3 +273,4 @@ if __name__=='__main__': + diff --git a/py/test/dist/testing/test_nodemanage.py b/py/test/dist/testing/test_nodemanage.py index 1bc573350..b95a1c4c8 100644 --- a/py/test/dist/testing/test_nodemanage.py +++ b/py/test/dist/testing/test_nodemanage.py @@ -4,7 +4,7 @@ from py.__.test.dist.nodemanage import NodeManager class pytest_funcarg__mysetup: def __init__(self, request): basetemp = request.config.mktemp( - "mysetup:%s" % request.function.__name__, + "mysetup-%s" % request.function.__name__, numbered=True) self.source = basetemp.mkdir("source") self.dest = basetemp.mkdir("dest") diff --git a/py/test/plugin/pytest_iocapture.py b/py/test/plugin/pytest_iocapture.py index c7c667d49..7695ac0df 100644 --- a/py/test/plugin/pytest_iocapture.py +++ b/py/test/plugin/pytest_iocapture.py @@ -23,9 +23,10 @@ def pytest_funcarg__capfd(request): return capture def pytest_pyfunc_call(pyfuncitem): - for funcarg, value in pyfuncitem.funcargs.items(): - if funcarg == "capsys" or funcarg == "capfd": - value.reset() + if hasattr(pyfuncitem, 'funcargs'): + for funcarg, value in pyfuncitem.funcargs.items(): + if funcarg == "capsys" or funcarg == "capfd": + value.reset() class Capture: _capture = None @@ -62,3 +63,11 @@ class TestCapture: assert out.startswith("42") """) reprec.assertoutcome(passed=1) + + def test_funcall_yielded_no_funcargs(self, testdir): + reprec = testdir.inline_runsource(""" + def test_hello(): + yield lambda: None + """) + reprec.assertoutcome(passed=1) + diff --git a/py/test/plugin/pytest_pytester.py b/py/test/plugin/pytest_pytester.py index 7669f2f0d..6f289fade 100644 --- a/py/test/plugin/pytest_pytester.py +++ b/py/test/plugin/pytest_pytester.py @@ -3,7 +3,7 @@ funcargs and support code for testing py.test functionality. """ import py -import os +import sys, os import inspect from py.__.test.config import Config as pytestConfig import hookspec @@ -271,7 +271,8 @@ class TmpTestdir: print "running", cmdargs, "curdir=", py.path.local() f1 = p1.open("w") f2 = p2.open("w") - popen = self.popen(cmdargs, stdout=f1, stderr=f2, close_fds=True) + popen = self.popen(cmdargs, stdout=f1, stderr=f2, + close_fds=(sys.platform != "win32")) ret = popen.wait() f1.close() f2.close()