From commits-noreply at bitbucket.org Mon Jun 3 10:05:12 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 03 Jun 2013 08:05:12 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: fix issue316 - properly reference collection hooks in docs Message-ID: <20130603080512.30469.62693@bitbucket16.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/194874ef779b/ Changeset: 194874ef779b User: hpk42 Date: 2013-06-03 10:04:50 Summary: fix issue316 - properly reference collection hooks in docs Affected #: 2 files diff -r 5d0b6123d6541ad497cc592d72b9ed50a7c26915 -r 194874ef779b84f15f91a64defdd0c1041fc1baf CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ Changes between 2.3.5 and 2.4.DEV ----------------------------------- +- fix issue316 - properly reference collection hooks in docs + - fix issue 308 - allow to mark/xfail/skip individual parameter sets when parametrizing. Thanks Brianna Laugher. @@ -37,6 +39,7 @@ - fix issue307 - use yaml.safe_load in example, thanks Mark Eichin. + Changes between 2.3.4 and 2.3.5 ----------------------------------- diff -r 5d0b6123d6541ad497cc592d72b9ed50a7c26915 -r 194874ef779b84f15f91a64defdd0c1041fc1baf doc/en/plugins.txt --- a/doc/en/plugins.txt +++ b/doc/en/plugins.txt @@ -345,15 +345,15 @@ Session related reporting hooks: -.. autofunction: pytest_collectstart -.. autofunction: pytest_itemcollected -.. autofunction: pytest_collectreport -.. autofunction: pytest_deselected +.. autofunction:: pytest_collectstart +.. autofunction:: pytest_itemcollected +.. autofunction:: pytest_collectreport +.. autofunction:: pytest_deselected And here is the central hook for reporting about test execution: -.. autofunction: pytest_runtest_logreport +.. autofunction:: pytest_runtest_logreport Reference of objects involved in hooks =========================================================== 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 Mon Jun 3 15:02:00 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 03 Jun 2013 13:02:00 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20130603130200.29755.55232@bitbucket01.managed.contegix.com> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/cc09084ced3f/ Changeset: cc09084ced3f User: hpk42 Date: 2013-06-03 14:50:53 Summary: fix issue94 - add homepage/repo information, also uploaded to pypi.python.org Affected #: 2 files diff -r f5177c612fbadb8552c58693fa7249388c1c1bd3 -r cc09084ced3f28428fffff98fc528833e21ce104 README.txt --- a/README.txt +++ b/README.txt @@ -2,7 +2,7 @@ What is Tox? -------------------- -Tox as is a generic virtualenv_ management and test command line tool you can use for: +Tox as is a generic virtualenv management and test command line tool you can use for: * checking your package installs correctly with different Python versions and interpreters @@ -12,11 +12,13 @@ * acting as a frontend to Continuous Integration servers, greatly reducing boilerplate and merging CI and shell-based testing. -For more information, docs and many examples please checkout: +For more information and the repository please checkout: - http://tox.testrun.org +- homepage: http://tox.testrun.org + +- repository: https://bitbucket.org/hpk42/tox have fun, -holger krekel, May 2012 +holger krekel, March 2013 diff -r f5177c612fbadb8552c58693fa7249388c1c1bd3 -r cc09084ced3f28428fffff98fc528833e21ce104 setup.py --- a/setup.py +++ b/setup.py @@ -2,30 +2,7 @@ from setuptools import setup from setuptools.command.test import test as TestCommand -long_description = """ -What is Tox? -========================== - -Tox as is a generic virtualenv management and test command line tool you can -use for: - -* checking your package installs correctly with different - Python versions and interpreters - -* running your tests in each of the - environments, configuring your test tool of choice - -* acting as a frontend to Continuous Integration - servers, greatly reducing boilerplate and merging - CI and shell-based testing. - -For more information, docs and many examples please checkout the `home page`_: - - http://tox.testrun.org/ - -.. _`home page`: http://tox.testrun.org/ -""" - +long_description = open("README.txt").read() class Tox(TestCommand): def finalize_options(self): @@ -54,6 +31,7 @@ platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel', author_email='holger at merlinux.eu', + homepage_url="http://tox.testun.org", packages=['tox', ], entry_points={'console_scripts': 'tox=tox:cmdline\ntox-quickstart=tox._quickstart:main'}, # we use a public tox version to test, see tox.ini's testenv https://bitbucket.org/hpk42/tox/commits/e841b84a9690/ Changeset: e841b84a9690 User: hpk42 Date: 2013-06-03 15:01:38 Summary: merge in README changes Affected #: 2 files diff -r fc53c4e02616e58ea5ab482409b25746220b1738 -r e841b84a96906fd7f78d119f2490fbdcdecf97bf README.rst --- a/README.rst +++ b/README.rst @@ -12,9 +12,14 @@ * acting as a frontend to Continuous Integration servers, greatly reducing boilerplate and merging CI and shell-based testing. -For more information, docs and many examples please checkout: +For more information and the repository please checkout: - http://tox.testrun.org +- homepage: http://tox.testrun.org + +- repository: https://bitbucket.org/hpk42/tox + +have fun, + have fun, Repository URL: https://bitbucket.org/hpk42/tox/ -- 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 Mon Jun 3 16:13:37 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 03 Jun 2013 14:13:37 -0000 Subject: [Pytest-commit] commit/pytest: 2 new changesets Message-ID: <20130603141337.17848.6017@bitbucket05.managed.contegix.com> 2 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/984cd54cbc27/ Changeset: 984cd54cbc27 User: Alfredo Deza Date: 2013-06-03 16:07:14 Summary: adding ref targets on recwarn Affected #: 1 file diff -r 194874ef779b84f15f91a64defdd0c1041fc1baf -r 984cd54cbc27a0b7deef57a63fe23414a469cc01 doc/en/recwarn.txt --- a/doc/en/recwarn.txt +++ b/doc/en/recwarn.txt @@ -2,6 +2,8 @@ Asserting deprecation and other warnings ===================================================== +.. _function_argument: + The recwarn function argument ------------------------------------ @@ -24,6 +26,9 @@ * ``pop(category=None)``: return last warning matching the category. * ``clear()``: clear list of warnings + +.. _ensuring_function_triggers: + Ensuring a function triggers a deprecation warning ------------------------------------------------------- https://bitbucket.org/hpk42/pytest/commits/8826e5d7f9c5/ Changeset: 8826e5d7f9c5 User: hpk42 Date: 2013-06-03 16:13:04 Summary: Merge pull request #1 from alfredodeza/297 add ref targets on recwarn Affected #: 1 file diff -r 194874ef779b84f15f91a64defdd0c1041fc1baf -r 8826e5d7f9c59063fcfc97f9e22ba09210aa3957 doc/en/recwarn.txt --- a/doc/en/recwarn.txt +++ b/doc/en/recwarn.txt @@ -2,6 +2,8 @@ Asserting deprecation and other warnings ===================================================== +.. _function_argument: + The recwarn function argument ------------------------------------ @@ -24,6 +26,9 @@ * ``pop(category=None)``: return last warning matching the category. * ``clear()``: clear list of warnings + +.. _ensuring_function_triggers: + Ensuring a function triggers a deprecation warning ------------------------------------------------------- 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 issues-reply at bitbucket.org Thu Jun 6 00:23:02 2013 From: issues-reply at bitbucket.org (Lukasz Balcerzak) Date: Wed, 05 Jun 2013 22:23:02 -0000 Subject: [Pytest-commit] Issue #101: Use tox to create local development environment (hpk42/tox) Message-ID: <20130605222302.13235.7022@bitbucket03.managed.contegix.com> New issue 101: Use tox to create local development environment https://bitbucket.org/hpk42/tox/issue/101/use-tox-to-create-local-development Lukasz Balcerzak: We use some custom scripts to prepare local development environment, including: - creating virtualenv - fetching all the packages from requirements.txt using pip (but only if it was changed) That's actually something that tox does perfectly. I was thinking about extending tox with another *subcommand*, i.e. ``tox --update-devenv``. At config file there should be ``devenv`` section with options helping to describe how development environment should look like. It would be very similar to current testenv most probably (i.e. set default python, set commands to run in order to setup environment etc. plus path where environment should be put - as we might not want it inside .tox). There should also be a way to override those local devenv settings - in order to allow developer to use whichever python user want to use. Am not sure if you would be interested to put this into the core so I'm not sure of all the details right now. Just wanted to know if you'd want something like this in tox itself. If not, let me know too. I would work on it anyway - as an external tool that uses tox's Python api. BTW: Is tox internals considered as official API (backward compatibility etc.)? Or is it more like with mercurial (where only a tool [script] is considered as official API, not internals)? From issues-reply at bitbucket.org Fri Jun 7 11:38:03 2013 From: issues-reply at bitbucket.org (generalov) Date: Fri, 07 Jun 2013 09:38:03 -0000 Subject: [Pytest-commit] Issue #102: Should handle pip requirements with relative paths (hpk42/tox) Message-ID: <20130607093803.30307.97229@bitbucket21.managed.contegix.com> New issue 102: Should handle pip requirements with relative paths https://bitbucket.org/hpk42/tox/issue/102/should-handle-pip-requirements-with generalov: tox executes 'pip install' with changing cwd to envlogdir (.tox/py27/log) If tox.ini takes deps from requirements.txt file and it contains relative paths installation will failed. requirements.txt -e lib/python-package tox.ini [testenv] deps = -r{toxinidir}/requirements.txt /tmp/prj/$ tox -e py27 -v .... /tmp/prj/.tox/py27/log$ /tmp/prj/.tox/py27/bin/pip install --download-cache=/tmp/.pip/cache -r/tmp/prj/requirements.txt >/tmp/prj/.tox/py27/log/py27-1.log ERROR: invocation failed, logfile: /tmp/prj/.tox/py27/log/py27-1.log ERROR: actionid=py27 .. lib/python-package should either by a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+ When I run same command from console installation success: /tmp/prj/$ /tmp/prj/.tox/py27/bin/pip install --download-cache=/tmp/.pip/cache django==1.4 -r/tmp/prj/requirements.txt I suggest tox should not change cwd when runs `pip install` From issues-reply at bitbucket.org Sun Jun 9 12:36:52 2013 From: issues-reply at bitbucket.org (Alexei Boronine) Date: Sun, 09 Jun 2013 10:36:52 -0000 Subject: [Pytest-commit] Issue #103: downloadcache option should allow symlinks (hpk42/tox) Message-ID: <20130609103652.30099.62742@bitbucket03.managed.contegix.com> New issue 103: downloadcache option should allow symlinks https://bitbucket.org/hpk42/tox/issue/103/downloadcache-option-should-allow-symlinks Alexei Boronine: In my Makefile I'm checking out multiple repos multiple times, I would like to be able to symlink their `.pip-cache` branch to a single central cache directory. From commits-noreply at bitbucket.org Sun Jun 9 15:07:49 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 09 Jun 2013 13:07:49 -0000 Subject: [Pytest-commit] commit/pytest: 3 new changesets Message-ID: <20130609130749.17635.92771@bitbucket16.managed.contegix.com> 3 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/2aa2693b68ca/ Changeset: 2aa2693b68ca User: embray Date: 2013-05-29 00:11:12 Summary: Adds a test for and fixes #112. If attempting to write to the __pycache__ directory raises a permission error _write_pyc() should just return False to prevent any further write attempts. Affected #: 2 files diff -r 5d0b6123d6541ad497cc592d72b9ed50a7c26915 -r 2aa2693b68ca556926e21bb478d4941d3f6ab23f _pytest/assertion/rewrite.py --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -177,6 +177,10 @@ # This happens when we get a EEXIST in find_module creating the # __pycache__ directory and __pycache__ is by some non-dir node. return False + elif err == errno.EACCES: + # The directory is read-only; this can happen for example when + # running the tests in a package installed as root + return False raise try: fp.write(imp.get_magic()) diff -r 5d0b6123d6541ad497cc592d72b9ed50a7c26915 -r 2aa2693b68ca556926e21bb478d4941d3f6ab23f testing/test_assertrewrite.py --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1,4 +1,5 @@ import os +import stat import sys import zipfile import py @@ -323,6 +324,18 @@ assert "@py_builtins" in globals()""") assert testdir.runpytest().ret == 0 + def test_pycache_is_readonly(self, testdir): + cache = testdir.tmpdir.mkdir("__pycache__") + old_mode = cache.stat().mode + cache.chmod(old_mode ^ stat.S_IWRITE) + testdir.makepyfile(""" +def test_rewritten(): + assert "@py_builtins" in globals()""") + try: + assert testdir.runpytest().ret == 0 + finally: + cache.chmod(old_mode) + def test_zipfile(self, testdir): z = testdir.tmpdir.join("myzip.zip") z_fn = str(z) @@ -346,8 +359,12 @@ def test_rewritten(): assert "@py_builtins" in globals() """).encode("utf-8"), "wb") + old_mode = sub.stat().mode sub.chmod(320) - assert testdir.runpytest().ret == 0 + try: + assert testdir.runpytest().ret == 0 + finally: + sub.chmod(old_mode) def test_dont_write_bytecode(self, testdir, monkeypatch): testdir.makepyfile(""" https://bitbucket.org/hpk42/pytest/commits/f99690dd59d9/ Changeset: f99690dd59d9 User: embray Date: 2013-06-07 23:30:10 Summary: reindent a few of the blockquotes in these tests Affected #: 1 file diff -r 2aa2693b68ca556926e21bb478d4941d3f6ab23f -r f99690dd59d9cf9b0e63c902a5be9d0ce9f54bfb testing/test_assertrewrite.py --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -320,8 +320,8 @@ def test_pycache_is_a_file(self, testdir): testdir.tmpdir.join("__pycache__").write("Hello") testdir.makepyfile(""" -def test_rewritten(): - assert "@py_builtins" in globals()""") + def test_rewritten(): + assert "@py_builtins" in globals()""") assert testdir.runpytest().ret == 0 def test_pycache_is_readonly(self, testdir): @@ -329,8 +329,8 @@ old_mode = cache.stat().mode cache.chmod(old_mode ^ stat.S_IWRITE) testdir.makepyfile(""" -def test_rewritten(): - assert "@py_builtins" in globals()""") + def test_rewritten(): + assert "@py_builtins" in globals()""") try: assert testdir.runpytest().ret == 0 finally: @@ -347,9 +347,9 @@ f.close() z.chmod(256) testdir.makepyfile(""" -import sys -sys.path.append(%r) -import test_gum.test_lizard""" % (z_fn,)) + import sys + sys.path.append(%r) + import test_gum.test_lizard""" % (z_fn,)) assert testdir.runpytest().ret == 0 def test_readonly(self, testdir): @@ -358,7 +358,7 @@ py.builtin._totext(""" def test_rewritten(): assert "@py_builtins" in globals() -""").encode("utf-8"), "wb") + """).encode("utf-8"), "wb") old_mode = sub.stat().mode sub.chmod(320) try: @@ -368,11 +368,11 @@ def test_dont_write_bytecode(self, testdir, monkeypatch): testdir.makepyfile(""" -import os -def test_no_bytecode(): - assert "__pycache__" in __cached__ - assert not os.path.exists(__cached__) - assert not os.path.exists(os.path.dirname(__cached__))""") + import os + def test_no_bytecode(): + assert "__pycache__" in __cached__ + assert not os.path.exists(__cached__) + assert not os.path.exists(os.path.dirname(__cached__))""") monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", "1") assert testdir.runpytest().ret == 0 https://bitbucket.org/hpk42/pytest/commits/b7cb68e2408e/ Changeset: b7cb68e2408e User: hpk42 Date: 2013-06-09 15:07:44 Summary: Merged in embray/pytest (pull request #37) Adds a test for and fixes #112 Affected #: 2 files diff -r 8826e5d7f9c59063fcfc97f9e22ba09210aa3957 -r b7cb68e2408e680812186531f7aed23d04b36711 _pytest/assertion/rewrite.py --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -177,6 +177,10 @@ # This happens when we get a EEXIST in find_module creating the # __pycache__ directory and __pycache__ is by some non-dir node. return False + elif err == errno.EACCES: + # The directory is read-only; this can happen for example when + # running the tests in a package installed as root + return False raise try: fp.write(imp.get_magic()) diff -r 8826e5d7f9c59063fcfc97f9e22ba09210aa3957 -r b7cb68e2408e680812186531f7aed23d04b36711 testing/test_assertrewrite.py --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1,4 +1,5 @@ import os +import stat import sys import zipfile import py @@ -319,10 +320,22 @@ def test_pycache_is_a_file(self, testdir): testdir.tmpdir.join("__pycache__").write("Hello") testdir.makepyfile(""" -def test_rewritten(): - assert "@py_builtins" in globals()""") + def test_rewritten(): + assert "@py_builtins" in globals()""") assert testdir.runpytest().ret == 0 + def test_pycache_is_readonly(self, testdir): + cache = testdir.tmpdir.mkdir("__pycache__") + old_mode = cache.stat().mode + cache.chmod(old_mode ^ stat.S_IWRITE) + testdir.makepyfile(""" + def test_rewritten(): + assert "@py_builtins" in globals()""") + try: + assert testdir.runpytest().ret == 0 + finally: + cache.chmod(old_mode) + def test_zipfile(self, testdir): z = testdir.tmpdir.join("myzip.zip") z_fn = str(z) @@ -334,9 +347,9 @@ f.close() z.chmod(256) testdir.makepyfile(""" -import sys -sys.path.append(%r) -import test_gum.test_lizard""" % (z_fn,)) + import sys + sys.path.append(%r) + import test_gum.test_lizard""" % (z_fn,)) assert testdir.runpytest().ret == 0 def test_readonly(self, testdir): @@ -345,17 +358,21 @@ py.builtin._totext(""" def test_rewritten(): assert "@py_builtins" in globals() -""").encode("utf-8"), "wb") + """).encode("utf-8"), "wb") + old_mode = sub.stat().mode sub.chmod(320) - assert testdir.runpytest().ret == 0 + try: + assert testdir.runpytest().ret == 0 + finally: + sub.chmod(old_mode) def test_dont_write_bytecode(self, testdir, monkeypatch): testdir.makepyfile(""" -import os -def test_no_bytecode(): - assert "__pycache__" in __cached__ - assert not os.path.exists(__cached__) - assert not os.path.exists(os.path.dirname(__cached__))""") + import os + def test_no_bytecode(): + assert "__pycache__" in __cached__ + assert not os.path.exists(__cached__) + assert not os.path.exists(os.path.dirname(__cached__))""") monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", "1") assert testdir.runpytest().ret == 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 Mon Jun 10 10:09:35 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 10 Jun 2013 08:09:35 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: make sessionfinish hooks execute with the same cwd-context as at Message-ID: <20130610080935.5091.35496@bitbucket04.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/248aefd13c11/ Changeset: 248aefd13c11 User: hpk42 Date: 2013-06-10 10:09:28 Summary: make sessionfinish hooks execute with the same cwd-context as at session start (helps fix plugin behaviour which write output files with relative path such as pytest-cov) Affected #: 3 files diff -r b7cb68e2408e680812186531f7aed23d04b36711 -r 248aefd13c111fe69c0cbe9a96c38ccf6a9c7288 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,10 @@ Changes between 2.3.5 and 2.4.DEV ----------------------------------- +- make sessionfinish hooks execute with the same cwd-context as at + session start (helps fix plugin behaviour which write output files + with relative path such as pytest-cov) + - fix issue316 - properly reference collection hooks in docs - fix issue 308 - allow to mark/xfail/skip individual parameter sets diff -r b7cb68e2408e680812186531f7aed23d04b36711 -r 248aefd13c111fe69c0cbe9a96c38ccf6a9c7288 _pytest/main.py --- a/_pytest/main.py +++ b/_pytest/main.py @@ -97,6 +97,7 @@ if session._testsfailed: session.exitstatus = EXIT_TESTSFAILED finally: + session.startdir.chdir() if initstate >= 2: config.hook.pytest_sessionfinish( session=session, @@ -452,6 +453,7 @@ self.shouldstop = False self.trace = config.trace.root.get("collection") self._norecursepatterns = config.getini("norecursedirs") + self.startdir = py.path.local() def pytest_collectstart(self): if self.shouldstop: diff -r b7cb68e2408e680812186531f7aed23d04b36711 -r 248aefd13c111fe69c0cbe9a96c38ccf6a9c7288 testing/test_session.py --- a/testing/test_session.py +++ b/testing/test_session.py @@ -226,3 +226,17 @@ assert result.ret == 0 result.stdout.fnmatch_lines(["*1 passed*"]) +def test_sessionfinish_with_start(testdir): + testdir.makeconftest(""" + import os + l = [] + def pytest_sessionstart(): + l.append(os.getcwd()) + os.chdir("..") + + def pytest_sessionfinish(): + assert l[0] == os.getcwd() + + """) + res = testdir.runpytest("--collectonly") + assert res.ret == 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 Thu Jun 20 14:05:25 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 20 Jun 2013 12:05:25 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: added some endorsements, not quite properly layouted Message-ID: <20130620120525.16356.68184@bitbucket16.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/b4b8fcf30a4b/ Changeset: b4b8fcf30a4b User: hpk42 Date: 2013-06-20 14:05:16 Summary: added some endorsements, not quite properly layouted Affected #: 6 files diff -r 248aefd13c111fe69c0cbe9a96c38ccf6a9c7288 -r b4b8fcf30a4b8ee5974c1ba75642f8b6ac5d9c3d doc/en/img/cramer2.png Binary file doc/en/img/cramer2.png has changed diff -r 248aefd13c111fe69c0cbe9a96c38ccf6a9c7288 -r b4b8fcf30a4b8ee5974c1ba75642f8b6ac5d9c3d doc/en/img/gaynor3.png Binary file doc/en/img/gaynor3.png has changed diff -r 248aefd13c111fe69c0cbe9a96c38ccf6a9c7288 -r b4b8fcf30a4b8ee5974c1ba75642f8b6ac5d9c3d doc/en/img/keleshev.png Binary file doc/en/img/keleshev.png has changed diff -r 248aefd13c111fe69c0cbe9a96c38ccf6a9c7288 -r b4b8fcf30a4b8ee5974c1ba75642f8b6ac5d9c3d doc/en/img/theuni.png Binary file doc/en/img/theuni.png has changed diff -r 248aefd13c111fe69c0cbe9a96c38ccf6a9c7288 -r b4b8fcf30a4b8ee5974c1ba75642f8b6ac5d9c3d doc/en/index.txt --- a/doc/en/index.txt +++ b/doc/en/index.txt @@ -56,6 +56,7 @@ - customizations can be per-directory, per-project or per PyPI released plugin - it is easy to add command line options or customize existing behaviour + .. _`Javascript unit- and functional testing`: http://pypi.python.org/pypi/oejskit .. _`easy`: http://bruynooghe.blogspot.com/2009/12/skipping-slow-test-by-default-in-pytest.html diff -r 248aefd13c111fe69c0cbe9a96c38ccf6a9c7288 -r b4b8fcf30a4b8ee5974c1ba75642f8b6ac5d9c3d doc/en/projects.txt --- a/doc/en/projects.txt +++ b/doc/en/projects.txt @@ -1,5 +1,22 @@ .. _projects: +.. image:: img/gaynor3.png + :width: 400px + :align: right + +.. image:: img/theuni.png + :width: 400px + :align: right + +.. image:: img/cramer2.png + :width: 400px + :align: right + +.. image:: img/keleshev.png + :width: 400px + :align: right + + Project examples ========================== 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 issues-reply at bitbucket.org Fri Jun 21 09:41:47 2013 From: issues-reply at bitbucket.org (Omer Katz) Date: Fri, 21 Jun 2013 07:41:47 -0000 Subject: [Pytest-commit] Issue #104: Distribute is now deprecated. Use setuptools>=0.7 (hpk42/tox) Message-ID: <20130621074147.4993.62266@bitbucket24.managed.contegix.com> New issue 104: Distribute is now deprecated. Use setuptools>=0.7 https://bitbucket.org/hpk42/tox/issue/104/distribute-is-now-deprecated-use Omer Katz: Distribute should now be replaced with setuptools>=0.7. From commits-noreply at bitbucket.org Fri Jun 21 19:38:09 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Fri, 21 Jun 2013 17:38:09 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20130621173809.31512.68224@bitbucket05.managed.contegix.com> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/2c19548a8f26/ Changeset: 2c19548a8f26 User: hpk42 Date: 2013-06-21 19:33:46 Summary: fix py25 test bug Affected #: 1 file diff -r e841b84a96906fd7f78d119f2490fbdcdecf97bf -r 2c19548a8f26d92d5edd2343835f99e6962736d3 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -835,8 +835,10 @@ """ config = newconfig([], inisource) homedir = str(py.path.local._gethomedir()) - assert config.indexserver['default'].url == "file://{h}/.pip/downloads/simple".format(h=homedir) - assert config.indexserver['local1'].url == config.indexserver['default'].url + expected = "file://%s/.pip/downloads/simple" % homedir + assert config.indexserver['default'].url == expected + assert config.indexserver['local1'].url == \ + config.indexserver['default'].url class TestParseEnv: https://bitbucket.org/hpk42/tox/commits/b2a02a07836c/ Changeset: b2a02a07836c User: hpk42 Date: 2013-06-21 19:37:56 Summary: fix issue104 - use setuptools instead of distribute by default now Affected #: 8 files diff -r 2c19548a8f26d92d5edd2343835f99e6962736d3 -r b2a02a07836c5128b8448e85779e4e8c9c660886 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,9 @@ 1.5.0.dev ----------------- +- fix issue104: use setuptools by default, instead of distribute, + now that setuptools has distribute merged. + - make sure test commands are searched first in the virtualenv - rename README.txt to README.rst to make bitbucket happier diff -r 2c19548a8f26d92d5edd2343835f99e6962736d3 -r b2a02a07836c5128b8448e85779e4e8c9c660886 doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -125,9 +125,12 @@ .. confval:: distribute=True|False - Set to ``False`` if you want to use setuptools_ instead of the default - distribute_ in the virtual environment. - **default:** True. + Set to ``True`` if you want to use distribute_ instead of the default + setuptools_ in the virtual environment. Prior to tox-1.5 the + default was True and now is False, meaning ``setuptools`` is used + (note that setuptools-0.7 merged with distribute). In future versions + of tox this option might be ignored and setuptools always chosen. + **default:** False. .. confval:: sitepackages=True|False diff -r 2c19548a8f26d92d5edd2343835f99e6962736d3 -r b2a02a07836c5128b8448e85779e4e8c9c660886 setup.py --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ description='virtualenv-based automation of test activities', long_description=open("README.rst").read(), url='http://tox.testrun.org/', - version='1.5.dev11', + version='1.5.dev12', license='http://opensource.org/licenses/MIT', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel', diff -r 2c19548a8f26d92d5edd2343835f99e6962736d3 -r b2a02a07836c5128b8448e85779e4e8c9c660886 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -352,7 +352,7 @@ envconfig = config.envconfigs['python'] assert envconfig.commands == [["xyz", "--abc"]] assert envconfig.changedir == config.setupdir - assert envconfig.distribute == True + assert envconfig.distribute == False assert envconfig.sitepackages == False assert envconfig.envlogdir == envconfig.envdir.join("log") assert envconfig.setenv is None diff -r 2c19548a8f26d92d5edd2343835f99e6962736d3 -r b2a02a07836c5128b8448e85779e4e8c9c660886 tests/test_venv.py --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -467,7 +467,7 @@ venv = VirtualEnv(envconfig, session=mocksession) venv.update() cconfig = venv._getliveconfig() - cconfig.distribute = False + cconfig.distribute = True cconfig.writeconfig(venv.path_config) mocksession._clearmocks() venv.update() diff -r 2c19548a8f26d92d5edd2343835f99e6962736d3 -r b2a02a07836c5128b8448e85779e4e8c9c660886 tox/__init__.py --- a/tox/__init__.py +++ b/tox/__init__.py @@ -1,5 +1,5 @@ # -__version__ = '1.5.dev11' +__version__ = '1.5.dev12' class exception: class Error(Exception): diff -r 2c19548a8f26d92d5edd2343835f99e6962736d3 -r b2a02a07836c5128b8448e85779e4e8c9c660886 tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -303,7 +303,7 @@ name = depline.strip() ixserver = None vc.deps.append(DepConfig(name, ixserver)) - vc.distribute = reader.getbool(section, "distribute", True) + vc.distribute = reader.getbool(section, "distribute", False) vc.sitepackages = reader.getbool(section, "sitepackages", False) vc.downloadcache = None downloadcache = os.environ.get("PIP_DOWNLOAD_CACHE", None) diff -r 2c19548a8f26d92d5edd2343835f99e6962736d3 -r b2a02a07836c5128b8448e85779e4e8c9c660886 toxbootstrap.py --- a/toxbootstrap.py +++ b/toxbootstrap.py @@ -58,7 +58,7 @@ """ -__version__ = '1.5.dev11' +__version__ = '1.5.dev12' import sys import os Repository URL: https://bitbucket.org/hpk42/tox/ -- 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 Sat Jun 22 08:49:18 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sat, 22 Jun 2013 06:49:18 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20130622064918.9952.56621@bitbucket05.managed.contegix.com> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/1eaa99354a61/ Changeset: 1eaa99354a61 User: hpk42 Date: 2013-06-21 19:41:31 Summary: simplify toxbootstrap Affected #: 1 file diff -r b2a02a07836c5128b8448e85779e4e8c9c660886 -r 1eaa99354a6125c7b4c0e0047df926d7c9d24959 toxbootstrap.py --- a/toxbootstrap.py +++ b/toxbootstrap.py @@ -192,7 +192,7 @@ # XXX: we use --no-site-packages because: if tox is installed in global # site-packages, then pip will not install it locally. ideal fix for # this should be to first look for tox in the global scripts/ directory - run('%s virtualenv.py --no-site-packages --distribute %s' % + run('%s virtualenv.py --no-site-packages --setuptools %s' % (sys.executable, TENV)) logging.info("removing virtualenv.py script after bootstrap venv creation") for x in ('', 'o', 'c'): @@ -209,11 +209,6 @@ # install/upgrade tox itself if USETOXDEV: - if 'PIP_DOWNLOAD_CACHE' in os.environ: - cache = "" - else: - cache = "--download-cache=_download" - ensuredir('_download') run('%s install -q -i http://pypi.testrun.org ' '--upgrade %s tox' % (pip, cache)) elif any([ https://bitbucket.org/hpk42/tox/commits/e286636af34a/ Changeset: e286636af34a User: hpk42 Date: 2013-06-22 08:49:09 Summary: fixing changelog and adding a whitelist_externals example Affected #: 3 files diff -r 1eaa99354a6125c7b4c0e0047df926d7c9d24959 -r e286636af34ab70a5dac5ed815b1dc1a842f53b9 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -6,9 +6,7 @@ - make sure test commands are searched first in the virtualenv -- rename README.txt to README.rst to make bitbucket happier - -- re-fix issue2 - add command_whitelist to be used in ``[testenv*]`` +- re-fix issue2 - add whitelist_externals to be used in ``[testenv*]`` sections, allowing to avoid warnings for commands such as ``make``, used from the commands value. @@ -24,8 +22,8 @@ - depend on virtualenv-1.9.1 -- use either --distribute or --setuptools depending - on "distribute" env config +- rename README.txt to README.rst to make bitbucket happier + 1.4.3 ----------------- diff -r 1eaa99354a6125c7b4c0e0047df926d7c9d24959 -r e286636af34ab70a5dac5ed815b1dc1a842f53b9 doc/example/basic.txt --- a/doc/example/basic.txt +++ b/doc/example/basic.txt @@ -44,6 +44,22 @@ However, you can also create your own test environment names, see some of the examples in :doc:`examples <../examples>`. +whitelisting a non-virtualenv commands +----------------------------------------------- + +.. versionadded:: 1.5 + +Sometimes you may want to use tools not contained in your +virtualenv such as ``make``, ``bash`` or others. To avoid +warnings you can use the ``whitelist_externals`` testenv +configuration:: + + # content of tox.ini + [testenv] + whitelist_externals = make + /bin/bash + + .. _virtualenv: http://pypi.python.org/pypi/virtualenv .. _multiindex: diff -r 1eaa99354a6125c7b4c0e0047df926d7c9d24959 -r e286636af34ab70a5dac5ed815b1dc1a842f53b9 doc/install.txt --- a/doc/install.txt +++ b/doc/install.txt @@ -4,13 +4,13 @@ Install info in a nutshell ---------------------------------- -**Pythons**: CPython 2.4-3.2, Jython-2.5.1, pypy-1.5 +**Pythons**: CPython 2.4-3.3, Jython-2.5.1, pypy-1.9ff **Operating systems**: Linux, Windows, OSX, Unix **Installer Requirements**: setuptools_ or Distribute_ -**License**: GPLv2 or later +**License**: MIT license **hg repository**: http://bitbucket.org/hpk42/tox Repository URL: https://bitbucket.org/hpk42/tox/ -- 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 Sat Jun 22 15:06:10 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sat, 22 Jun 2013 13:06:10 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20130622130610.20843.37124@bitbucket23.managed.contegix.com> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/8fcc1bed3e91/ Changeset: 8fcc1bed3e91 User: hpk42 Date: 2013-06-22 09:17:14 Summary: fix whitelist_externals on windows, bump version for release prep Affected #: 7 files diff -r e286636af34ab70a5dac5ed815b1dc1a842f53b9 -r 8fcc1bed3e918b625d85864cc3f4623578852e7e doc/conf.py --- a/doc/conf.py +++ b/doc/conf.py @@ -48,7 +48,7 @@ # built documents. # # The short X.Y version. -release = version = "1.4.3" +release = version = "1.5.0" # The full version, including alpha/beta/rc tags. # The language for content autogenerated by Sphinx. Refer to documentation diff -r e286636af34ab70a5dac5ed815b1dc1a842f53b9 -r 8fcc1bed3e918b625d85864cc3f4623578852e7e setup.py --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ def main(): version = sys.version_info[:2] - install_requires = ['virtualenv>=1.9.1', 'py>=1.4.13', ] + install_requires = ['virtualenv>=1.9.1', 'py>=1.4.15', ] if version < (2, 7) or (3, 0) <= version <= (3, 1): install_requires += ['argparse'] setup( @@ -26,7 +26,7 @@ description='virtualenv-based automation of test activities', long_description=open("README.rst").read(), url='http://tox.testrun.org/', - version='1.5.dev12', + version='1.5.0', license='http://opensource.org/licenses/MIT', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel', diff -r e286636af34ab70a5dac5ed815b1dc1a842f53b9 -r 8fcc1bed3e918b625d85864cc3f4623578852e7e tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -894,8 +894,6 @@ *docs* """) - @py.test.mark.xfail("sys.version_info < (2,6)", - reason="virtualenv3 cannot be imported") def test_config_specific_ini(self, tmpdir, cmd): ini = tmpdir.ensure("hello.ini") result = cmd.run("tox", "-c", ini, "--showconfig") diff -r e286636af34ab70a5dac5ed815b1dc1a842f53b9 -r 8fcc1bed3e918b625d85864cc3f4623578852e7e tox.ini --- a/tox.ini +++ b/tox.ini @@ -1,20 +1,18 @@ [tox] envlist=py27,py26,py25,py32,py33,docs,pypy -indexserver = - testrun = http://pypi.testrun.org - pypi = https://pypi.python.org/simple [testenv:X] commands=echo {posargs} [testenv] -commands=py.test --junitxml={envlogdir}/junit-{envname}.xml {posargs} +commands=py.test --instafail --junitxml={envlogdir}/junit-{envname}.xml {posargs} deps=pytest==2.3.4 + pytest-instafail [testenv:docs] basepython=python changedir=doc -deps=:pypi:sphinx +deps=sphinx {[testenv]deps} commands= py.test -v \ diff -r e286636af34ab70a5dac5ed815b1dc1a842f53b9 -r 8fcc1bed3e918b625d85864cc3f4623578852e7e tox/__init__.py --- a/tox/__init__.py +++ b/tox/__init__.py @@ -1,5 +1,5 @@ # -__version__ = '1.5.dev12' +__version__ = '1.5.0' class exception: class Error(Exception): diff -r e286636af34ab70a5dac5ed815b1dc1a842f53b9 -r 8fcc1bed3e918b625d85864cc3f4623578852e7e tox/_venv.py --- a/tox/_venv.py +++ b/tox/_venv.py @@ -83,11 +83,9 @@ if p is None: raise tox.exception.InvocationError( "could not find executable %r" % (name,)) + # p is not found in virtualenv script/bin dir if venv: - for x in self.envconfig.whitelist_externals: - if p.fnmatch(x): - break - else: + if not self.is_allowed_external(p): self.session.report.warning( "test command found but not installed in testenv\n" " cmd: %s\n" @@ -96,6 +94,18 @@ self.envconfig.envdir)) return str(p) # will not be rewritten for reporting + def is_allowed_external(self, p): + tryadd = [""] + if sys.platform == "win32": + tryadd += [os.path.normcase(x) + for x in os.environ['PATHEXT'].split(os.pathsep)] + p = py.path.local(os.path.normcase(str(p))) + for x in self.envconfig.whitelist_externals: + for add in tryadd: + if p.fnmatch(x + add): + return True + return False + def _ispython3(self): return "python3" in str(self.envconfig.basepython) diff -r e286636af34ab70a5dac5ed815b1dc1a842f53b9 -r 8fcc1bed3e918b625d85864cc3f4623578852e7e toxbootstrap.py --- a/toxbootstrap.py +++ b/toxbootstrap.py @@ -58,7 +58,7 @@ """ -__version__ = '1.5.dev12' +__version__ = '1.5.0' import sys import os https://bitbucket.org/hpk42/tox/commits/d1c4826481be/ Changeset: d1c4826481be User: hpk42 Date: 2013-06-22 15:06:02 Summary: Added tag 1.5.0 for changeset 8fcc1bed3e91 Affected #: 1 file diff -r 8fcc1bed3e918b625d85864cc3f4623578852e7e -r d1c4826481bedb84636d1b805519ace5bffce9bf .hgtags --- a/.hgtags +++ b/.hgtags @@ -12,3 +12,4 @@ 3a68408fa3a210c2a2e52189e16f5ae6dfed287d 1.4.1 668f66e4781b0beae509db8125dc02218f6efe4e 1.4.2 f5177c612fbadb8552c58693fa7249388c1c1bd3 1.4.3 +8fcc1bed3e918b625d85864cc3f4623578852e7e 1.5.0 Repository URL: https://bitbucket.org/hpk42/tox/ -- 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 Sun Jun 23 09:23:20 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 23 Jun 2013 07:23:20 -0000 Subject: [Pytest-commit] commit/pytest: 3 new changesets Message-ID: <20130623072320.4101.75753@bitbucket25.managed.contegix.com> 3 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/a6b43681c095/ Changeset: a6b43681c095 User: variedthoughts Date: 2013-06-20 16:43:42 Summary: support unittest setUpModule/tearDownModule Affected #: 1 file diff -r b4b8fcf30a4b8ee5974c1ba75642f8b6ac5d9c3d -r a6b43681c095cf385b81926cadc5eb629ef4f8bc _pytest/python.py --- a/_pytest/python.py +++ b/_pytest/python.py @@ -371,7 +371,9 @@ return mod def setup(self): - setup_module = xunitsetup(self.obj, "setup_module") + setup_module = xunitsetup(self.obj, "setUpModule") + if setup_module is None: + setup_module = xunitsetup(self.obj, "setup_module") if setup_module is not None: #XXX: nose compat hack, move to nose plugin # if it takes a positional arg, its probably a pytest style one @@ -382,7 +384,9 @@ setup_module() def teardown(self): - teardown_module = xunitsetup(self.obj, 'teardown_module') + teardown_module = xunitsetup(self.obj, 'tearDownModule') + if teardown_module is None: + teardown_module = xunitsetup(self.obj, 'teardown_module') if teardown_module is not None: #XXX: nose compat hack, move to nose plugin # if it takes a positional arg, its probably a py.test style one https://bitbucket.org/hpk42/pytest/commits/e5e97a902d49/ Changeset: e5e97a902d49 User: Brian Okken Date: 2013-06-22 18:35:10 Summary: add test_unittest_style_setup_teardown() to test setUpModule() and tearDownModule() Affected #: 1 file diff -r a6b43681c095cf385b81926cadc5eb629ef4f8bc -r e5e97a902d4998fce36e99dfbceb099cb410eda7 testing/test_unittest.py --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -65,6 +65,28 @@ rep = reprec.matchreport("test_both", when="teardown") assert rep.failed and '42' in str(rep.longrepr) +def test_unittest_style_setup_teardown(testdir): + testdir.makepyfile(""" + l = [] + + def setUpModule(): + l.append(1) + + def tearDownModule(): + del l[0] + + def test_hello(): + assert l == [1] + + def test_world(): + assert l == [1] + """) + result = testdir.runpytest('-p', 'nose') + result.stdout.fnmatch_lines([ + "*2 passed*", + ]) + + def test_new_instances(testdir): testpath = testdir.makepyfile(""" import unittest https://bitbucket.org/hpk42/pytest/commits/0df9999d1bd0/ Changeset: 0df9999d1bd0 User: Brian Okken Date: 2013-06-22 18:42:31 Summary: change how the test is called Affected #: 1 file diff -r e5e97a902d4998fce36e99dfbceb099cb410eda7 -r 0df9999d1bd00ba3f109dcc76398b861744b15b1 testing/test_unittest.py --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -66,7 +66,7 @@ assert rep.failed and '42' in str(rep.longrepr) def test_unittest_style_setup_teardown(testdir): - testdir.makepyfile(""" + testpath = testdir.makepyfile(""" l = [] def setUpModule(): @@ -81,7 +81,7 @@ def test_world(): assert l == [1] """) - result = testdir.runpytest('-p', 'nose') + result = testdir.runpytest(testpath) result.stdout.fnmatch_lines([ "*2 passed*", ]) 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 Sun Jun 23 09:27:18 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 23 Jun 2013 07:27:18 -0000 Subject: [Pytest-commit] commit/tox: hpk42: fix tox.ini Message-ID: <20130623072718.15334.3273@bitbucket21.managed.contegix.com> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/984fad7bef53/ Changeset: 984fad7bef53 User: hpk42 Date: 2013-06-23 09:27:06 Summary: fix tox.ini Affected #: 2 files diff -r d1c4826481bedb84636d1b805519ace5bffce9bf -r 984fad7bef53472dd0cf472a0d3468e405d30fd8 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -1.5.0.dev +1.5.0 ----------------- - fix issue104: use setuptools by default, instead of distribute, diff -r d1c4826481bedb84636d1b805519ace5bffce9bf -r 984fad7bef53472dd0cf472a0d3468e405d30fd8 tox.ini --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,10 @@ deps=pytest==2.3.4 pytest-instafail +[testenv:py25] +setenvs = + PIP_INSECURE=True + [testenv:docs] basepython=python changedir=doc Repository URL: https://bitbucket.org/hpk42/tox/ -- 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 Jun 27 11:55:43 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 27 Jun 2013 09:55:43 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20130627095543.24827.67945@bitbucket01.managed.contegix.com> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/f0b277bc671a/ Changeset: f0b277bc671a Branch: jezdez/added-readme-to-package-manifest-templat-1372083252428 User: jezdez Date: 2013-06-24 16:14:25 Summary: Added README to package manifest template. Affected #: 1 file diff -r 984fad7bef53472dd0cf472a0d3468e405d30fd8 -r f0b277bc671a0c14a70f4c85015b004f360cd1d9 MANIFEST.in --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include CHANGELOG -include README.txt +include README.rst include CONTRIBUTORS include ISSUES.txt include LICENSE https://bitbucket.org/hpk42/tox/commits/d315272501ba/ Changeset: d315272501ba User: hpk42 Date: 2013-06-27 11:55:39 Summary: Merged in jezdez/tox/jezdez/added-readme-to-package-manifest-templat-1372083252428 (pull request #46) Added README to package manifest template. Affected #: 1 file diff -r 984fad7bef53472dd0cf472a0d3468e405d30fd8 -r d315272501bafb1a799fad80b2555002f9bd524d MANIFEST.in --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include CHANGELOG -include README.txt +include README.rst include CONTRIBUTORS include ISSUES.txt include LICENSE Repository URL: https://bitbucket.org/hpk42/tox/ -- 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 Jun 28 13:01:26 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Fri, 28 Jun 2013 11:01:26 -0000 Subject: [Pytest-commit] commit/pytest: 3 new changesets Message-ID: <20130628110126.13857.75104@bitbucket16.managed.contegix.com> 3 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/88cff89ea222/ Changeset: 88cff89ea222 User: hpk42 Date: 2013-06-23 09:24:48 Summary: mention added support for setUpModule/tearDownModule detection, thanks Brian Okken. Affected #: 4 files diff -r 0df9999d1bd00ba3f109dcc76398b861744b15b1 -r 88cff89ea2229b62d36be11934e453173a57b26c AUTHORS --- a/AUTHORS +++ b/AUTHORS @@ -30,3 +30,4 @@ Daniel Nuri Graham Horler Andreas Zeidler +Brian Okken diff -r 0df9999d1bd00ba3f109dcc76398b861744b15b1 -r 88cff89ea2229b62d36be11934e453173a57b26c CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ Changes between 2.3.5 and 2.4.DEV ----------------------------------- +- add support for setUpModule/tearDownModule detection, thanks Brian Okken. + - make sessionfinish hooks execute with the same cwd-context as at session start (helps fix plugin behaviour which write output files with relative path such as pytest-cov) diff -r 0df9999d1bd00ba3f109dcc76398b861744b15b1 -r 88cff89ea2229b62d36be11934e453173a57b26c _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.4.0.dev3' +__version__ = '2.4.0.dev4' diff -r 0df9999d1bd00ba3f109dcc76398b861744b15b1 -r 88cff89ea2229b62d36be11934e453173a57b26c setup.py --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.4.0.dev3', + version='2.4.0.dev4', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], https://bitbucket.org/hpk42/pytest/commits/e4e280bd27d5/ Changeset: e4e280bd27d5 User: hpk42 Date: 2013-06-28 12:54:10 Summary: some internal renaming to make more sense of the sorting algo, no semantical changes. Affected #: 1 file diff -r 88cff89ea2229b62d36be11934e453173a57b26c -r e4e280bd27d5e72469d3965a0fb0be28a769f9c2 _pytest/python.py --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1747,29 +1747,31 @@ def parametrize_sorted(items, ignore, cache, scopenum): if scopenum >= 3: return items - newitems = [] - olditems = [] + similar_items = [] + other_items = [] slicing_argparam = None for item in items: argparamlist = getfuncargparams(item, ignore, scopenum, cache) if slicing_argparam is None and argparamlist: slicing_argparam = argparamlist[0] - slicing_index = len(olditems) + slicing_index = len(other_items) if slicing_argparam in argparamlist: - newitems.append(item) + similar_items.append(item) else: - olditems.append(item) - if newitems: + other_items.append(item) + if similar_items: newignore = ignore.copy() newignore.add(slicing_argparam) - newitems = parametrize_sorted(newitems + olditems[slicing_index:], - newignore, cache, scopenum) - old1 = parametrize_sorted(olditems[:slicing_index], newignore, - cache, scopenum+1) - return old1 + newitems + part2 = parametrize_sorted( + similar_items + other_items[slicing_index:], + newignore, cache, scopenum) + part1 = parametrize_sorted( + other_items[:slicing_index], newignore, + cache, scopenum+1) + return part1 + part2 else: - olditems = parametrize_sorted(olditems, ignore, cache, scopenum+1) - return olditems + newitems + other_items = parametrize_sorted(other_items, ignore, cache, scopenum+1) + return other_items + similar_items def getfuncargparams(item, ignore, scopenum, cache): """ return list of (arg,param) tuple, sorted by broader scope first. """ https://bitbucket.org/hpk42/pytest/commits/4cddadcc82d0/ Changeset: 4cddadcc82d0 User: hpk42 Date: 2013-06-28 12:57:10 Summary: fix issue323 - parametrize() of many module-scoped params Affected #: 6 files diff -r e4e280bd27d5e72469d3965a0fb0be28a769f9c2 -r 4cddadcc82d062982cd37f42f669a332f8ba372f CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ Changes between 2.3.5 and 2.4.DEV ----------------------------------- +- fix issue323 - sorting of many module-scoped arg parametrizations + - add support for setUpModule/tearDownModule detection, thanks Brian Okken. - make sessionfinish hooks execute with the same cwd-context as at diff -r e4e280bd27d5e72469d3965a0fb0be28a769f9c2 -r 4cddadcc82d062982cd37f42f669a332f8ba372f _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.4.0.dev4' +__version__ = '2.4.0.dev5' diff -r e4e280bd27d5e72469d3965a0fb0be28a769f9c2 -r 4cddadcc82d062982cd37f42f669a332f8ba372f _pytest/python.py --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1747,9 +1747,16 @@ def parametrize_sorted(items, ignore, cache, scopenum): if scopenum >= 3: return items + + # we pick the first item which has a arg/param combo in the + # requested scope and sort other items with the same combo + # into "newitems" which then is a list of all items using this + # arg/param. + similar_items = [] other_items = [] slicing_argparam = None + slicing_index = 0 for item in items: argparamlist = getfuncargparams(item, ignore, scopenum, cache) if slicing_argparam is None and argparamlist: @@ -1759,7 +1766,8 @@ similar_items.append(item) else: other_items.append(item) - if similar_items: + + if (len(similar_items) + slicing_index) > 1: newignore = ignore.copy() newignore.add(slicing_argparam) part2 = parametrize_sorted( diff -r e4e280bd27d5e72469d3965a0fb0be28a769f9c2 -r 4cddadcc82d062982cd37f42f669a332f8ba372f setup.py --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.4.0.dev4', + version='2.4.0.dev5', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff -r e4e280bd27d5e72469d3965a0fb0be28a769f9c2 -r 4cddadcc82d062982cd37f42f669a332f8ba372f testing/python/metafunc.py --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -555,6 +555,20 @@ reprec = testdir.inline_run() reprec.assertoutcome(passed=5) + def test_parametrize_issue323(self, testdir): + testdir.makepyfile(""" + import pytest + + @pytest.fixture(scope='module', params=range(966)) + def foo(request): + return request.param + + def test_it(foo): + pass + """) + reprec = testdir.inline_run("--collectonly") + assert not reprec.getcalls("pytest_internalerror") + def test_usefixtures_seen_in_generate_tests(self, testdir): testdir.makepyfile(""" import pytest diff -r e4e280bd27d5e72469d3965a0fb0be28a769f9c2 -r 4cddadcc82d062982cd37f42f669a332f8ba372f tox.ini --- a/tox.ini +++ b/tox.ini @@ -98,4 +98,4 @@ python_classes=Test Acceptance python_functions=test pep8ignore = E401 E225 E261 E128 E124 E302 -norecursedirs = .tox ja +norecursedirs = .tox ja .hg 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.