From commits-noreply at bitbucket.org Tue Jan 11 15:57:34 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Tue, 11 Jan 2011 14:57:34 -0000 Subject: [py-svn] commit/pytest: hpk: remove same-conftest.py detection - does more harm than good Message-ID: <20110111145734.22340.68731@bitbucket03.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/cde87e253f59/ changeset: r2132:cde87e253f59 user: hpk date: 2011-01-11 15:54:47 summary: remove same-conftest.py detection - does more harm than good (see mail from Ralf Schmitt on py-dev) affected #: 3 files (1.0 KB) --- a/CHANGELOG Thu Dec 23 14:56:38 2010 -0600 +++ b/CHANGELOG Tue Jan 11 15:54:47 2011 +0100 @@ -1,6 +1,8 @@ Changes between 2.0.0 and 2.0.1.devX ---------------------------------------------- +- remove somewhat surprising "same-conftest" detection because + it ignores conftest.py when they appear in several subdirs. - improve assertions ("not in"), thanks Floris - improve behaviour/warnings when running on top of "python -OO" (assertions and docstrings are turned off, leading to potential --- a/_pytest/config.py Thu Dec 23 14:56:38 2010 -0600 +++ b/_pytest/config.py Tue Jan 11 15:54:47 2011 +0100 @@ -125,7 +125,6 @@ self._onimport = onimport self._conftestpath2mod = {} self._confcutdir = confcutdir - self._md5cache = {} def setinitial(self, args): """ try to find a first anchor path for looking up global values @@ -179,14 +178,7 @@ else: conftestpath = path.join("conftest.py") if conftestpath.check(file=1): - key = conftestpath.computehash() - # XXX logging about conftest loading - if key not in self._md5cache: - clist.append(self.importconftest(conftestpath)) - self._md5cache[key] = conftestpath - else: - # use some kind of logging - print ("WARN: not loading %s" % conftestpath) + clist.append(self.importconftest(conftestpath)) clist[:0] = self.getconftestmodules(dp) self._path2confmods[path] = clist # be defensive: avoid changes from caller side to --- a/testing/test_conftest.py Thu Dec 23 14:56:38 2010 -0600 +++ b/testing/test_conftest.py Tue Jan 11 15:54:47 2011 +0100 @@ -170,21 +170,6 @@ assert conftest.getconftestmodules(sub) == [] assert conftest.getconftestmodules(conf.dirpath()) == [] -def test_conftest_samecontent_detection(testdir): - conf = testdir.makeconftest("x=3") - p = testdir.mkdir("x") - conf.copy(p.join("conftest.py")) - conftest = Conftest() - conftest.setinitial([p]) - l = conftest.getconftestmodules(p) - assert len(l) == 1 - assert l[0].__file__ == p.join("conftest.py") - p2 = p.mkdir("y") - conf.copy(p2.join("conftest.py")) - l = conftest.getconftestmodules(p2) - assert len(l) == 1 - assert l[0].__file__ == p.join("conftest.py") - @pytest.mark.multi(name='test tests whatever .dotdir'.split()) def test_setinitial_conftest_subdirs(testdir, name): sub = testdir.mkdir(name) 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. From commits-noreply at bitbucket.org Tue Jan 11 17:28:17 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Tue, 11 Jan 2011 16:28:17 -0000 Subject: [py-svn] commit/pytest: hpk: fix issue15 - tests for python3/nose-1.0 combo work now Message-ID: <20110111162817.11888.31016@bitbucket01.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/98eb11d8887b/ changeset: r2133:98eb11d8887b user: hpk date: 2011-01-11 17:27:34 summary: fix issue15 - tests for python3/nose-1.0 combo work now affected #: 5 files (270 bytes) --- a/CHANGELOG Tue Jan 11 15:54:47 2011 +0100 +++ b/CHANGELOG Tue Jan 11 17:27:34 2011 +0100 @@ -1,6 +1,8 @@ Changes between 2.0.0 and 2.0.1.devX ---------------------------------------------- +- fix issue15: make nose compatibility tests compatible + with python3 (now that nose-1.0 supports python3) - remove somewhat surprising "same-conftest" detection because it ignores conftest.py when they appear in several subdirs. - improve assertions ("not in"), thanks Floris --- a/pytest.py Tue Jan 11 15:54:47 2011 +0100 +++ b/pytest.py Tue Jan 11 17:27:34 2011 +0100 @@ -1,7 +1,7 @@ """ unit and functional testing with Python. """ -__version__ = '2.0.1.dev5' +__version__ = '2.0.1.dev6' __all__ = ['main'] from _pytest.core import main, UsageError, _preloadplugins --- a/setup.py Tue Jan 11 15:54:47 2011 +0100 +++ b/setup.py Tue Jan 11 17:27:34 2011 +0100 @@ -22,7 +22,7 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.0.1.dev5', + version='2.0.1.dev6', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], --- a/testing/test_nose.py Tue Jan 11 15:54:47 2011 +0100 +++ b/testing/test_nose.py Tue Jan 11 17:27:34 2011 +0100 @@ -6,7 +6,9 @@ def test_nose_setup(testdir): p = testdir.makepyfile(""" l = [] + from nose.tools import with_setup + @with_setup(lambda: l.append(1), lambda: l.append(2)) def test_hello(): assert l == [1] @@ -24,6 +26,8 @@ def test_nose_setup_func(testdir): p = testdir.makepyfile(""" + from nose.tools import with_setup + l = [] def my_setup(): @@ -34,16 +38,15 @@ b = 2 l.append(b) + @with_setup(my_setup, my_teardown) def test_hello(): - print l + print (l) assert l == [1] def test_world(): - print l + print (l) assert l == [1,2] - test_hello.setup = my_setup - test_hello.teardown = my_teardown """) result = testdir.runpytest(p, '-p', 'nose') result.stdout.fnmatch_lines([ @@ -53,25 +56,25 @@ def test_nose_setup_func_failure(testdir): p = testdir.makepyfile(""" + from nose.tools import with_setup + l = [] - my_setup = lambda x: 1 my_teardown = lambda x: 2 + @with_setup(my_setup, my_teardown) def test_hello(): - print l + print (l) assert l == [1] def test_world(): - print l + print (l) assert l == [1,2] - test_hello.setup = my_setup - test_hello.teardown = my_teardown """) result = testdir.runpytest(p, '-p', 'nose') result.stdout.fnmatch_lines([ - "*TypeError: () takes exactly 1 argument (0 given)*" + "*TypeError: () takes exactly 1*0 given*" ]) @@ -83,11 +86,11 @@ my_teardown = 2 def test_hello(): - print l + print (l) assert l == [1] def test_world(): - print l + print (l) assert l == [1,2] test_hello.setup = my_setup @@ -118,11 +121,11 @@ my_teardown_partial = partial(my_teardown, 2) def test_hello(): - print l + print (l) assert l == [1] def test_world(): - print l + print (l) assert l == [1,2] test_hello.setup = my_setup_partial @@ -173,21 +176,21 @@ class TestClass(object): def setup(self): - print "setup called in", self + print ("setup called in %s" % self) self.called = ['setup'] def teardown(self): - print "teardown called in", self + print ("teardown called in %s" % self) eq_(self.called, ['setup']) self.called.append('teardown') def test(self): - print "test called in", self + print ("test called in %s" % self) for i in range(0, 5): yield self.check, i def check(self, i): - print "check called in", self + print ("check called in %s" % self) expect = ['setup'] #for x in range(0, i): # expect.append('setup') --- a/tox.ini Tue Jan 11 15:54:47 2011 +0100 +++ b/tox.ini Tue Jan 11 17:27:34 2011 +0100 @@ -49,6 +49,7 @@ [testenv:py31] deps=py>=1.4.0 + nose>=1.0 [testenv:py31-xdist] deps=pytest-xdist 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. From commits-noreply at bitbucket.org Wed Jan 12 17:19:37 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 12 Jan 2011 16:19:37 -0000 Subject: [py-svn] commit/py: hpk: fix issue17 (of the pytest tracker): import-* statements could be processed wrong on python3 because they are disallowed in functions (which were temporarily created) Message-ID: <20110112161937.25390.28884@bitbucket02.managed.contegix.com> 1 new changeset in py: http://bitbucket.org/hpk42/py/changeset/abdcfe8f9417/ changeset: r1993:abdcfe8f9417 user: hpk date: 2011-01-12 17:17:54 summary: fix issue17 (of the pytest tracker): import-* statements could be processed wrong on python3 because they are disallowed in functions (which were temporarily created) affected #: 7 files (415 bytes) --- a/CHANGELOG Mon Nov 29 16:57:53 2010 +0100 +++ b/CHANGELOG Wed Jan 12 17:17:54 2011 +0100 @@ -1,3 +1,8 @@ +Changes between 1.4.0 and 1.4.1 +================================================== + +- fix (pytest-) issue17 where python3 does not like "import *" + leading to misrepresentation of import-errors in test modules Changes between 1.3.4 and 1.4.0 ================================================== --- a/py/__init__.py Mon Nov 29 16:57:53 2010 +0100 +++ b/py/__init__.py Wed Jan 12 17:17:54 2011 +0100 @@ -8,7 +8,7 @@ (c) Holger Krekel and others, 2004-2010 """ -__version__ = '1.4.0' +__version__ = '1.4.1.dev1' from py import _apipkg --- a/py/_code/source.py Mon Nov 29 16:57:53 2010 +0100 +++ b/py/_code/source.py Wed Jan 12 17:17:54 2011 +0100 @@ -126,7 +126,7 @@ continue trylines = self.lines[start:lineno+1] # quick hack to indent the source and get it as a string in one go - trylines.insert(0, 'def xxx():') + trylines.insert(0, 'if xxx:') trysource = '\n '.join(trylines) # ^ space here try: --- a/setup.py Mon Nov 29 16:57:53 2010 +0100 +++ b/setup.py Wed Jan 12 17:17:54 2011 +0100 @@ -9,7 +9,7 @@ name='py', description='library with cross-python path, ini-parsing, io, code, log facilities', long_description = open('README.txt').read(), - version='1.4.0', + version='1.4.1.dev1', url='http://pylib.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], --- a/testing/code/__init__.py Mon Nov 29 16:57:53 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -# --- a/testing/code/test_source.py Mon Nov 29 16:57:53 2010 +0100 +++ b/testing/code/test_source.py Wed Jan 12 17:17:54 2011 +0100 @@ -230,6 +230,11 @@ assert len(source) == 9 assert source.getstatementrange(5) == (0, 9) + def test_getstatementrange_out_of_bounds_py3(self): + source = Source("if xxx:\n from .collections import *") + r = source.getstatementrange(1) + assert r == (1,2) + @py.test.mark.skipif("sys.version_info < (2,6)") def test_compile_to_ast(self): import ast @@ -423,3 +428,4 @@ _, A_lineno = py.std.inspect.findsource(A) assert fspath.basename == "test_source.py" assert lineno == A_lineno + --- a/tox.ini Mon Nov 29 16:57:53 2010 +0100 +++ b/tox.ini Wed Jan 12 17:17:54 2011 +0100 @@ -1,12 +1,12 @@ [tox] -envlist=py26,py27,py31,py27-xdist,py25,py24 +envlist=py26,py27,py31,py32,py27-xdist,py25,py24 indexserver= default=http://pypi.testrun.org [testenv] changedir=testing commands=py.test -rfsxX --junitxml={envlogdir}/junit-{envname}.xml [] -deps=pytest>=2.0.0.dev34 +deps=pytest>=2.0.0 [testenv:py27-xdist] basepython=python2.7 Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Wed Jan 12 17:21:27 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 12 Jan 2011 16:21:27 -0000 Subject: [py-svn] commit/pytest: hpk: fix issue17 by requiring an update to pylib which helps to fix it Message-ID: <20110112162127.25392.41247@bitbucket02.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/eb755286f7ff/ changeset: r2134:eb755286f7ff user: hpk date: 2011-01-12 17:21:11 summary: fix issue17 by requiring an update to pylib which helps to fix it affected #: 3 files (107 bytes) --- a/CHANGELOG Tue Jan 11 17:27:34 2011 +0100 +++ b/CHANGELOG Wed Jan 12 17:21:11 2011 +0100 @@ -1,6 +1,7 @@ Changes between 2.0.0 and 2.0.1.devX ---------------------------------------------- - +- fix issue17 (import-* reporting issue on python3) by + requiring py>1.4.0 (1.4.1 is going to include it) - fix issue15: make nose compatibility tests compatible with python3 (now that nose-1.0 supports python3) - remove somewhat surprising "same-conftest" detection because --- a/pytest.py Tue Jan 11 17:27:34 2011 +0100 +++ b/pytest.py Wed Jan 12 17:21:11 2011 +0100 @@ -1,7 +1,7 @@ """ unit and functional testing with Python. """ -__version__ = '2.0.1.dev6' +__version__ = '2.0.1.dev7' __all__ = ['main'] from _pytest.core import main, UsageError, _preloadplugins --- a/setup.py Tue Jan 11 17:27:34 2011 +0100 +++ b/setup.py Wed Jan 12 17:21:11 2011 +0100 @@ -22,14 +22,14 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.0.1.dev6', + version='2.0.1.dev7', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel, Guido Wesdorp, Carl Friedrich Bolz, Armin Rigo, Maciej Fijalkowski & others', author_email='holger at merlinux.eu', entry_points= make_entry_points(), - install_requires=['py>=1.4.0'], + install_requires=['py>1.4.0'], classifiers=['Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 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. From commits-noreply at bitbucket.org Wed Jan 12 17:35:19 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 12 Jan 2011 16:35:19 -0000 Subject: [py-svn] commit/pytest: hpk: fix issue14 : it was actually issue14 instead of issue8 that was fixed with Message-ID: <20110112163519.20559.23774@bitbucket01.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/2cc3d8832a15/ changeset: r2135:2cc3d8832a15 user: hpk date: 2011-01-12 17:35:09 summary: fix issue14 : it was actually issue14 instead of issue8 that was fixed with the older https://bitbucket.org/hpk42/pytest/changeset/1c3eb86502b3 please try out with the usual "pip install -i http://pypi.testrun.org -U pytest" affected #: 1 file (1 byte) --- a/CHANGELOG Wed Jan 12 17:21:11 2011 +0100 +++ b/CHANGELOG Wed Jan 12 17:35:09 2011 +0100 @@ -23,7 +23,7 @@ passing (not xpassing) if they succeed. This only is true for "direct" setup/teardown invocations because teardown_class/ teardown_module cannot closely relate to a single test. -- fix issue8: no logging errors at process exit +- fix issue14: no logging errors at process exit - refinements to "collecting" output on non-ttys - refine internal plugin registration and --traceconfig output - introduce a mechanism to prevent/unregister plugins from the 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. From commits-noreply at bitbucket.org Wed Jan 12 18:04:07 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 12 Jan 2011 17:04:07 -0000 Subject: [py-svn] commit/pytest: hpk: use pypi.testrun.org so that py>1.4.0 gets picked up correctly Message-ID: <20110112170407.12084.36689@bitbucket03.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/49dca36e9601/ changeset: r2136:49dca36e9601 user: hpk date: 2011-01-12 18:03:55 summary: use pypi.testrun.org so that py>1.4.0 gets picked up correctly affected #: 1 file (39 bytes) --- a/tox.ini Wed Jan 12 17:35:09 2011 +0100 +++ b/tox.ini Wed Jan 12 18:03:55 2011 +0100 @@ -2,15 +2,16 @@ distshare={homedir}/.tox/distshare envlist=py26,py27,py31,py32,py27-xdist,py25,py24 indexserver= - default = http://pypi.python.org/simple + pypi = http://pypi.python.org/simple testrun = http://pypi.testrun.org + default = http://pypi.testrun.org [testenv] changedir=testing commands= py.test -rfsxX --junitxml={envlogdir}/junit-{envname}.xml [] deps= - pexpect - nose + :pypi:pexpect + :pypi:nose [testenv:genscript] changedir=. @@ -28,7 +29,7 @@ [testenv:trial] changedir=. basepython=python2.6 -deps=twisted +deps=:pypi:twisted commands= py.test -rsxf \ --junitxml={envlogdir}/junit-{envname}.xml [testing/test_unittest.py] @@ -41,15 +42,15 @@ [testenv:doc] basepython=python changedir=doc -deps=sphinx +deps=:pypi:sphinx pytest commands= make html [testenv:py31] -deps=py>=1.4.0 - nose>=1.0 +deps=py>1.4.0 + :pypi:nose>=1.0 [testenv:py31-xdist] deps=pytest-xdist @@ -64,7 +65,7 @@ changedir=testing commands= {envpython} {envbindir}/py.test-jython --no-tools-on-path \ - -rfsxX --junitxml={envlogdir}/junit-{envname}2.xml [acceptance_test.py plugin] + -rfsxX --junitxml={envlogdir}/junit-{envname}2.xml [] [pytest] minversion=2.0 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. From commits-noreply at bitbucket.org Wed Jan 12 18:58:27 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 12 Jan 2011 17:58:27 -0000 Subject: [py-svn] commit/pytest: hpk: pypy doesn't neccessarily honour -OO it seems, let's not test assertions there. Message-ID: <20110112175827.12084.7280@bitbucket03.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/2ab7c6c0ea8c/ changeset: r2137:2ab7c6c0ea8c user: hpk date: 2011-01-12 18:57:40 summary: pypy doesn't neccessarily honour -OO it seems, let's not test assertions there. affected #: 1 file (42 bytes) --- a/testing/test_assertion.py Wed Jan 12 18:03:55 2011 +0100 +++ b/testing/test_assertion.py Wed Jan 12 18:57:40 2011 +0100 @@ -206,7 +206,7 @@ "*test_traceback_failure.py:4: AssertionError" ]) - at pytest.mark.skipif("sys.version_info < (2,5)") + at pytest.mark.skipif("sys.version_info < (2,5) or '__pypy__' in sys.builtin_module_names") def test_warn_missing(testdir): p1 = testdir.makepyfile("") result = testdir.run(sys.executable, "-OO", "-m", "pytest", "-h") 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. From commits-noreply at bitbucket.org Wed Jan 12 19:16:45 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 12 Jan 2011 18:16:45 -0000 Subject: [py-svn] commit/py: hpk: fix pytest issue-tracker issue10, more careful bool-checking of assert reintepretation expressions Message-ID: <20110112181645.20559.66952@bitbucket01.managed.contegix.com> 1 new changeset in py: http://bitbucket.org/hpk42/py/changeset/9e9f978340a4/ changeset: r1994:9e9f978340a4 user: hpk date: 2011-01-12 19:16:36 summary: fix pytest issue-tracker issue10, more careful bool-checking of assert reintepretation expressions affected #: 5 files (704 bytes) --- a/CHANGELOG Wed Jan 12 17:17:54 2011 +0100 +++ b/CHANGELOG Wed Jan 12 19:16:36 2011 +0100 @@ -1,6 +1,9 @@ Changes between 1.4.0 and 1.4.1 ================================================== +- fix (pytest-) issue10 and refine assertion reinterpretation + to avoid breaking if the __nonzero__ of an object fails + - fix (pytest-) issue17 where python3 does not like "import *" leading to misrepresentation of import-errors in test modules --- a/py/__init__.py Wed Jan 12 17:17:54 2011 +0100 +++ b/py/__init__.py Wed Jan 12 19:16:36 2011 +0100 @@ -8,7 +8,7 @@ (c) Holger Krekel and others, 2004-2010 """ -__version__ = '1.4.1.dev1' +__version__ = '1.4.1.dev2' from py import _apipkg --- a/py/_code/_assertionnew.py Wed Jan 12 17:17:54 2011 +0100 +++ b/py/_code/_assertionnew.py Wed Jan 12 19:16:36 2011 +0100 @@ -174,7 +174,12 @@ __exprinfo_right=next_result) except Exception: raise Failure(explanation) - if not result: + try: + if not result: + break + except KeyboardInterrupt: + raise + except: break left_explanation, left_result = next_explanation, next_result --- a/setup.py Wed Jan 12 17:17:54 2011 +0100 +++ b/setup.py Wed Jan 12 19:16:36 2011 +0100 @@ -9,7 +9,7 @@ name='py', description='library with cross-python path, ini-parsing, io, code, log facilities', long_description = open('README.txt').read(), - version='1.4.1.dev1', + version='1.4.1.dev2', url='http://pylib.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], --- a/testing/code/test_assertion.py Wed Jan 12 17:17:54 2011 +0100 +++ b/testing/code/test_assertion.py Wed Jan 12 19:16:36 2011 +0100 @@ -303,3 +303,19 @@ assert 're-run' not in s assert 'could not determine' in s +def test_assert_raises_in_nonzero_of_object_pytest_issue10(): + class A(object): + def __nonzero__(self): + raise ValueError(42) + def __lt__(self, other): + return A() + def __repr__(self): + return "" + def myany(x): + return True + try: + assert not(myany(A() < 0)) + except AssertionError: + e = exvalue() + s = str(e) + assert "< 0" in s Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Wed Jan 12 19:18:15 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 12 Jan 2011 18:18:15 -0000 Subject: [py-svn] commit/pytest: hpk: fix issue10 - numpy arrays should now work better in assertion expressions Message-ID: <20110112181815.12084.35946@bitbucket03.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/f6fe3d34b641/ changeset: r2138:f6fe3d34b641 user: hpk date: 2011-01-12 19:17:54 summary: fix issue10 - numpy arrays should now work better in assertion expressions (or any other objects which have an exception-raising __nonzero__ method ...) affected #: 1 file (93 bytes) --- a/CHANGELOG Wed Jan 12 18:57:40 2011 +0100 +++ b/CHANGELOG Wed Jan 12 19:17:54 2011 +0100 @@ -2,6 +2,8 @@ ---------------------------------------------- - fix issue17 (import-* reporting issue on python3) by requiring py>1.4.0 (1.4.1 is going to include it) +- fix issue10 (numpy arrays truth checking) by refining + assertion interpretation in py lib - fix issue15: make nose compatibility tests compatible with python3 (now that nose-1.0 supports python3) - remove somewhat surprising "same-conftest" detection because 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. From commits-noreply at bitbucket.org Wed Jan 12 20:32:27 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 12 Jan 2011 19:32:27 -0000 Subject: [py-svn] commit/pytest: hpk: fix issue12 - show plugin versions with "--version" and "--traceconfig" and also document how to add extra information to reporting test header Message-ID: <20110112193227.20559.27303@bitbucket01.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/81a1105d2fee/ changeset: r2139:81a1105d2fee user: hpk date: 2011-01-12 19:39:36 summary: fix issue12 - show plugin versions with "--version" and "--traceconfig" and also document how to add extra information to reporting test header affected #: 9 files (3.1 KB) --- a/CHANGELOG Wed Jan 12 19:17:54 2011 +0100 +++ b/CHANGELOG Wed Jan 12 19:39:36 2011 +0100 @@ -1,5 +1,8 @@ Changes between 2.0.0 and 2.0.1.devX ---------------------------------------------- +- fix issue12 - show plugin versions with "--version" and + "--traceconfig" and also document how to add extra information + to reporting test header - fix issue17 (import-* reporting issue on python3) by requiring py>1.4.0 (1.4.1 is going to include it) - fix issue10 (numpy arrays truth checking) by refining --- a/_pytest/core.py Wed Jan 12 19:17:54 2011 +0100 +++ b/_pytest/core.py Wed Jan 12 19:39:36 2011 +0100 @@ -63,6 +63,7 @@ self._plugins = [] self._hints = [] self.trace = TagTracer().get("pluginmanage") + self._plugin_distinfo = [] if os.environ.get('PYTEST_DEBUG'): err = sys.stderr encoding = getattr(err, 'encoding', 'utf8') @@ -156,6 +157,7 @@ plugin = ep.load() except DistributionNotFound: continue + self._plugin_distinfo.append((ep.dist, plugin)) self.register(plugin, name=name) def consider_preparse(self, args): --- a/_pytest/helpconfig.py Wed Jan 12 19:17:54 2011 +0100 +++ b/_pytest/helpconfig.py Wed Jan 12 19:39:36 2011 +0100 @@ -28,6 +28,10 @@ p = py.path.local(pytest.__file__) sys.stderr.write("This is py.test version %s, imported from %s\n" % (pytest.__version__, p)) + plugininfo = getpluginversioninfo(config) + if plugininfo: + for line in plugininfo: + sys.stderr.write(line + "\n") return 0 elif config.option.help: config.pluginmanager.do_configure(config) @@ -69,11 +73,26 @@ ('pytest_plugins', 'list of plugin names to load'), ] +def getpluginversioninfo(config): + lines = [] + plugininfo = config.pluginmanager._plugin_distinfo + if plugininfo: + lines.append("setuptools registered plugins:") + for dist, plugin in plugininfo: + loc = getattr(plugin, '__file__', repr(plugin)) + content = "%s-%s at %s" % (dist.project_name, dist.version, loc) + lines.append(" " + content) + return lines + def pytest_report_header(config): lines = [] if config.option.debug or config.option.traceconfig: lines.append("using: pytest-%s pylib-%s" % (pytest.__version__,py.__version__)) + + verinfo = getpluginversioninfo(config) + if verinfo: + lines.extend(verinfo) if config.option.traceconfig: lines.append("active plugins:") --- a/doc/example/simple.txt Wed Jan 12 19:17:54 2011 +0100 +++ b/doc/example/simple.txt Wed Jan 12 19:39:36 2011 +0100 @@ -138,7 +138,7 @@ E assert 4 < 4 test_compute.py:3: AssertionError - 1 failed, 4 passed in 0.02 seconds + 1 failed, 4 passed in 0.03 seconds As expected when running the full range of ``param1`` values we'll get an error on the last one. @@ -167,13 +167,13 @@ $ py.test =========================== test session starts ============================ - platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev3 + platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev8 gw0 I / gw1 I / gw2 I / gw3 I gw0 [0] / gw1 [0] / gw2 [0] / gw3 [0] scheduling tests via LoadScheduling - ============================= in 0.29 seconds ============================= + ============================= in 0.43 seconds ============================= .. _`retrieved by hooks as item keywords`: @@ -214,12 +214,12 @@ $ py.test -rs # "-rs" means report details on the little 's' =========================== test session starts ============================ - platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev3 + platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev8 collecting ... collected 2 items test_module.py .s ========================= short test summary info ========================== - SKIP [1] /tmp/doc-exec-25/conftest.py:9: need --runslow option to run + SKIP [1] /tmp/doc-exec-46/conftest.py:9: need --runslow option to run =================== 1 passed, 1 skipped in 0.02 seconds ==================== @@ -227,7 +227,7 @@ $ py.test --runslow =========================== test session starts ============================ - platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev3 + platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev8 collecting ... collected 2 items test_module.py .. @@ -303,3 +303,57 @@ to rather use your own application module rather than ``sys`` for handling flag. +Adding info to test report header +-------------------------------------------------------------- + +.. regendoc:wipe + +It's easy to present extra information in a py.test run:: + + # content of conftest.py + + def pytest_report_header(config): + return "project deps: mylib-1.1" + +which will add the string to the test header accordingly:: + + $ py.test + =========================== test session starts ============================ + platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev8 + project deps: mylib-1.1 + collecting ... collected 0 items + + ============================= in 0.00 seconds ============================= + +.. regendoc:wipe + +You can also return a list of strings which will be considered as several +lines of information. You can of course also make the amount of reporting +information on e.g. the value of ``config.option.verbose`` so that +you present more information appropriately:: + + # content of conftest.py + + def pytest_report_header(config): + if config.option.verbose > 0: + return ["info1: did you know that ...", "did you?"] + +which will add info only when run with "--v":: + + $ py.test -v + =========================== test session starts ============================ + platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev8 -- /home/hpk/venv/0/bin/python + info1: did you know that ... + did you? + collecting ... collected 0 items + + ============================= in 0.00 seconds ============================= + +and nothing when run plainly:: + + $ py.test + =========================== test session starts ============================ + platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev8 + collecting ... collected 0 items + + ============================= in 0.00 seconds ============================= --- a/pytest.py Wed Jan 12 19:17:54 2011 +0100 +++ b/pytest.py Wed Jan 12 19:39:36 2011 +0100 @@ -1,7 +1,7 @@ """ unit and functional testing with Python. """ -__version__ = '2.0.1.dev7' +__version__ = '2.0.1.dev8' __all__ = ['main'] from _pytest.core import main, UsageError, _preloadplugins --- a/setup.py Wed Jan 12 19:17:54 2011 +0100 +++ b/setup.py Wed Jan 12 19:39:36 2011 +0100 @@ -22,7 +22,7 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.0.1.dev7', + version='2.0.1.dev8', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], --- a/testing/test_config.py Wed Jan 12 19:17:54 2011 +0100 +++ b/testing/test_config.py Wed Jan 12 19:39:36 2011 +0100 @@ -231,6 +231,8 @@ assert name == "pytest11" class EntryPoint: name = "mytestplugin" + class dist: + pass def load(self): class PseudoPlugin: x = 42 --- a/testing/test_core.py Wed Jan 12 19:17:54 2011 +0100 +++ b/testing/test_core.py Wed Jan 12 19:39:36 2011 +0100 @@ -66,6 +66,7 @@ assert name == "pytest11" class EntryPoint: name = "pytest_mytestplugin" + dist = None def load(self): class PseudoPlugin: x = 42 --- a/testing/test_helpconfig.py Wed Jan 12 19:17:54 2011 +0100 +++ b/testing/test_helpconfig.py Wed Jan 12 19:39:36 2011 +0100 @@ -1,13 +1,18 @@ import py, pytest,os from _pytest.helpconfig import collectattr -def test_version(testdir): +def test_version(testdir, pytestconfig): result = testdir.runpytest("--version") assert result.ret == 0 #p = py.path.local(py.__file__).dirpath() result.stderr.fnmatch_lines([ '*py.test*%s*imported from*' % (pytest.__version__, ) ]) + if pytestconfig.pluginmanager._plugin_distinfo: + result.stderr.fnmatch_lines([ + "*setuptools registered plugins:", + "*at*", + ]) def test_help(testdir): result = testdir.runpytest("--help") @@ -51,3 +56,9 @@ result = testdir.runpytest() assert result.ret == 0 +def test_traceconfig(testdir): + result = testdir.runpytest("--traceconfig") + result.stdout.fnmatch_lines([ + "*using*pytest*py*", + "*active plugins*", + ]) 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. From commits-noreply at bitbucket.org Thu Jan 13 20:07:01 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Thu, 13 Jan 2011 19:07:01 -0000 Subject: [py-svn] commit/apipkg: hpk: small internal refinement to AliasModules - only useful when directly calling Message-ID: <20110113190701.8338.4593@bitbucket02.managed.contegix.com> 1 new changeset in apipkg: http://bitbucket.org/hpk42/apipkg/changeset/e7ffdd53c2bb/ changeset: r54:e7ffdd53c2bb user: hpk date: 2011-01-13 20:05:42 summary: small internal refinement to AliasModules - only useful when directly calling AliasModule(...) for now. affected #: 3 files (405 bytes) --- a/apipkg.py Sat Nov 13 08:42:39 2010 +0100 +++ b/apipkg.py Thu Jan 13 20:05:42 2011 +0100 @@ -9,7 +9,7 @@ import sys from types import ModuleType -__version__ = '1.2.dev5' +__version__ = '1.2.dev6' def initpkg(pkgname, exportdefs, attr=dict()): """ initialize given package from the export definitions. """ @@ -136,18 +136,24 @@ __dict__ = property(__dict__) -def AliasModule(modname, modpath): +def AliasModule(modname, modpath, attrname=None): mod = [] def getmod(): if not mod: - mod.append(importobj(modpath, None)) + x = importobj(modpath, None) + if attrname is not None: + x = getattr(x, attrname) + mod.append(x) return mod[0] class AliasModule(ModuleType): def __repr__(self): - return '' % (modname, modpath) + x = modpath + if attrname: + x += "." + attrname + return '' % (modname, x) def __getattribute__(self, name): return getattr(getmod(), name) --- a/setup.py Sat Nov 13 08:42:39 2010 +0100 +++ b/setup.py Thu Jan 13 20:05:42 2011 +0100 @@ -19,7 +19,7 @@ description= 'apipkg: namespace control and lazy-import mechanism', long_description = open('README.txt').read(), - version='1.2.dev5', + version='1.2.dev6', url='http://bitbucket.org/hpk42/apipkg', license='MIT License', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], --- a/test_apipkg.py Sat Nov 13 08:42:39 2010 +0100 +++ b/test_apipkg.py Thu Jan 13 20:05:42 2011 +0100 @@ -402,6 +402,12 @@ import extra_attributes assert extra_attributes.foo == 'bar' +def test_aliasmodule_aliases_an_attribute(): + am = apipkg.AliasModule("mymod", "pprint", 'PrettyPrinter') + r = repr(am) + assert "" == r + assert am.format + def test_aliasmodule_repr(): am = apipkg.AliasModule("mymod", "sys") r = repr(am) Repository URL: https://bitbucket.org/hpk42/apipkg/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Thu Jan 13 20:11:30 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Thu, 13 Jan 2011 19:11:30 -0000 Subject: [py-svn] commit/py: hpk: fix issue1 - make py.error.* instances pickleable Message-ID: <20110113191130.22541.9166@bitbucket03.managed.contegix.com> 1 new changeset in py: http://bitbucket.org/hpk42/py/changeset/c5f99061a6f8/ changeset: r1995:c5f99061a6f8 user: hpk date: 2011-01-13 20:11:17 summary: fix issue1 - make py.error.* instances pickleable affected #: 4 files (547 bytes) --- a/CHANGELOG Wed Jan 12 19:16:36 2011 +0100 +++ b/CHANGELOG Thu Jan 13 20:11:17 2011 +0100 @@ -1,6 +1,8 @@ Changes between 1.4.0 and 1.4.1 ================================================== +- fix issue1 - py.error.* classes to be pickleable + - fix (pytest-) issue10 and refine assertion reinterpretation to avoid breaking if the __nonzero__ of an object fails --- a/py/__init__.py Wed Jan 12 19:16:36 2011 +0100 +++ b/py/__init__.py Thu Jan 13 20:11:17 2011 +0100 @@ -12,6 +12,10 @@ from py import _apipkg +# so that py.error.* instances are picklable +import sys +sys.modules['py.error'] = _apipkg.AliasModule("py.error", "py._error", 'error') + _apipkg.initpkg(__name__, attr={'_apipkg': _apipkg}, exportdefs={ # access to all standard lib modules 'std': '._std:std', @@ -141,3 +145,4 @@ }, }) + --- a/py/_apipkg.py Wed Jan 12 19:16:36 2011 +0100 +++ b/py/_apipkg.py Thu Jan 13 20:11:17 2011 +0100 @@ -9,7 +9,7 @@ import sys from types import ModuleType -__version__ = '1.2.dev5' +__version__ = '1.2.dev6' def initpkg(pkgname, exportdefs, attr=dict()): """ initialize given package from the export definitions. """ @@ -136,18 +136,24 @@ __dict__ = property(__dict__) -def AliasModule(modname, modpath): +def AliasModule(modname, modpath, attrname=None): mod = [] def getmod(): if not mod: - mod.append(importobj(modpath, None)) + x = importobj(modpath, None) + if attrname is not None: + x = getattr(x, attrname) + mod.append(x) return mod[0] class AliasModule(ModuleType): def __repr__(self): - return '' % (modname, modpath) + x = modpath + if attrname: + x += "." + attrname + return '' % (modname, x) def __getattribute__(self, name): return getattr(getmod(), name) --- a/testing/root/test_error.py Wed Jan 12 19:16:36 2011 +0100 +++ b/testing/root/test_error.py Thu Jan 13 20:11:17 2011 +0100 @@ -9,6 +9,12 @@ assert issubclass(x, py.error.Error) assert issubclass(x, EnvironmentError) +def test_picklability_issue1(): + e1 = py.error.ENOENT() + s = py.std.pickle.dumps(e1) + e2 = py.std.pickle.loads(s) + assert isinstance(e2, py.error.ENOENT) + def test_unknown_error(): num = 3999 cls = py.error._geterrnoclass(num) Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Fri Jan 14 11:39:27 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Fri, 14 Jan 2011 10:39:27 -0000 Subject: [py-svn] commit/py: hpk: need to use confcutdir again, it seems Message-ID: <20110114103927.29197.47491@bitbucket01.managed.contegix.com> 1 new changeset in py: http://bitbucket.org/hpk42/py/changeset/3aa890ec24f2/ changeset: r1996:3aa890ec24f2 user: hpk date: 2011-01-14 00:05:36 summary: need to use confcutdir again, it seems affected #: 1 file (48 bytes) --- a/tox.ini Thu Jan 13 20:11:17 2011 +0100 +++ b/tox.ini Fri Jan 14 00:05:36 2011 +0100 @@ -5,7 +5,7 @@ [testenv] changedir=testing -commands=py.test -rfsxX --junitxml={envlogdir}/junit-{envname}.xml [] +commands=py.test --confcutdir=.. -rfsxX --junitxml={envlogdir}/junit-{envname}.xml [] deps=pytest>=2.0.0 [testenv:py27-xdist] @@ -14,13 +14,13 @@ pytest pytest-xdist commands= - py.test -n3 -rfsxX \ + py.test -n3 -rfsxX --confcutdir=.. \ --junitxml={envlogdir}/junit-{envname}.xml [] [testenv:jython] changedir=testing commands= - {envpython} -m pytest -rfsxX --junitxml={envlogdir}/junit-{envname}0.xml [io_ code] + {envpython} -m pytest --confcutdir=.. -rfsxX --junitxml={envlogdir}/junit-{envname}0.xml [io_ code] [pytest] rsyncdirs = conftest.py py doc testing Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Fri Jan 14 12:37:36 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Fri, 14 Jan 2011 11:37:36 -0000 Subject: [py-svn] commit/pytest: hpk: fix typo (thanks derdon) Message-ID: <20110114113736.29197.64670@bitbucket01.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/e42af44e18ad/ changeset: r2140:e42af44e18ad user: hpk date: 2011-01-13 23:50:10 summary: fix typo (thanks derdon) affected #: 1 file (2 bytes) --- a/doc/xunit_setup.txt Wed Jan 12 19:39:36 2011 +0100 +++ b/doc/xunit_setup.txt Thu Jan 13 23:50:10 2011 +0100 @@ -73,7 +73,7 @@ function. Invoked for every test function in the module. """ - def teardown_method(function): + def teardown_function(function): """ teardown any state that was previously setup with a setup_function call. """ 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. From commits-noreply at bitbucket.org Fri Jan 14 13:30:45 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Fri, 14 Jan 2011 12:30:45 -0000 Subject: [py-svn] commit/pytest: hpk: fix regression with yield-based tests (hopefully) Message-ID: <20110114123045.9199.15308@bitbucket02.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/2afea080a9e6/ changeset: r2141:2afea080a9e6 user: hpk date: 2011-01-14 13:30:36 summary: fix regression with yield-based tests (hopefully) affected #: 3 files (2.1 KB) --- a/CHANGELOG Thu Jan 13 23:50:10 2011 +0100 +++ b/CHANGELOG Fri Jan 14 13:30:36 2011 +0100 @@ -1,5 +1,6 @@ Changes between 2.0.0 and 2.0.1.devX ---------------------------------------------- + - fix issue12 - show plugin versions with "--version" and "--traceconfig" and also document how to add extra information to reporting test header @@ -34,6 +35,12 @@ - introduce a mechanism to prevent/unregister plugins from the command line, see http://pytest.org/plugins.html#cmdunregister - activate resultlog plugin by default +- fix regression wrt yielded tests which due to the + collection-before-running semantics were not + setup as with pytest 1.3.4. Note, however, that + the recommended and much cleaner way to do test + parametraization remains the "pytest_generate_tests" + mechanism, see the docs. Changes between 1.3.4 and 2.0.0 ---------------------------------------------- --- a/_pytest/python.py Thu Jan 13 23:50:10 2011 +0100 +++ b/_pytest/python.py Fri Jan 14 13:30:36 2011 +0100 @@ -304,7 +304,9 @@ name = 'setup_method' else: name = 'setup_function' - if isinstance(self.parent, Instance): + if hasattr(self, '_preservedparent'): + obj = self._preservedparent + elif isinstance(self.parent, Instance): obj = self.parent.newinstance() self.obj = self._getobj() else: @@ -377,7 +379,8 @@ # invoke setup/teardown on popular request # (induced by the common "test_*" naming shared with normal tests) self.config._setupstate.prepare(self) - + # see FunctionMixin.setup and test_setupstate_is_preserved_134 + self._preservedparent = self.parent.obj l = [] seen = {} for i, x in enumerate(self.obj()): --- a/testing/test_python.py Thu Jan 13 23:50:10 2011 +0100 +++ b/testing/test_python.py Fri Jan 14 13:30:36 2011 +0100 @@ -196,6 +196,49 @@ assert passed == 4 assert not skipped and not failed + def test_setupstate_is_preserved_134(self, testdir): + # yield-based tests are messy wrt to setupstate because + # during collection they already invoke setup functions + # and then again when they are run. For now, we want to make sure + # that the old 1.3.4 behaviour is preserved such that all + # yielded functions all share the same "self" instance that + # has been used during collection. + o = testdir.makepyfile(""" + setuplist = [] + class TestClass: + def setup_method(self, func): + #print "setup_method", self, func + setuplist.append(self) + self.init = 42 + + def teardown_method(self, func): + self.init = None + + def test_func1(self): + pass + + def test_func2(self): + yield self.func2 + yield self.func2 + + def func2(self): + assert self.init + + def test_setuplist(): + # once for test_func2 during collection + # once for test_func1 during test run + # once for test_func2 during test run + #print setuplist + assert len(setuplist) == 3, len(setuplist) + assert setuplist[0] == setuplist[2], setuplist + assert setuplist[1] != setuplist[2], setuplist + """) + reprec = testdir.inline_run(o, '-v') + passed, skipped, failed = reprec.countoutcomes() + assert passed == 4 + assert not skipped and not failed + + class TestFunction: def test_getmodulecollector(self, testdir): item = testdir.getitem("def test_func(): pass") 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. From commits-noreply at bitbucket.org Fri Jan 14 14:05:33 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Fri, 14 Jan 2011 13:05:33 -0000 Subject: [py-svn] commit/py: hpk: fix issue2 on windows use PATHEXT for the list of extensions to try in order to to find binaries Message-ID: <20110114130533.20312.8381@bitbucket03.managed.contegix.com> 1 new changeset in py: http://bitbucket.org/hpk42/py/changeset/39007ef7bda6/ changeset: r1997:39007ef7bda6 user: hpk date: 2011-01-14 13:52:07 summary: fix issue2 on windows use PATHEXT for the list of extensions to try in order to to find binaries affected #: 2 files (145 bytes) --- a/CHANGELOG Fri Jan 14 00:05:36 2011 +0100 +++ b/CHANGELOG Fri Jan 14 13:52:07 2011 +0100 @@ -3,6 +3,9 @@ - fix issue1 - py.error.* classes to be pickleable +- fix issue2 - on windows32 use PATHEXT as the list of potential + extensions to find find binaries with py.path.local.sysfind(commandname) + - fix (pytest-) issue10 and refine assertion reinterpretation to avoid breaking if the __nonzero__ of an object fails --- a/py/_path/local.py Fri Jan 14 00:05:36 2011 +0100 +++ b/py/_path/local.py Fri Jan 14 13:52:07 2011 +0100 @@ -599,7 +599,7 @@ else: paths = [re.sub('%SystemRoot%', systemroot, path) for path in paths] - tryadd = '', '.exe', '.com', '.bat' # XXX add more? + tryadd = [''] + os.environ['PATHEXT'].split(os.pathsep) else: paths = py.std.os.environ['PATH'].split(':') tryadd = ('',) Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Tue Jan 18 12:53:12 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Tue, 18 Jan 2011 11:53:12 -0000 Subject: [py-svn] commit/pytest: 2 new changesets Message-ID: <20110118115312.29199.17407@bitbucket01.managed.contegix.com> 2 new changesets in pytest: http://bitbucket.org/hpk42/pytest/changeset/d7cafb762307/ changeset: r2142:d7cafb762307 user: hpk42 date: 2011-01-18 12:47:31 summary: fix a pypy related regression - re-allow self.NAME style collection tree customization affected #: 3 files (1.3 KB) --- a/_pytest/main.py Fri Jan 14 13:30:36 2011 +0100 +++ b/_pytest/main.py Tue Jan 18 12:47:31 2011 +0100 @@ -152,6 +152,7 @@ Module = compatproperty("Module") Class = compatproperty("Class") + Instance = compatproperty("Instance") Function = compatproperty("Function") File = compatproperty("File") Item = compatproperty("Item") --- a/_pytest/python.py Fri Jan 14 13:30:36 2011 +0100 +++ b/_pytest/python.py Tue Jan 18 12:47:31 2011 +0100 @@ -73,7 +73,7 @@ if collector._istestclasscandidate(name, obj): #if hasattr(collector.obj, 'unittest'): # return # we assume it's a mixin class for a TestCase derived one - return Class(name, parent=collector) + return collector.Class(name, parent=collector) elif collector.funcnamefilter(name) and hasattr(obj, '__call__'): if is_generator(obj): return Generator(name, parent=collector) @@ -160,7 +160,7 @@ for prefix in self.config.getini("python_functions"): if name.startswith(prefix): return True - + def classnamefilter(self, name): for prefix in self.config.getini("python_classes"): if name.startswith(prefix): @@ -214,11 +214,11 @@ plugins = self.getplugins() + extra gentesthook.pcall(plugins, metafunc=metafunc) if not metafunc._calls: - return Function(name, parent=self) + return self.Function(name, parent=self) l = [] for callspec in metafunc._calls: subname = "%s[%s]" %(name, callspec.id) - function = Function(name=subname, parent=self, + function = self.Function(name=subname, parent=self, callspec=callspec, callobj=funcobj, keywords={callspec.id:True}) l.append(function) return l @@ -272,7 +272,7 @@ class Class(PyCollectorMixin, pytest.Collector): def collect(self): - return [Instance(name="()", parent=self)] + return [self.Instance(name="()", parent=self)] def setup(self): setup_class = getattr(self.obj, 'setup_class', None) @@ -394,7 +394,7 @@ if name in seen: raise ValueError("%r generated tests with non-unique name %r" %(self, name)) seen[name] = True - l.append(Function(name, self, args=args, callobj=call)) + l.append(self.Function(name, self, args=args, callobj=call)) return l def getcallargs(self, obj): @@ -528,10 +528,10 @@ def addcall(self, funcargs=None, id=_notexists, param=_notexists): """ add a new call to the underlying test function during the collection phase of a test run. - + :arg funcargs: argument keyword dictionary used when invoking the test function. - + :arg id: used for reporting and identification purposes. If you don't supply an `id` the length of the currently list of calls to the test function will be used. @@ -562,7 +562,7 @@ class LookupError(LookupError): """ error on performing funcarg request. """ - + def __init__(self, pyfuncitem): self._pyfuncitem = pyfuncitem if hasattr(pyfuncitem, '_requestparam'): @@ -590,7 +590,7 @@ def module(self): """ module where the test function was collected. """ return self._pyfuncitem.getparent(pytest.Module).obj - + @property def cls(self): """ class (can be None) where the test function was collected. """ @@ -606,7 +606,7 @@ def config(self): """ the pytest config object associated with this request. """ return self._pyfuncitem.config - + @property def fspath(self): """ the file system path of the test module which collected this test. """ @@ -780,7 +780,7 @@ def raises(ExpectedException, *args, **kwargs): """ assert that a code block/function call raises @ExpectedException and raise a failure exception otherwise. - + If using Python 2.5 or above, you may use this function as a context manager:: @@ -803,7 +803,7 @@ A third possibility is to use a string which which will be executed:: - + >>> raises(ZeroDivisionError, "f(0)") """ @@ -852,3 +852,4 @@ pytest.fail("DID NOT RAISE") self.excinfo.__init__(tp) return issubclass(self.excinfo.type, self.ExpectedException) + --- a/testing/test_python.py Fri Jan 14 13:30:36 2011 +0100 +++ b/testing/test_python.py Tue Jan 18 12:47:31 2011 +0100 @@ -1280,3 +1280,49 @@ result.stdout.fnmatch_lines([ "*2 passed*", ]) + +def test_collector_attributes(testdir): + testdir.makeconftest(""" + import pytest + def pytest_pycollect_makeitem(collector): + assert collector.Function == pytest.Function + assert collector.Class == pytest.Class + assert collector.Instance == pytest.Instance + assert collector.Module == pytest.Module + """) + testdir.makepyfile(""" + def test_hello(): + pass + """) + result = testdir.runpytest() + result.stdout.fnmatch_lines([ + "*1 passed*", + ]) + +def test_customize_through_attributes(testdir): + testdir.makeconftest(""" + import pytest + class MyFunction(pytest.Function): + pass + class MyInstance(pytest.Instance): + Function = MyFunction + class MyClass(pytest.Class): + Instance = MyInstance + + def pytest_pycollect_makeitem(collector, name, obj): + if name.startswith("MyTestClass"): + return MyClass(name, parent=collector) + """) + testdir.makepyfile(""" + class MyTestClass: + def test_hello(self): + pass + """) + result = testdir.runpytest("--collectonly") + result.stdout.fnmatch_lines([ + "*MyClass*", + "*MyInstance*", + "*MyFunction*test_hello*", + ]) + + http://bitbucket.org/hpk42/pytest/changeset/88c0e00cfe8b/ changeset: r2143:88c0e00cfe8b user: hpk42 date: 2011-01-18 12:51:21 summary: refine and unify initial capturing - now works also if the logging module is already used from an early-loaded conftest.py file (prior to option parsing) affected #: 6 files (1.7 KB) --- a/CHANGELOG Tue Jan 18 12:47:31 2011 +0100 +++ b/CHANGELOG Tue Jan 18 12:51:21 2011 +0100 @@ -1,6 +1,9 @@ Changes between 2.0.0 and 2.0.1.devX ---------------------------------------------- +- refine and unify initial capturing so that it works nicely + even if the logging module is used on an early-loaded conftest.py + file or plugin. - fix issue12 - show plugin versions with "--version" and "--traceconfig" and also document how to add extra information to reporting test header --- a/_pytest/capture.py Tue Jan 18 12:47:31 2011 +0100 +++ b/_pytest/capture.py Tue Jan 18 12:51:21 2011 +0100 @@ -19,10 +19,8 @@ if content: repr.addsection("Captured std%s" % secname, content.rstrip()) -def pytest_configure(config): - config.pluginmanager.register(CaptureManager(), 'capturemanager') - def pytest_unconfigure(config): + # registered in config.py during early conftest.py loading capman = config.pluginmanager.getplugin('capturemanager') while capman._method2capture: name, cap = capman._method2capture.popitem() @@ -67,6 +65,14 @@ else: raise ValueError("unknown capturing method: %r" % method) + def _getmethod_preoptionparse(self, args): + if '-s' in args or "--capture=no" in args: + return "no" + elif hasattr(os, 'dup') and '--capture=sys' not in args: + return "fd" + else: + return "sys" + def _getmethod(self, config, fspath): if config.option.capture: method = config.option.capture --- a/_pytest/config.py Tue Jan 18 12:47:31 2011 +0100 +++ b/_pytest/config.py Tue Jan 18 12:51:21 2011 +0100 @@ -34,7 +34,7 @@ def getgroup(self, name, description="", after=None): """ get (or create) a named option Group. - + :name: unique name of the option group. :description: long description for --help output. :after: name of other group, used for ordering --help output. @@ -270,13 +270,16 @@ def _setinitialconftest(self, args): # capture output during conftest init (#issue93) - name = hasattr(os, 'dup') and 'StdCaptureFD' or 'StdCapture' - cap = getattr(py.io, name)() + from _pytest.capture import CaptureManager + capman = CaptureManager() + self.pluginmanager.register(capman, 'capturemanager') + # will be unregistered in capture.py's unconfigure() + capman.resumecapture(capman._getmethod_preoptionparse(args)) try: try: self._conftest.setinitial(args) finally: - out, err = cap.reset() + out, err = capman.suspendcapture() # logging might have got it except: sys.stdout.write(out) sys.stderr.write(err) @@ -417,7 +420,7 @@ if 'pytest' in iniconfig.sections: return iniconfig['pytest'] return {} - + def findupwards(current, basename): current = py.path.local(current) while 1: --- a/pytest.py Tue Jan 18 12:47:31 2011 +0100 +++ b/pytest.py Tue Jan 18 12:51:21 2011 +0100 @@ -1,7 +1,7 @@ """ unit and functional testing with Python. """ -__version__ = '2.0.1.dev8' +__version__ = '2.0.1.dev9' __all__ = ['main'] from _pytest.core import main, UsageError, _preloadplugins --- a/setup.py Tue Jan 18 12:47:31 2011 +0100 +++ b/setup.py Tue Jan 18 12:51:21 2011 +0100 @@ -22,7 +22,7 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.0.1.dev8', + version='2.0.1.dev9', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], @@ -67,4 +67,4 @@ return {'console_scripts': l} if __name__ == '__main__': - main() \ No newline at end of file + main() --- a/testing/test_capture.py Tue Jan 18 12:47:31 2011 +0100 +++ b/testing/test_capture.py Tue Jan 18 12:51:21 2011 +0100 @@ -325,6 +325,40 @@ ]) assert 'operation on closed file' not in result.stderr.str() + def test_conftestlogging_is_shown(self, testdir): + testdir.makeconftest(""" + import logging + logging.basicConfig() + logging.warn("hello435") + """) + # make sure that logging is still captured in tests + result = testdir.runpytest("-s", "-p", "no:capturelog") + assert result.ret == 0 + result.stderr.fnmatch_lines([ + "WARNING*hello435*", + ]) + assert 'operation on closed file' not in result.stderr.str() + + def test_conftestlogging_and_test_logging(self, testdir): + testdir.makeconftest(""" + import logging + logging.basicConfig() + """) + # make sure that logging is still captured in tests + p = testdir.makepyfile(""" + def test_hello(): + import logging + logging.warn("hello433") + assert 0 + """) + result = testdir.runpytest(p, "-p", "no:capturelog") + assert result.ret != 0 + result.stdout.fnmatch_lines([ + "WARNING*hello433*", + ]) + assert 'something' not in result.stderr.str() + assert 'operation on closed file' not in result.stderr.str() + class TestCaptureFuncarg: def test_std_functional(self, testdir): 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. From commits-noreply at bitbucket.org Thu Jan 20 22:02:17 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Thu, 20 Jan 2011 21:02:17 -0000 Subject: [py-svn] commit/pytest-codecheckers: RonnyPfannschmidt: code update, use ini file to list the checkers, make a opt-out option (breaks tests!) Message-ID: <20110120210217.5505.7468@bitbucket01.managed.contegix.com> 1 new changeset in pytest-codecheckers: http://bitbucket.org/RonnyPfannschmidt/pytest-codecheckers/changeset/35e51c4a7984/ changeset: r24:35e51c4a7984 user: RonnyPfannschmidt date: 2011-01-20 22:02:08 summary: code update, use ini file to list the checkers, make a opt-out option (breaks tests!) affected #: 2 files (230 bytes) --- a/codecheckers/plugin.py Sat Nov 13 22:53:36 2010 +0100 +++ b/codecheckers/plugin.py Thu Jan 20 22:02:08 2011 +0100 @@ -36,8 +36,11 @@ self.name += '[code-check]' def collect(self): - checkers = py.test.config.getvalue('codecheck') + if self.config.option.no_codechecks: + return [] + checkers = self.config.getini('codechecks') entrypoints = pkg_resources.iter_entry_points('codechecker') + #XXX: list wanted checkers we didnt get return [PyCodeCheckItem(ep, self) for ep in entrypoints if ep.name in checkers] @@ -47,4 +50,5 @@ def pytest_addoption(parser): - parser.addoption('--codecheck', action='append', default=[]) + parser.addini('codechecks', type='args', help='listings of the codechecks to use') + parser.addoption('--no-codechecks', action='store_true') --- a/tox.ini Sat Nov 13 22:53:36 2010 +0100 +++ b/tox.ini Thu Jan 20 22:02:08 2011 +0100 @@ -1,3 +1,5 @@ +[pytest] +codechecks = pep8 pyflakes [tox] indexserver = default = http://pypi.testrun.org Repository URL: https://bitbucket.org/RonnyPfannschmidt/pytest-codecheckers/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Wed Jan 26 17:15:07 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 26 Jan 2011 16:15:07 -0000 Subject: [py-svn] commit/py: hpk42: fix an issue crashing pypy Message-ID: <20110126161507.7065.89888@bitbucket01.managed.contegix.com> 1 new changeset in py: http://bitbucket.org/hpk42/py/changeset/2740d1268b14/ changeset: r1998:2740d1268b14 user: hpk42 date: 2011-01-26 17:14:58 summary: fix an issue crashing pypy affected #: 4 files (113 bytes) --- a/CHANGELOG Fri Jan 14 13:52:07 2011 +0100 +++ b/CHANGELOG Wed Jan 26 17:14:58 2011 +0100 @@ -12,6 +12,8 @@ - fix (pytest-) issue17 where python3 does not like "import *" leading to misrepresentation of import-errors in test modules +- fix py.error.* attribute pypy access issue + Changes between 1.3.4 and 1.4.0 ================================================== --- a/py/__init__.py Fri Jan 14 13:52:07 2011 +0100 +++ b/py/__init__.py Wed Jan 26 17:14:58 2011 +0100 @@ -8,7 +8,7 @@ (c) Holger Krekel and others, 2004-2010 """ -__version__ = '1.4.1.dev2' +__version__ = '1.4.1.dev3' from py import _apipkg @@ -145,4 +145,3 @@ }, }) - --- a/py/_error.py Fri Jan 14 13:52:07 2011 +0100 +++ b/py/_error.py Wed Jan 26 17:14:58 2011 +0100 @@ -37,6 +37,8 @@ _errno2class = {} def __getattr__(self, name): + if name[0] == "_": + raise AttributeError(name) eno = getattr(errno, name) cls = self._geterrnoclass(eno) setattr(self, name, cls) --- a/setup.py Fri Jan 14 13:52:07 2011 +0100 +++ b/setup.py Wed Jan 26 17:14:58 2011 +0100 @@ -9,7 +9,7 @@ name='py', description='library with cross-python path, ini-parsing, io, code, log facilities', long_description = open('README.txt').read(), - version='1.4.1.dev2', + version='1.4.1.dev3', url='http://pylib.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Wed Jan 26 22:51:13 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 26 Jan 2011 21:51:13 -0000 Subject: [py-svn] commit/py: hpk42: skip test with relative imports in python < 2, 6 Message-ID: <20110126215113.2400.26775@bitbucket03.managed.contegix.com> 1 new changeset in py: http://bitbucket.org/hpk42/py/changeset/bae37c2d1394/ changeset: r1999:bae37c2d1394 user: hpk42 date: 2011-01-26 22:51:00 summary: skip test with relative imports in python < 2,6 affected #: 1 file (53 bytes) --- a/testing/code/test_source.py Wed Jan 26 17:14:58 2011 +0100 +++ b/testing/code/test_source.py Wed Jan 26 22:51:00 2011 +0100 @@ -230,6 +230,7 @@ assert len(source) == 9 assert source.getstatementrange(5) == (0, 9) + @py.test.mark.skipif("sys.version_info < (2,6)") def test_getstatementrange_out_of_bounds_py3(self): source = Source("if xxx:\n from .collections import *") r = source.getstatementrange(1) Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Thu Jan 27 11:32:25 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Thu, 27 Jan 2011 10:32:25 -0000 Subject: [py-svn] commit/pytest: flub: Improve the "not in" assertion output Message-ID: <20110127103225.7066.40725@bitbucket01.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/ca8042c77ae9/ changeset: r2144:ca8042c77ae9 user: flub date: 2011-01-25 21:47:34 summary: Improve the "not in" assertion output This cleans up the generic diff and tailors the output more to this specific assertion (based on feedback from hpk). affected #: 1 file (357 bytes) --- a/_pytest/assertion.py Tue Jan 18 12:51:21 2011 +0100 +++ b/_pytest/assertion.py Tue Jan 25 20:47:34 2011 +0000 @@ -165,4 +165,15 @@ head = text[:index] tail = text[index+len(term):] correct_text = head + tail - return _diff_text(correct_text, text) + diff = _diff_text(correct_text, text) + newdiff = ['%s is contained here:' % py.io.saferepr(term, maxsize=42)] + for line in diff: + if line.startswith('Skipping'): + continue + if line.startswith('- '): + continue + if line.startswith('+ '): + newdiff.append(' ' + line[2:]) + else: + newdiff.append(line) + return newdiff 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. From commits-noreply at bitbucket.org Thu Jan 27 11:36:39 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Thu, 27 Jan 2011 10:36:39 -0000 Subject: [py-svn] commit/pytest: hpk42: fix test related to "not in" Message-ID: <20110127103639.7063.79528@bitbucket01.managed.contegix.com> 1 new changeset in pytest: http://bitbucket.org/hpk42/pytest/changeset/6f471fecb167/ changeset: r2145:6f471fecb167 user: hpk42 date: 2011-01-27 11:36:12 summary: fix test related to "not in" affected #: 2 files (21 bytes) --- a/CHANGELOG Tue Jan 25 20:47:34 2011 +0000 +++ b/CHANGELOG Thu Jan 27 11:36:12 2011 +0100 @@ -15,7 +15,7 @@ with python3 (now that nose-1.0 supports python3) - remove somewhat surprising "same-conftest" detection because it ignores conftest.py when they appear in several subdirs. -- improve assertions ("not in"), thanks Floris +- improve assertions ("not in"), thanks Floris Bruynooghe - improve behaviour/warnings when running on top of "python -OO" (assertions and docstrings are turned off, leading to potential false positives) --- a/testing/test_assertion.py Tue Jan 25 20:47:34 2011 +0000 +++ b/testing/test_assertion.py Thu Jan 27 11:36:12 2011 +0100 @@ -116,8 +116,7 @@ def test_reprcompare_notin(): detail = plugin.pytest_assertrepr_compare('not in', 'foo', 'aaafoobbb')[1:] - assert '- aaabbb' in detail - assert '+ aaafoobbb' in detail + assert detail == ["'foo' is contained here:", ' aaafoobbb', '? +++'] @needsnewassert def test_pytest_assertrepr_compare_integration(testdir): 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. From commits-noreply at bitbucket.org Thu Jan 27 15:13:22 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Thu, 27 Jan 2011 14:13:22 -0000 Subject: [py-svn] commit/py: hpk42: fix issue #20 path.samefile(relpath) works Message-ID: <20110127141322.2402.81343@bitbucket03.managed.contegix.com> 1 new changeset in py: http://bitbucket.org/hpk42/py/changeset/dac3d52eae84/ changeset: r2000:dac3d52eae84 user: hpk42 date: 2011-01-27 15:13:14 summary: fix issue #20 path.samefile(relpath) works affected #: 5 files (310 bytes) --- a/CHANGELOG Wed Jan 26 22:51:00 2011 +0100 +++ b/CHANGELOG Thu Jan 27 15:13:14 2011 +0100 @@ -14,6 +14,10 @@ - fix py.error.* attribute pypy access issue +- allow path.samefile(arg) to succeed when arg is a relative filename + +- fix (pytest-) issue20 path.samefile(relpath) works as expected now + Changes between 1.3.4 and 1.4.0 ================================================== --- a/py/__init__.py Wed Jan 26 22:51:00 2011 +0100 +++ b/py/__init__.py Thu Jan 27 15:13:14 2011 +0100 @@ -8,7 +8,7 @@ (c) Holger Krekel and others, 2004-2010 """ -__version__ = '1.4.1.dev3' +__version__ = '1.4.1.dev4' from py import _apipkg --- a/py/_path/local.py Wed Jan 26 22:51:00 2011 +0100 +++ b/py/_path/local.py Thu Jan 27 15:13:14 2011 +0100 @@ -158,11 +158,12 @@ def samefile(self, other): """ return True if 'other' references the same file as 'self'. """ - if self == other: - return True if not iswin32: - return py.error.checked_call(os.path.samefile, str(self), str(other)) - return False + return py.error.checked_call( + os.path.samefile, str(self), str(other)) + if not os.path.isabs(other): + other = os.path.abspath(other) + return self == other def remove(self, rec=1, ignore_errors=False): """ remove a file or directory (or a directory tree if rec=1). --- a/setup.py Wed Jan 26 22:51:00 2011 +0100 +++ b/setup.py Thu Jan 27 15:13:14 2011 +0100 @@ -9,7 +9,7 @@ name='py', description='library with cross-python path, ini-parsing, io, code, log facilities', long_description = open('README.txt').read(), - version='1.4.1.dev3', + version='1.4.1.dev4', url='http://pylib.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], --- a/testing/path/test_local.py Wed Jan 26 22:51:00 2011 +0100 +++ b/testing/path/test_local.py Thu Jan 27 15:13:14 2011 +0100 @@ -420,6 +420,11 @@ assert tmpdir.samefile(tmpdir) p = tmpdir.ensure("hello") assert p.samefile(p) + old = p.dirpath().chdir() + try: + assert p.samefile(p.basename) + finally: + old.chdir() if sys.platform == "win32": p1 = p.__class__(str(p).lower()) p2 = p.__class__(str(p).upper()) Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Thu Jan 27 16:03:40 2011 From: commits-noreply at bitbucket.org (Bitbucket) Date: Thu, 27 Jan 2011 15:03:40 -0000 Subject: [py-svn] commit/py: hpk42: fix path manip on win32 Message-ID: <20110127150340.7065.79697@bitbucket01.managed.contegix.com> 1 new changeset in py: http://bitbucket.org/hpk42/py/changeset/ac20cd7258b8/ changeset: r2001:ac20cd7258b8 user: hpk42 date: 2011-01-27 16:03:31 summary: fix path manip on win32 affected #: 1 file (14 bytes) --- a/py/_path/local.py Thu Jan 27 15:13:14 2011 +0100 +++ b/py/_path/local.py Thu Jan 27 16:03:31 2011 +0100 @@ -161,8 +161,9 @@ if not iswin32: return py.error.checked_call( os.path.samefile, str(self), str(other)) - if not os.path.isabs(other): - other = os.path.abspath(other) + if self == other: + return True + other = os.path.abspath(str(other)) return self == other def remove(self, rec=1, ignore_errors=False): Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From py-svn at codespeak.net Sat Jan 29 15:37:33 2011 From: py-svn at codespeak.net (© VIAGRA ® Official Site) Date: Sat, 29 Jan 2011 15:37:33 +0100 (CET) Subject: [py-svn] Dear py-svn@codespeak.net 42% 0FF on Pfizer ! Message-ID: <20110129143733.71798282B9D@codespeak.net> An HTML attachment was scrubbed... URL: