From issues-reply at bitbucket.org Tue Jul 1 17:40:43 2014 From: issues-reply at bitbucket.org (Floris Bruynooghe) Date: Tue, 01 Jul 2014 15:40:43 -0000 Subject: [Pytest-commit] Issue #536: Update docs on skipping slow tests with command line option (hpk42/pytest) Message-ID: <20140701154043.29348.51512@app12.ash-private.bitbucket.org> New issue 536: Update docs on skipping slow tests with command line option https://bitbucket.org/hpk42/pytest/issue/536/update-docs-on-skipping-slow-tests-with Floris Bruynooghe: The docs at http://pytest.org/latest/example/simple.html#control-skipping-of-tests-according-to-command-line-option should be updated to use an autouse fixture or directly use the config object in a skipif marker. From commits-noreply at bitbucket.org Thu Jul 3 12:58:43 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 03 Jul 2014 10:58:43 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: avoid importing "py.test" (an old alias module for "pytest") Message-ID: <20140703105843.14151.72505@app12.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/49db048a7f4f/ Changeset: 49db048a7f4f User: hpk42 Date: 2014-07-03 12:58:12 Summary: avoid importing "py.test" (an old alias module for "pytest") Affected #: 3 files diff -r 011b6de727bce776d2bb939e65a485c089351a71 -r 49db048a7f4f83fe07b74000b02c3d60043cfcd2 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -98,6 +98,7 @@ - fix issue512: show "" for arguments which might not be set in monkeypatch plugin. Improves output in documentation. +- avoid importing "py.test" (an old alias module for "pytest") 2.5.2 ----------------------------------- diff -r 011b6de727bce776d2bb939e65a485c089351a71 -r 49db048a7f4f83fe07b74000b02c3d60043cfcd2 _pytest/config.py --- a/_pytest/config.py +++ b/_pytest/config.py @@ -823,7 +823,8 @@ if default is not notset: return default if skip: - py.test.skip("no %r option found" %(name,)) + import pytest + pytest.skip("no %r option found" %(name,)) raise ValueError("no option named %r" % (name,)) def getvalue(self, name, path=None): diff -r 011b6de727bce776d2bb939e65a485c089351a71 -r 49db048a7f4f83fe07b74000b02c3d60043cfcd2 _pytest/core.py --- a/_pytest/core.py +++ b/_pytest/core.py @@ -137,7 +137,8 @@ def skipifmissing(self, name): if not self.hasplugin(name): - py.test.skip("plugin %r is missing" % name) + import pytest + pytest.skip("plugin %r is missing" % name) def hasplugin(self, name): return bool(self.getplugin(name)) @@ -220,10 +221,9 @@ return self.import_plugin(modname[7:]) raise except: + import pytest e = py.std.sys.exc_info()[1] - if not hasattr(py.test, 'skip'): - raise - elif not isinstance(e, py.test.skip.Exception): + if not hasattr(pytest, 'skip') or not isinstance(e, pytest.skip.Exception): raise self._warnings.append("skipped plugin %r: %s" %((modname, e.msg))) else: 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 Jul 3 13:20:58 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 03 Jul 2014 11:20:58 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: fix ordering of import line of last commit Message-ID: <20140703112058.15149.24446@app12.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/8a72cc33da81/ Changeset: 8a72cc33da81 User: hpk42 Date: 2014-07-03 13:20:51 Summary: fix ordering of import line of last commit Affected #: 1 file diff -r 49db048a7f4f83fe07b74000b02c3d60043cfcd2 -r 8a72cc33da81fea3542e3b69c3371a7b12de9e67 _pytest/core.py --- a/_pytest/core.py +++ b/_pytest/core.py @@ -221,8 +221,8 @@ return self.import_plugin(modname[7:]) raise except: + e = py.std.sys.exc_info()[1] import pytest - e = py.std.sys.exc_info()[1] if not hasattr(pytest, 'skip') or not isinstance(e, pytest.skip.Exception): raise self._warnings.append("skipped plugin %r: %s" %((modname, e.msg))) 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 Jul 3 16:48:03 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 03 Jul 2014 14:48:03 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Close branch fix_norecursedirs_doc_typos Message-ID: <20140703144803.24444.70431@app01.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/35eb7a8e25b8/ Changeset: 35eb7a8e25b8 Branch: fix_norecursedirs_doc_typos User: hpk42 Date: 2014-07-03 16:47:58 Summary: Close branch fix_norecursedirs_doc_typos Affected #: 0 files 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 Jul 3 16:48:03 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 03 Jul 2014 14:48:03 -0000 Subject: [Pytest-commit] commit/pytest: 2 new changesets Message-ID: <20140703144803.20528.68146@app08.ash-private.bitbucket.org> 2 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/a1b12df8a9e9/ Changeset: a1b12df8a9e9 Branch: fix_norecursedirs_doc_typos User: Marc Abramowitz Date: 2014-07-03 16:36:07 Summary: doc/en/customize.txt: Fix norecursedirs typo and update documented default to match current default. Affected #: 1 file diff -r 0457bfb8ce8f2cf0f8481142122fa634726dbdfc -r a1b12df8a9e915a9417c8c03fe45eca755864934 doc/en/customize.txt --- a/doc/en/customize.txt +++ b/doc/en/customize.txt @@ -97,7 +97,7 @@ [seq] matches any character in seq [!seq] matches any char not in seq - Default patterns are ``.* _darcs CVS {args}``. Setting a ``norecursedir`` + Default patterns are ``'.*', 'CVS', '_darcs', '{arch}'``. Setting a ``norecursedirs`` replaces the default. Here is an example of how to avoid certain directories:: https://bitbucket.org/hpk42/pytest/commits/a62c6c8a3811/ Changeset: a62c6c8a3811 User: hpk42 Date: 2014-07-03 16:47:58 Summary: Merged in msabramo/pytest/fix_norecursedirs_doc_typos (pull request #176) doc/en/customize.txt: Fix norecursedirs typo Affected #: 1 file diff -r 8a72cc33da81fea3542e3b69c3371a7b12de9e67 -r a62c6c8a3811f278c318acde89fde8fab59e6936 doc/en/customize.txt --- a/doc/en/customize.txt +++ b/doc/en/customize.txt @@ -97,7 +97,7 @@ [seq] matches any character in seq [!seq] matches any char not in seq - Default patterns are ``.* _darcs CVS {args}``. Setting a ``norecursedir`` + Default patterns are ``'.*', 'CVS', '_darcs', '{arch}'``. Setting a ``norecursedirs`` replaces the default. Here is an example of how to avoid certain directories:: 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 Jul 3 16:48:08 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 03 Jul 2014 14:48:08 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Merged in msabramo/pytest/fix_norecursedirs_doc_typos (pull request #176) Message-ID: <20140703144808.22560.98504@app04.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/a62c6c8a3811/ Changeset: a62c6c8a3811 User: hpk42 Date: 2014-07-03 16:47:58 Summary: Merged in msabramo/pytest/fix_norecursedirs_doc_typos (pull request #176) doc/en/customize.txt: Fix norecursedirs typo Affected #: 1 file diff -r 8a72cc33da81fea3542e3b69c3371a7b12de9e67 -r a62c6c8a3811f278c318acde89fde8fab59e6936 doc/en/customize.txt --- a/doc/en/customize.txt +++ b/doc/en/customize.txt @@ -97,7 +97,7 @@ [seq] matches any character in seq [!seq] matches any char not in seq - Default patterns are ``.* _darcs CVS {args}``. Setting a ``norecursedir`` + Default patterns are ``'.*', 'CVS', '_darcs', '{arch}'``. Setting a ``norecursedirs`` replaces the default. Here is an example of how to avoid certain directories:: 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 Jul 3 16:51:21 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 03 Jul 2014 14:51:21 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Merged in msabramo/pytest/norecursedirs_add_star_dot_egg (pull request #177) Message-ID: <20140703145121.9403.19488@app02.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/557ba6edb022/ Changeset: 557ba6edb022 User: hpk42 Date: 2014-07-03 16:51:17 Summary: Merged in msabramo/pytest/norecursedirs_add_star_dot_egg (pull request #177) Add *.egg to default for norecursedirs Affected #: 2 files diff -r a62c6c8a3811f278c318acde89fde8fab59e6936 -r 557ba6edb022af119792fd57e9bdabe5617bc978 _pytest/main.py --- a/_pytest/main.py +++ b/_pytest/main.py @@ -23,7 +23,7 @@ def pytest_addoption(parser): parser.addini("norecursedirs", "directory patterns to avoid for recursion", - type="args", default=('.*', 'CVS', '_darcs', '{arch}')) + type="args", default=('.*', 'CVS', '_darcs', '{arch}', '*.egg')) #parser.addini("dirpatterns", # "patterns specifying possible locations of test files", # type="linelist", default=["**/test_*.txt", diff -r a62c6c8a3811f278c318acde89fde8fab59e6936 -r 557ba6edb022af119792fd57e9bdabe5617bc978 doc/en/customize.txt --- a/doc/en/customize.txt +++ b/doc/en/customize.txt @@ -97,9 +97,9 @@ [seq] matches any character in seq [!seq] matches any char not in seq - Default patterns are ``'.*', 'CVS', '_darcs', '{arch}'``. Setting a ``norecursedirs`` - replaces the default. Here is an example of how to avoid - certain directories:: + Default patterns are ``'.*', 'CVS', '_darcs', '{arch}', '*.egg'``. + Setting a ``norecursedirs`` replaces the default. Here is an example of + how to avoid certain directories:: # content of setup.cfg [pytest] 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 Jul 3 16:51:22 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 03 Jul 2014 14:51:22 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Close branch norecursedirs_add_star_dot_egg Message-ID: <20140703145122.1435.18568@app02.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/37ba4d20aec6/ Changeset: 37ba4d20aec6 Branch: norecursedirs_add_star_dot_egg User: hpk42 Date: 2014-07-03 16:51:17 Summary: Close branch norecursedirs_add_star_dot_egg Affected #: 0 files 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 Jul 3 16:51:23 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 03 Jul 2014 14:51:23 -0000 Subject: [Pytest-commit] commit/pytest: 2 new changesets Message-ID: <20140703145123.18179.50317@app13.ash-private.bitbucket.org> 2 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/2c4121432a55/ Changeset: 2c4121432a55 Branch: norecursedirs_add_star_dot_egg User: Marc Abramowitz Date: 2014-07-03 16:49:03 Summary: Add *.egg to default for norecursedirs Affected #: 2 files diff -r a1b12df8a9e915a9417c8c03fe45eca755864934 -r 2c4121432a559da7b5a05c854f8cd9c39fa29bd5 _pytest/main.py --- a/_pytest/main.py +++ b/_pytest/main.py @@ -23,7 +23,7 @@ def pytest_addoption(parser): parser.addini("norecursedirs", "directory patterns to avoid for recursion", - type="args", default=('.*', 'CVS', '_darcs', '{arch}')) + type="args", default=('.*', 'CVS', '_darcs', '{arch}', '*.egg')) #parser.addini("dirpatterns", # "patterns specifying possible locations of test files", # type="linelist", default=["**/test_*.txt", diff -r a1b12df8a9e915a9417c8c03fe45eca755864934 -r 2c4121432a559da7b5a05c854f8cd9c39fa29bd5 doc/en/customize.txt --- a/doc/en/customize.txt +++ b/doc/en/customize.txt @@ -97,9 +97,9 @@ [seq] matches any character in seq [!seq] matches any char not in seq - Default patterns are ``'.*', 'CVS', '_darcs', '{arch}'``. Setting a ``norecursedirs`` - replaces the default. Here is an example of how to avoid - certain directories:: + Default patterns are ``'.*', 'CVS', '_darcs', '{arch}', '*.egg'``. + Setting a ``norecursedirs`` replaces the default. Here is an example of + how to avoid certain directories:: # content of setup.cfg [pytest] https://bitbucket.org/hpk42/pytest/commits/557ba6edb022/ Changeset: 557ba6edb022 User: hpk42 Date: 2014-07-03 16:51:17 Summary: Merged in msabramo/pytest/norecursedirs_add_star_dot_egg (pull request #177) Add *.egg to default for norecursedirs Affected #: 2 files diff -r a62c6c8a3811f278c318acde89fde8fab59e6936 -r 557ba6edb022af119792fd57e9bdabe5617bc978 _pytest/main.py --- a/_pytest/main.py +++ b/_pytest/main.py @@ -23,7 +23,7 @@ def pytest_addoption(parser): parser.addini("norecursedirs", "directory patterns to avoid for recursion", - type="args", default=('.*', 'CVS', '_darcs', '{arch}')) + type="args", default=('.*', 'CVS', '_darcs', '{arch}', '*.egg')) #parser.addini("dirpatterns", # "patterns specifying possible locations of test files", # type="linelist", default=["**/test_*.txt", diff -r a62c6c8a3811f278c318acde89fde8fab59e6936 -r 557ba6edb022af119792fd57e9bdabe5617bc978 doc/en/customize.txt --- a/doc/en/customize.txt +++ b/doc/en/customize.txt @@ -97,9 +97,9 @@ [seq] matches any character in seq [!seq] matches any char not in seq - Default patterns are ``'.*', 'CVS', '_darcs', '{arch}'``. Setting a ``norecursedirs`` - replaces the default. Here is an example of how to avoid - certain directories:: + Default patterns are ``'.*', 'CVS', '_darcs', '{arch}', '*.egg'``. + Setting a ``norecursedirs`` replaces the default. Here is an example of + how to avoid certain directories:: # content of setup.cfg [pytest] 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 Jul 4 12:47:07 2014 From: issues-reply at bitbucket.org (=?utf-8?q?Thomas_G=C3=BCttler?=) Date: Fri, 04 Jul 2014 10:47:07 -0000 Subject: [Pytest-commit] Issue #537: DeprecationWarning: The compiler package is deprecated and removed in Python 3.x. from compiler import parse, ast, pycodege (hpk42/pytest) Message-ID: <20140704104707.21125.13946@app12.ash-private.bitbucket.org> New issue 537: DeprecationWarning: The compiler package is deprecated and removed in Python 3.x. from compiler import parse, ast, pycodege https://bitbucket.org/hpk42/pytest/issue/537/deprecationwarning-the-compiler-package-is Thomas G?ttler: We use pytest==2.5.2 and get this warning: *DeprecationWarning: The compiler package is deprecated and removed in Python 3.x. from compiler import parse, ast, pycodege* Here is the stacktrace of the import statement: ``` #!python INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "/home/modwork_vums_dtg/lib/python2.7/site-packages/_pytest/main.py", line 77, in wrap_session INTERNALERROR> config.do_configure() INTERNALERROR> File "/home/modwork_vums_dtg/lib/python2.7/site-packages/_pytest/config.py", line 608, in do_configure INTERNALERROR> self.hook.pytest_configure(config=self) INTERNALERROR> File "/home/modwork_vums_dtg/lib/python2.7/site-packages/_pytest/core.py", line 377, in __call__ INTERNALERROR> return self._docall(methods, kwargs) INTERNALERROR> File "/home/modwork_vums_dtg/lib/python2.7/site-packages/_pytest/core.py", line 388, in _docall INTERNALERROR> res = mc.execute() INTERNALERROR> File "/home/modwork_vums_dtg/lib/python2.7/site-packages/_pytest/core.py", line 289, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "/home/modwork_vums_dtg/lib/python2.7/site-packages/_pytest/assertion/__init__.py", line 47, in pytest_configure INTERNALERROR> _load_modules(mode) INTERNALERROR> File "/home/modwork_vums_dtg/lib/python2.7/site-packages/_pytest/assertion/__init__.py", line 107, in _load_modules INTERNALERROR> from _pytest.assertion import reinterpret # noqa INTERNALERROR> File "/home/modwork_vums_dtg/lib/python2.7/site-packages/_pytest/assertion/reinterpret.py", line 50, in INTERNALERROR> from _pytest.assertion.oldinterpret import interpret as reinterpret_old INTERNALERROR> File "/home/modwork_vums_dtg/lib/python2.7/site-packages/_pytest/assertion/oldinterpret.py", line 1, in ``` Do you know this issue? What can I do to get this warning fixed? From issues-reply at bitbucket.org Fri Jul 4 19:26:17 2014 From: issues-reply at bitbucket.org (Mark Stacey) Date: Fri, 04 Jul 2014 17:26:17 -0000 Subject: [Pytest-commit] Issue #538: Fixture scope documentation (hpk42/pytest) Message-ID: <20140704172617.3938.76592@app03.ash-private.bitbucket.org> New issue 538: Fixture scope documentation https://bitbucket.org/hpk42/pytest/issue/538/fixture-scope-documentation Mark Stacey: The [http://pytest.org/latest/fixture.html](http://pytest.org/latest/fixture.html) briefly mentions the possibility of a fixture with class scope in the beginning summary, but it isn't mentioned anywhere else in the document. I had to check the source code to see if this was possible. Also, I didn't see any mention that the default scope was "function" - it was implied, but not explicit. I think it would be helpful to include a full list of available scopes, and to explicitly say that function scope is default. Both of these things are included in the docstring for the fixture function in the source code: ``` #!python :arg scope: the scope for which this fixture is shared, one of "function" (default), "class", "module", "session". ``` From commits-noreply at bitbucket.org Sat Jul 5 17:34:28 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sat, 05 Jul 2014 15:34:28 -0000 Subject: [Pytest-commit] commit/py: hpk42: make sure that forked functions run with auto-flushing stdout/stderr Message-ID: <20140705153428.27677.42211@app04.ash-private.bitbucket.org> 1 new commit in py: https://bitbucket.org/hpk42/py/commits/a990113bb086/ Changeset: a990113bb086 User: hpk42 Date: 2014-07-05 17:15:46 Summary: make sure that forked functions run with auto-flushing stdout/stderr so that if they segfault we get to see stdout/stderr. Affected #: 5 files diff -r 6698f8b49b78c6489c932ce95ebda8dac2a3655d -r a990113bb086420f36489082fdc5220f46c6f8d0 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,10 @@ methods to allow adding information in the boxed process. Thanks Marc Schlaich. +- ForkedFunc in the child opens in "auto-flush" mode for + stdout/stderr so that when a subprocess dies you can see + its output even if it didn't flush itself. + - refactor traceback generation in light of pytest issue 364 (shortening tracebacks). you can now set a new traceback style on a per-entry basis such that a caller can force entries to be diff -r 6698f8b49b78c6489c932ce95ebda8dac2a3655d -r a990113bb086420f36489082fdc5220f46c6f8d0 py/__init__.py --- a/py/__init__.py +++ b/py/__init__.py @@ -8,7 +8,7 @@ (c) Holger Krekel and others, 2004-2013 """ -__version__ = '1.4.21.dev2' +__version__ = '1.4.21.dev3' from py import _apipkg diff -r 6698f8b49b78c6489c932ce95ebda8dac2a3655d -r a990113bb086420f36489082fdc5220f46c6f8d0 py/_process/forkedfunc.py --- a/py/_process/forkedfunc.py +++ b/py/_process/forkedfunc.py @@ -36,6 +36,19 @@ sys.stderr.flush() +def get_unbuffered_io(fd, filename): + f = open(str(filename), "w") + if fd != f.fileno(): + os.dup2(f.fileno(), fd) + class AutoFlush: + def write(self, data): + f.write(data) + f.flush() + def __getattr__(self, name): + return getattr(f, name) + return AutoFlush() + + class ForkedFunc(HookMixin): EXITSTATUS_EXCEPTION = 3 @@ -63,14 +76,8 @@ def _child(self, nice_level): # right now we need to call a function, but first we need to # map all IO that might happen - sys.stdout = stdout = open(str(self.STDOUT), "w") - fdstdout = stdout.fileno() - if fdstdout != 1: - os.dup2(fdstdout, 1) - sys.stderr = stderr = open(str(self.STDERR), "w") - fdstderr = stderr.fileno() - if fdstderr != 2: - os.dup2(fdstderr, 2) + sys.stdout = stdout = get_unbuffered_io(1, self.STDOUT) + sys.stderr = stderr = get_unbuffered_io(2, self.STDERR) retvalf = self.RETVAL.open("wb") EXITSTATUS = 0 try: diff -r 6698f8b49b78c6489c932ce95ebda8dac2a3655d -r a990113bb086420f36489082fdc5220f46c6f8d0 setup.py --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ name='py', description='library with cross-python path, ini-parsing, io, code, log facilities', long_description = open('README.txt').read(), - version='1.4.21.dev2', + version='1.4.21.dev3', url='http://pylib.readthedocs.org/', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff -r 6698f8b49b78c6489c932ce95ebda8dac2a3655d -r a990113bb086420f36489082fdc5220f46c6f8d0 testing/process/test_forkedfunc.py --- a/testing/process/test_forkedfunc.py +++ b/testing/process/test_forkedfunc.py @@ -56,6 +56,15 @@ assert result.out == "s" +def test_forkedfunc_on_stdout(): + def boxf3(): + import sys + sys.stdout.write("hello\n") + os.kill(os.getpid(), 11) + result = py.process.ForkedFunc(boxf3).waitfinish() + assert result.signal == 11 + assert result.out == "hello\n" + def test_forkedfunc_signal(): result = py.process.ForkedFunc(boxseg).waitfinish() assert result.retval is None 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 Jul 8 13:50:54 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 08 Jul 2014 11:50:54 -0000 Subject: [Pytest-commit] commit/py-trunk: hpk42: README.txt edited online with Bitbucket Message-ID: <20140708115054.8361.75415@app10.ash-private.bitbucket.org> 1 new commit in py-trunk: https://bitbucket.org/hpk42/py-trunk/commits/1d8e0bc82bfb/ Changeset: 1d8e0bc82bfb Branch: trunk User: hpk42 Date: 2014-07-08 13:50:52 Summary: README.txt edited online with Bitbucket Affected #: 1 file diff -r 57883821cb4943855efa0062266032ed7fed8308 -r 1d8e0bc82bfb80c259d36d6ced6a4ff4155ecb96 README.txt --- a/README.txt +++ b/README.txt @@ -1,12 +1,11 @@ -The 'py' package is an empty placeholder package solely for compatibibility -and convenience of upgrading older "py" installations. It will require -the following three now split-out distributions: - -* pytest: https://bitbucket.org/hpk42/pytest - -* pylib: https://bitbucket.org/hpk42/pylib - -* pycmd: https://bitbucket.org/hpk42/pycmd - -See http://pylib.org and http://pytest.org for more info on those packages. - +The 'py' package is an empty placeholder package solely for compatibibility +and convenience of upgrading older "py" installations. It will require +the following three now split-out distributions: + +* pytest: https://bitbucket.org/hpk42/pytest + +* pylib: https://bitbucket.org/hpk42/py + +* pycmd: https://bitbucket.org/hpk42/pycmd + +See http://pylib.org and http://pytest.org for more info on those packages. \ No newline at end of file Repository URL: https://bitbucket.org/hpk42/py-trunk/ -- 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 Jul 10 09:00:29 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 10 Jul 2014 07:00:29 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Merged in bmcorser/pytest-1/bmcorser/scratching-an-itch-love-pytest-1404943207227 (pull request #178) Message-ID: <20140710070029.12820.51455@app02.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/78792abae40b/ Changeset: 78792abae40b User: hpk42 Date: 2014-07-10 09:00:24 Summary: Merged in bmcorser/pytest-1/bmcorser/scratching-an-itch-love-pytest-1404943207227 (pull request #178) Scratching an itch. Love py.test! Affected #: 1 file diff -r 131dfc15bb03f70e92b405f4f9c93ccda6d07a7e -r 78792abae40b6b4e4d077ccf62389e8aee9649ba doc/en/yieldfixture.txt --- a/doc/en/yieldfixture.txt +++ b/doc/en/yieldfixture.txt @@ -1,4 +1,3 @@ - .. _yieldfixture: Fixture functions using "yield" / context manager integration @@ -54,7 +53,7 @@ 1 passed in 0.00 seconds -We can also seemlessly use the new syntax with ``with`` statements. +We can also seamlessly use the new syntax with ``with`` statements. Let's simplify the above ``passwd`` fixture:: # content of test_yield2.py 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 Jul 10 09:00:29 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 10 Jul 2014 07:00:29 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Close branch bmcorser/scratching-an-itch-love-pytest-1404943207227 Message-ID: <20140710070029.829.57973@app11.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/3a84c16bb83a/ Changeset: 3a84c16bb83a Branch: bmcorser/scratching-an-itch-love-pytest-1404943207227 User: hpk42 Date: 2014-07-10 09:00:24 Summary: Close branch bmcorser/scratching-an-itch-love-pytest-1404943207227 Affected #: 0 files 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 Jul 10 09:00:29 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 10 Jul 2014 07:00:29 -0000 Subject: [Pytest-commit] commit/pytest: 2 new changesets Message-ID: <20140710070029.29321.50596@app03.ash-private.bitbucket.org> 2 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/ec8019ea5213/ Changeset: ec8019ea5213 Branch: bmcorser/scratching-an-itch-love-pytest-1404943207227 User: bmcorser Date: 2014-07-10 00:00:24 Summary: Scratching an itch. Love py.test! Affected #: 1 file diff -r 131dfc15bb03f70e92b405f4f9c93ccda6d07a7e -r ec8019ea5213988a1b13d65b2bf878b24d58a970 doc/en/yieldfixture.txt --- a/doc/en/yieldfixture.txt +++ b/doc/en/yieldfixture.txt @@ -1,4 +1,3 @@ - .. _yieldfixture: Fixture functions using "yield" / context manager integration @@ -54,7 +53,7 @@ 1 passed in 0.00 seconds -We can also seemlessly use the new syntax with ``with`` statements. +We can also seamlessly use the new syntax with ``with`` statements. Let's simplify the above ``passwd`` fixture:: # content of test_yield2.py https://bitbucket.org/hpk42/pytest/commits/78792abae40b/ Changeset: 78792abae40b User: hpk42 Date: 2014-07-10 09:00:24 Summary: Merged in bmcorser/pytest-1/bmcorser/scratching-an-itch-love-pytest-1404943207227 (pull request #178) Scratching an itch. Love py.test! Affected #: 1 file diff -r 131dfc15bb03f70e92b405f4f9c93ccda6d07a7e -r 78792abae40b6b4e4d077ccf62389e8aee9649ba doc/en/yieldfixture.txt --- a/doc/en/yieldfixture.txt +++ b/doc/en/yieldfixture.txt @@ -1,4 +1,3 @@ - .. _yieldfixture: Fixture functions using "yield" / context manager integration @@ -54,7 +53,7 @@ 1 passed in 0.00 seconds -We can also seemlessly use the new syntax with ``with`` statements. +We can also seamlessly use the new syntax with ``with`` statements. Let's simplify the above ``passwd`` fixture:: # content of test_yield2.py 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 Jul 10 09:13:55 2014 From: issues-reply at bitbucket.org (Ronny Pfannschmidt) Date: Thu, 10 Jul 2014 07:13:55 -0000 Subject: [Pytest-commit] Issue #180: detox ignores/breaks usedevelop (hpk42/tox) Message-ID: <20140710071355.30275.88232@app14.ash-private.bitbucket.org> New issue 180: detox ignores/breaks usedevelop https://bitbucket.org/hpk42/tox/issue/180/detox-ignores-breaks-usedevelop Ronny Pfannschmidt: when running an evn with deox instead of tox, detox wouldnt do the develop installs, and break insteas even tox would no longer work (due to develop noop install) until recreate with -r on plain tox tox version 1.7.1 detox version 0.9.3 From commits-noreply at bitbucket.org Wed Jul 9 01:09:45 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 08 Jul 2014 23:09:45 -0000 Subject: [Pytest-commit] commit/pytest: nicoddemus: Updating plugins_index Message-ID: <20140708230945.18688.90137@app04.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/131dfc15bb03/ Changeset: 131dfc15bb03 User: nicoddemus Date: 2014-07-09 01:08:19 Summary: Updating plugins_index Affected #: 1 file diff -r 557ba6edb022af119792fd57e9bdabe5617bc978 -r 131dfc15bb03f70e92b405f4f9c93ccda6d07a7e doc/en/plugins_index/index.txt --- a/doc/en/plugins_index/index.txt +++ b/doc/en/plugins_index/index.txt @@ -4,7 +4,7 @@ =========================== The table below contains a listing of plugins found in PyPI and -their status when tested using py.test **2.5.2** and python 2.7 and +their status when tested using py.test **2.6.0.dev2** and python 2.7 and 3.3. A complete listing can also be found at @@ -12,134 +12,141 @@ status against other py.test releases. -========================================================================================== ============================================================================================================ ============================================================================================================ ========================================================================= ============================================================================================================================================= - Name Py27 Py34 Repo Summary -========================================================================================== ============================================================================================================ ============================================================================================================ ========================================================================= ============================================================================================================================================= - `pytest-allure-adaptor-1.3.8 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-allure-adaptor-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-allure-adaptor-latest?py=py34&pytest=2.5.2 .. image:: github.png Plugin for py.test to generate allure xml reports - :target: http://pytest-plugs.herokuapp.com/output/pytest-allure-adaptor-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-allure-adaptor-latest?py=py34&pytest=2.5.2 :target: https://github.com/allure-framework/allure-python - `pytest-bdd-2.1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bdd-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bdd-latest?py=py34&pytest=2.5.2 .. image:: github.png BDD for pytest - :target: http://pytest-plugs.herokuapp.com/output/pytest-bdd-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-bdd-latest?py=py34&pytest=2.5.2 :target: https://github.com/olegpidsadnyi/pytest-bdd - `pytest-beds-0.0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-beds-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-beds-latest?py=py34&pytest=2.5.2 .. image:: github.png Fixtures for testing Google Appengine (GAE) apps - :target: http://pytest-plugs.herokuapp.com/output/pytest-beds-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-beds-latest?py=py34&pytest=2.5.2 :target: https://github.com/kaste/pytest-beds - `pytest-bench-0.2.5 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bench-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bench-latest?py=py34&pytest=2.5.2 .. image:: github.png Benchmark utility that plugs into pytest. - :target: http://pytest-plugs.herokuapp.com/output/pytest-bench-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-bench-latest?py=py34&pytest=2.5.2 :target: http://github.com/concordusapps/pytest-bench - `pytest-blockage-0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-blockage-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-blockage-latest?py=py34&pytest=2.5.2 .. image:: github.png Disable network requests during a test run. - :target: http://pytest-plugs.herokuapp.com/output/pytest-blockage-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-blockage-latest?py=py34&pytest=2.5.2 :target: https://github.com/rob-b/pytest-blockage - `pytest-browsermob-proxy-0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-browsermob-proxy-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-browsermob-proxy-latest?py=py34&pytest=2.5.2 .. image:: github.png BrowserMob proxy plugin for py.test. - :target: http://pytest-plugs.herokuapp.com/output/pytest-browsermob-proxy-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-browsermob-proxy-latest?py=py34&pytest=2.5.2 :target: https://github.com/davehunt/pytest-browsermob-proxy - `pytest-bugzilla-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bugzilla-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bugzilla-latest?py=py34&pytest=2.5.2 .. image:: github.png py.test bugzilla integration plugin - :target: http://pytest-plugs.herokuapp.com/output/pytest-bugzilla-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-bugzilla-latest?py=py34&pytest=2.5.2 :target: http://github.com/nibrahim/pytest_bugzilla - `pytest-cache-1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-cache-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-cache-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png pytest plugin with mechanisms for caching across test runs - :target: http://pytest-plugs.herokuapp.com/output/pytest-cache-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-cache-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/hpk42/pytest-cache/ - `pytest-capturelog-0.7 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-capturelog-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-capturelog-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png py.test plugin to capture log messages - :target: http://pytest-plugs.herokuapp.com/output/pytest-capturelog-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-capturelog-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/memedough/pytest-capturelog/overview - `pytest-codecheckers-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-codecheckers-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-codecheckers-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png pytest plugin to add source code sanity checks (pep8 and friends) - :target: http://pytest-plugs.herokuapp.com/output/pytest-codecheckers-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-codecheckers-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/RonnyPfannschmidt/pytest-codecheckers/ - `pytest-contextfixture-0.1.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-contextfixture-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-contextfixture-latest?py=py34&pytest=2.5.2 .. image:: github.png Define pytest fixtures as context managers. - :target: http://pytest-plugs.herokuapp.com/output/pytest-contextfixture-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-contextfixture-latest?py=py34&pytest=2.5.2 :target: http://github.com/pelme/pytest-contextfixture/ - `pytest-couchdbkit-0.5.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-couchdbkit-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-couchdbkit-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png py.test extension for per-test couchdb databases using couchdbkit - :target: http://pytest-plugs.herokuapp.com/output/pytest-couchdbkit-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-couchdbkit-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/RonnyPfannschmidt/pytest-couchdbkit - `pytest-cov-1.6 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-cov-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-cov-latest?py=py34&pytest=2.5.2 .. image:: github.png py.test plugin for coverage reporting with support for both centralised and distributed testing, including subprocesses and multiprocessing - :target: http://pytest-plugs.herokuapp.com/output/pytest-cov-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-cov-latest?py=py34&pytest=2.5.2 :target: https://github.com/schlamar/pytest-cov - `pytest-dbfixtures-0.4.20 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-dbfixtures-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-dbfixtures-latest?py=py34&pytest=2.5.2 .. image:: github.png Databases fixtures plugin for py.test. - :target: http://pytest-plugs.herokuapp.com/output/pytest-dbfixtures-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-dbfixtures-latest?py=py34&pytest=2.5.2 :target: https://github.com/ClearcodeHQ/pytest-dbfixtures - `pytest-dbus-notification-1.0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-dbus-notification-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-dbus-notification-latest?py=py34&pytest=2.5.2 .. image:: github.png D-BUS notifications for pytest results. - :target: http://pytest-plugs.herokuapp.com/output/pytest-dbus-notification-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-dbus-notification-latest?py=py34&pytest=2.5.2 :target: https://github.com/bmathieu33/pytest-dbus-notification - `pytest-diffeo-0.1.7 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-diffeo-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-diffeo-latest?py=py34&pytest=2.5.2 .. image:: github.png Common py.test support for Diffeo packages - :target: http://pytest-plugs.herokuapp.com/output/pytest-diffeo-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-diffeo-latest?py=py34&pytest=2.5.2 :target: https://github.com/diffeo/pytest-diffeo - `pytest-django-2.6.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-latest?py=py34&pytest=2.5.2 `link `_ A Django plugin for py.test. - :target: http://pytest-plugs.herokuapp.com/output/pytest-django-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-django-latest?py=py34&pytest=2.5.2 - `pytest-django-haystack-0.1.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-haystack-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-haystack-latest?py=py34&pytest=2.5.2 .. image:: github.png Cleanup your Haystack indexes between tests - :target: http://pytest-plugs.herokuapp.com/output/pytest-django-haystack-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-django-haystack-latest?py=py34&pytest=2.5.2 :target: http://github.com/rouge8/pytest-django-haystack - `pytest-django-lite-0.1.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-lite-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-lite-latest?py=py34&pytest=2.5.2 .. image:: github.png The bare minimum to integrate py.test with Django. - :target: http://pytest-plugs.herokuapp.com/output/pytest-django-lite-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-django-lite-latest?py=py34&pytest=2.5.2 :target: https://github.com/dcramer/pytest-django-lite - `pytest-eradicate-0.0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-eradicate-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-eradicate-latest?py=py34&pytest=2.5.2 .. image:: github.png pytest plugin to check for commented out code - :target: http://pytest-plugs.herokuapp.com/output/pytest-eradicate-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-eradicate-latest?py=py34&pytest=2.5.2 :target: https://github.com/spil-johan/pytest-eradicate - `pytest-figleaf-1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-figleaf-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-figleaf-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png py.test figleaf coverage plugin - :target: http://pytest-plugs.herokuapp.com/output/pytest-figleaf-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-figleaf-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/hpk42/pytest-figleaf - `pytest-flakes-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-flakes-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-flakes-latest?py=py34&pytest=2.5.2 .. image:: github.png pytest plugin to check source code with pyflakes - :target: http://pytest-plugs.herokuapp.com/output/pytest-flakes-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-flakes-latest?py=py34&pytest=2.5.2 :target: https://github.com/fschulze/pytest-flakes - `pytest-greendots-0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-greendots-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-greendots-latest?py=py34&pytest=2.5.2 ? Green progress dots - :target: http://pytest-plugs.herokuapp.com/output/pytest-greendots-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-greendots-latest?py=py34&pytest=2.5.2 - `pytest-growl-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-growl-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-growl-latest?py=py34&pytest=2.5.2 ? Growl notifications for pytest results. - :target: http://pytest-plugs.herokuapp.com/output/pytest-growl-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-growl-latest?py=py34&pytest=2.5.2 - `pytest-httpbin-0.0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-httpbin-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-httpbin-latest?py=py34&pytest=2.5.2 .. image:: github.png A pytest plugin for including a httpbin server in your tests - :target: http://pytest-plugs.herokuapp.com/output/pytest-httpbin-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-httpbin-latest?py=py34&pytest=2.5.2 :target: https://github.com/kevin1024/pytest-httpbin - `pytest-httpretty-0.2.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-httpretty-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-httpretty-latest?py=py34&pytest=2.5.2 .. image:: github.png A thin wrapper of HTTPretty for pytest - :target: http://pytest-plugs.herokuapp.com/output/pytest-httpretty-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-httpretty-latest?py=py34&pytest=2.5.2 :target: http://github.com/papaeye/pytest-httpretty - `pytest-incremental-0.3.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-incremental-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-incremental-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png an incremental test runner (pytest plugin) - :target: http://pytest-plugs.herokuapp.com/output/pytest-incremental-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-incremental-latest?py=py34&pytest=2.5.2 :target: https://bitbucket.org/schettino72/pytest-incremental - `pytest-instafail-0.2.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-instafail-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-instafail-latest?py=py34&pytest=2.5.2 .. image:: github.png py.test plugin to show failures instantly - :target: http://pytest-plugs.herokuapp.com/output/pytest-instafail-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-instafail-latest?py=py34&pytest=2.5.2 :target: https://github.com/jpvanhal/pytest-instafail - `pytest-ipdb-0.1-prerelease `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-ipdb-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-ipdb-latest?py=py34&pytest=2.5.2 .. image:: github.png A py.test plug-in to enable drop to ipdb debugger on test failure. - :target: http://pytest-plugs.herokuapp.com/output/pytest-ipdb-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-ipdb-latest?py=py34&pytest=2.5.2 :target: https://github.com/mverteuil/pytest-ipdb - `pytest-jira-0.01 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-jira-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-jira-latest?py=py34&pytest=2.5.2 .. image:: github.png py.test JIRA integration plugin, using markers - :target: http://pytest-plugs.herokuapp.com/output/pytest-jira-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-jira-latest?py=py34&pytest=2.5.2 :target: http://github.com/jlaska/pytest_jira - `pytest-knows-0.1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-knows-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-knows-latest?py=py34&pytest=2.5.2 .. image:: github.png A pytest plugin that can automaticly skip test case based on dependence info calculated by trace - :target: http://pytest-plugs.herokuapp.com/output/pytest-knows-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-knows-latest?py=py34&pytest=2.5.2 :target: https://github.com/mapix/ptknows - `pytest-konira-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-konira-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-konira-latest?py=py34&pytest=2.5.2 .. image:: github.png Run Konira DSL tests with py.test - :target: http://pytest-plugs.herokuapp.com/output/pytest-konira-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-konira-latest?py=py34&pytest=2.5.2 :target: http://github.com/alfredodeza/pytest-konira - `pytest-localserver-0.3.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-localserver-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-localserver-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png py.test plugin to test server connections locally. - :target: http://pytest-plugs.herokuapp.com/output/pytest-localserver-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-localserver-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/basti/pytest-localserver/ - `pytest-marker-bugzilla-0.06 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-marker-bugzilla-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-marker-bugzilla-latest?py=py34&pytest=2.5.2 .. image:: github.png py.test bugzilla integration plugin, using markers - :target: http://pytest-plugs.herokuapp.com/output/pytest-marker-bugzilla-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-marker-bugzilla-latest?py=py34&pytest=2.5.2 :target: http://github.com/eanxgeek/pytest_marker_bugzilla - `pytest-markfiltration-0.8 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-markfiltration-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-markfiltration-latest?py=py34&pytest=2.5.2 .. image:: github.png UNKNOWN - :target: http://pytest-plugs.herokuapp.com/output/pytest-markfiltration-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-markfiltration-latest?py=py34&pytest=2.5.2 :target: https://github.com/adamgoucher/pytest-markfiltration - `pytest-marks-0.4 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-marks-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-marks-latest?py=py34&pytest=2.5.2 .. image:: github.png UNKNOWN - :target: http://pytest-plugs.herokuapp.com/output/pytest-marks-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-marks-latest?py=py34&pytest=2.5.2 :target: https://github.com/adamgoucher/pytest-marks - `pytest-monkeyplus-1.1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-monkeyplus-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-monkeyplus-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png pytest's monkeypatch subclass with extra functionalities - :target: http://pytest-plugs.herokuapp.com/output/pytest-monkeyplus-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-monkeyplus-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/hsoft/pytest-monkeyplus/ - `pytest-mozwebqa-1.1.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-mozwebqa-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-mozwebqa-latest?py=py34&pytest=2.5.2 .. image:: github.png Mozilla WebQA plugin for py.test. - :target: http://pytest-plugs.herokuapp.com/output/pytest-mozwebqa-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-mozwebqa-latest?py=py34&pytest=2.5.2 :target: https://github.com/davehunt/pytest-mozwebqa - `pytest-oerp-0.2.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-oerp-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-oerp-latest?py=py34&pytest=2.5.2 .. image:: github.png pytest plugin to test OpenERP modules - :target: http://pytest-plugs.herokuapp.com/output/pytest-oerp-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-oerp-latest?py=py34&pytest=2.5.2 :target: http://github.com/santagada/pytest-oerp/ - `pytest-ordering-0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-ordering-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-ordering-latest?py=py34&pytest=2.5.2 .. image:: github.png pytest plugin to run your tests in a specific order - :target: http://pytest-plugs.herokuapp.com/output/pytest-ordering-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-ordering-latest?py=py34&pytest=2.5.2 :target: https://github.com/ftobia/pytest-ordering - `pytest-osxnotify-0.1.4 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-osxnotify-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-osxnotify-latest?py=py34&pytest=2.5.2 .. image:: github.png OS X notifications for py.test results. - :target: http://pytest-plugs.herokuapp.com/output/pytest-osxnotify-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-osxnotify-latest?py=py34&pytest=2.5.2 :target: https://github.com/dbader/pytest-osxnotify - `pytest-paste-config-0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-paste-config-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-paste-config-latest?py=py34&pytest=2.5.2 ? Allow setting the path to a paste config file - :target: http://pytest-plugs.herokuapp.com/output/pytest-paste-config-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-paste-config-latest?py=py34&pytest=2.5.2 - `pytest-pep8-1.0.6 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pep8-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pep8-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png pytest plugin to check PEP8 requirements - :target: http://pytest-plugs.herokuapp.com/output/pytest-pep8-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-pep8-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/hpk42/pytest-pep8/ - `pytest-poo-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-poo-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-poo-latest?py=py34&pytest=2.5.2 .. image:: github.png Visualize your crappy tests - :target: http://pytest-plugs.herokuapp.com/output/pytest-poo-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-poo-latest?py=py34&pytest=2.5.2 :target: http://github.com/pelme/pytest-poo - `pytest-pydev-0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pydev-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pydev-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png py.test plugin to connect to a remote debug server with PyDev or PyCharm. - :target: http://pytest-plugs.herokuapp.com/output/pytest-pydev-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-pydev-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/basti/pytest-pydev/ - `pytest-pythonpath-0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pythonpath-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pythonpath-latest?py=py34&pytest=2.5.2 .. image:: github.png pytest plugin for adding to the PYTHONPATH from command line or configs. - :target: http://pytest-plugs.herokuapp.com/output/pytest-pythonpath-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-pythonpath-latest?py=py34&pytest=2.5.2 :target: https://github.com/bigsassy/pytest-pythonpath - `pytest-qt-1.1.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-qt-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-qt-latest?py=py34&pytest=2.5.2 .. image:: github.png pytest plugin that adds fixtures for testing Qt (PyQt and PySide) applications. - :target: http://pytest-plugs.herokuapp.com/output/pytest-qt-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-qt-latest?py=py34&pytest=2.5.2 :target: http://github.com/nicoddemus/pytest-qt - `pytest-quickcheck-0.8 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-quickcheck-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-quickcheck-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png pytest plugin to generate random data inspired by QuickCheck - :target: http://pytest-plugs.herokuapp.com/output/pytest-quickcheck-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-quickcheck-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/t2y/pytest-quickcheck/ - `pytest-rage-0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-rage-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-rage-latest?py=py34&pytest=2.5.2 .. image:: github.png pytest plugin to implement PEP712 - :target: http://pytest-plugs.herokuapp.com/output/pytest-rage-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-rage-latest?py=py34&pytest=2.5.2 :target: http://github.com/santagada/pytest-rage/ - `pytest-raisesregexp-1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-raisesregexp-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-raisesregexp-latest?py=py34&pytest=2.5.2 .. image:: github.png Simple pytest plugin to look for regex in Exceptions - :target: http://pytest-plugs.herokuapp.com/output/pytest-raisesregexp-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-raisesregexp-latest?py=py34&pytest=2.5.2 :target: https://github.com/Walkman/pytest_raisesregexp - `pytest-random-0.02 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-random-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-random-latest?py=py34&pytest=2.5.2 .. image:: github.png py.test plugin to randomize tests - :target: http://pytest-plugs.herokuapp.com/output/pytest-random-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-random-latest?py=py34&pytest=2.5.2 :target: https://github.com/klrmn/pytest-random - `pytest-rerunfailures-0.05 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-rerunfailures-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-rerunfailures-latest?py=py34&pytest=2.5.2 .. image:: github.png py.test plugin to re-run tests to eliminate flakey failures - :target: http://pytest-plugs.herokuapp.com/output/pytest-rerunfailures-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-rerunfailures-latest?py=py34&pytest=2.5.2 :target: https://github.com/klrmn/pytest-rerunfailures - `pytest-runfailed-0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-runfailed-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-runfailed-latest?py=py34&pytest=2.5.2 .. image:: github.png implement a --failed option for pytest - :target: http://pytest-plugs.herokuapp.com/output/pytest-runfailed-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-runfailed-latest?py=py34&pytest=2.5.2 :target: http://github.com/dmerejkowsky/pytest-runfailed - `pytest-runner-2.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-runner-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-runner-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png UNKNOWN - :target: http://pytest-plugs.herokuapp.com/output/pytest-runner-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-runner-latest?py=py34&pytest=2.5.2 :target: https://bitbucket.org/jaraco/pytest-runner - `pytest-splinter-1.0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-splinter-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-splinter-latest?py=py34&pytest=2.5.2 .. image:: github.png Splinter subplugin for Pytest BDD plugin - :target: http://pytest-plugs.herokuapp.com/output/pytest-splinter-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-splinter-latest?py=py34&pytest=2.5.2 :target: https://github.com/paylogic/pytest-splinter - `pytest-sugar-0.3.4 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-sugar-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-sugar-latest?py=py34&pytest=2.5.2 .. image:: github.png py.test is a plugin for py.test that changes the default look and feel of py.test (e.g. progressbar, show tests that fail instantly). - :target: http://pytest-plugs.herokuapp.com/output/pytest-sugar-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-sugar-latest?py=py34&pytest=2.5.2 :target: https://github.com/Frozenball/pytest-sugar - `pytest-timeout-0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-timeout-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-timeout-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png pytest plugin to abort tests after a timeout - :target: http://pytest-plugs.herokuapp.com/output/pytest-timeout-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-timeout-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/flub/pytest-timeout/ - `pytest-twisted-1.5 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-twisted-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-twisted-latest?py=py34&pytest=2.5.2 .. image:: github.png A twisted plugin for py.test. - :target: http://pytest-plugs.herokuapp.com/output/pytest-twisted-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-twisted-latest?py=py34&pytest=2.5.2 :target: https://github.com/schmir/pytest-twisted - `pytest-xdist-1.10 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-xdist-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-xdist-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png py.test xdist plugin for distributed testing and loop-on-failing modes - :target: http://pytest-plugs.herokuapp.com/output/pytest-xdist-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-xdist-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/hpk42/pytest-xdist - `pytest-xprocess-0.8 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-xprocess-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-xprocess-latest?py=py34&pytest=2.5.2 .. image:: bitbucket.png pytest plugin to manage external processes across test runs - :target: http://pytest-plugs.herokuapp.com/output/pytest-xprocess-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-xprocess-latest?py=py34&pytest=2.5.2 :target: http://bitbucket.org/hpk42/pytest-xprocess/ - `pytest-yamlwsgi-0.6 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-yamlwsgi-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-yamlwsgi-latest?py=py34&pytest=2.5.2 ? Run tests against wsgi apps defined in yaml - :target: http://pytest-plugs.herokuapp.com/output/pytest-yamlwsgi-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-yamlwsgi-latest?py=py34&pytest=2.5.2 - `pytest-zap-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-zap-latest?py=py27&pytest=2.5.2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-zap-latest?py=py34&pytest=2.5.2 .. image:: github.png OWASP ZAP plugin for py.test. - :target: http://pytest-plugs.herokuapp.com/output/pytest-zap-latest?py=py27&pytest=2.5.2 :target: http://pytest-plugs.herokuapp.com/output/pytest-zap-latest?py=py34&pytest=2.5.2 :target: https://github.com/davehunt/pytest-zap +========================================================================================== ================================================================================================================= ================================================================================================================= ========================================================================= ============================================================================================================================================= + Name Py27 Py34 Repo Summary +========================================================================================== ================================================================================================================= ================================================================================================================= ========================================================================= ============================================================================================================================================= + `pytest-allure-adaptor-1.3.8 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-allure-adaptor-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-allure-adaptor-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Plugin for py.test to generate allure xml reports + :target: http://pytest-plugs.herokuapp.com/output/pytest-allure-adaptor-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-allure-adaptor-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/allure-framework/allure-python + `pytest-bdd-2.1.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bdd-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bdd-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png BDD for pytest + :target: http://pytest-plugs.herokuapp.com/output/pytest-bdd-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-bdd-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/olegpidsadnyi/pytest-bdd + `pytest-beds-0.0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-beds-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-beds-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Fixtures for testing Google Appengine (GAE) apps + :target: http://pytest-plugs.herokuapp.com/output/pytest-beds-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-beds-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/kaste/pytest-beds + `pytest-bench-0.2.5 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bench-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bench-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Benchmark utility that plugs into pytest. + :target: http://pytest-plugs.herokuapp.com/output/pytest-bench-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-bench-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/concordusapps/pytest-bench + `pytest-blockage-0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-blockage-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-blockage-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Disable network requests during a test run. + :target: http://pytest-plugs.herokuapp.com/output/pytest-blockage-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-blockage-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/rob-b/pytest-blockage + `pytest-browsermob-proxy-0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-browsermob-proxy-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-browsermob-proxy-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png BrowserMob proxy plugin for py.test. + :target: http://pytest-plugs.herokuapp.com/output/pytest-browsermob-proxy-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-browsermob-proxy-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/davehunt/pytest-browsermob-proxy + `pytest-bugzilla-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bugzilla-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-bugzilla-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png py.test bugzilla integration plugin + :target: http://pytest-plugs.herokuapp.com/output/pytest-bugzilla-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-bugzilla-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/nibrahim/pytest_bugzilla + `pytest-cache-1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-cache-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-cache-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png pytest plugin with mechanisms for caching across test runs + :target: http://pytest-plugs.herokuapp.com/output/pytest-cache-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-cache-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/hpk42/pytest-cache/ + `pytest-capturelog-0.7 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-capturelog-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-capturelog-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png py.test plugin to capture log messages + :target: http://pytest-plugs.herokuapp.com/output/pytest-capturelog-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-capturelog-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/memedough/pytest-capturelog/overview + `pytest-codecheckers-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-codecheckers-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-codecheckers-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png pytest plugin to add source code sanity checks (pep8 and friends) + :target: http://pytest-plugs.herokuapp.com/output/pytest-codecheckers-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-codecheckers-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/RonnyPfannschmidt/pytest-codecheckers/ + `pytest-config-0.0.9 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-config-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-config-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Base configurations and utilities for developing + your Python project test suite. + :target: http://pytest-plugs.herokuapp.com/output/pytest-config-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-config-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/buzzfeed/pytest_config + `pytest-contextfixture-0.1.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-contextfixture-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-contextfixture-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Define pytest fixtures as context managers. + :target: http://pytest-plugs.herokuapp.com/output/pytest-contextfixture-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-contextfixture-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/pelme/pytest-contextfixture/ + `pytest-couchdbkit-0.5.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-couchdbkit-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-couchdbkit-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png py.test extension for per-test couchdb databases using couchdbkit + :target: http://pytest-plugs.herokuapp.com/output/pytest-couchdbkit-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-couchdbkit-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/RonnyPfannschmidt/pytest-couchdbkit + `pytest-cov-1.7.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-cov-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-cov-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png py.test plugin for coverage reporting with support for both centralised and distributed testing, including subprocesses and multiprocessing + :target: http://pytest-plugs.herokuapp.com/output/pytest-cov-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-cov-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/schlamar/pytest-cov + `pytest-dbfixtures-0.4.20 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-dbfixtures-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-dbfixtures-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Databases fixtures plugin for py.test. + :target: http://pytest-plugs.herokuapp.com/output/pytest-dbfixtures-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-dbfixtures-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/ClearcodeHQ/pytest-dbfixtures + `pytest-dbus-notification-1.0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-dbus-notification-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-dbus-notification-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png D-BUS notifications for pytest results. + :target: http://pytest-plugs.herokuapp.com/output/pytest-dbus-notification-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-dbus-notification-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/bmathieu33/pytest-dbus-notification + `pytest-diffeo-0.1.7 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-diffeo-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-diffeo-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Common py.test support for Diffeo packages + :target: http://pytest-plugs.herokuapp.com/output/pytest-diffeo-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-diffeo-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/diffeo/pytest-diffeo + `pytest-django-2.6.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-latest?py=py34&pytest=2.6.0.dev2 `link `_ A Django plugin for py.test. + :target: http://pytest-plugs.herokuapp.com/output/pytest-django-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-django-latest?py=py34&pytest=2.6.0.dev2 + `pytest-django-haystack-0.1.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-haystack-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-haystack-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Cleanup your Haystack indexes between tests + :target: http://pytest-plugs.herokuapp.com/output/pytest-django-haystack-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-django-haystack-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/rouge8/pytest-django-haystack + `pytest-django-lite-0.1.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-lite-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-django-lite-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png The bare minimum to integrate py.test with Django. + :target: http://pytest-plugs.herokuapp.com/output/pytest-django-lite-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-django-lite-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/dcramer/pytest-django-lite + `pytest-eradicate-0.0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-eradicate-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-eradicate-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png pytest plugin to check for commented out code + :target: http://pytest-plugs.herokuapp.com/output/pytest-eradicate-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-eradicate-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/spil-johan/pytest-eradicate + `pytest-figleaf-1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-figleaf-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-figleaf-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png py.test figleaf coverage plugin + :target: http://pytest-plugs.herokuapp.com/output/pytest-figleaf-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-figleaf-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/hpk42/pytest-figleaf + `pytest-flakes-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-flakes-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-flakes-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png pytest plugin to check source code with pyflakes + :target: http://pytest-plugs.herokuapp.com/output/pytest-flakes-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-flakes-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/fschulze/pytest-flakes + `pytest-greendots-0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-greendots-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-greendots-latest?py=py34&pytest=2.6.0.dev2 ? Green progress dots + :target: http://pytest-plugs.herokuapp.com/output/pytest-greendots-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-greendots-latest?py=py34&pytest=2.6.0.dev2 + `pytest-growl-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-growl-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-growl-latest?py=py34&pytest=2.6.0.dev2 ? Growl notifications for pytest results. + :target: http://pytest-plugs.herokuapp.com/output/pytest-growl-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-growl-latest?py=py34&pytest=2.6.0.dev2 + `pytest-httpbin-0.0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-httpbin-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-httpbin-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Easily test your HTTP library against a local copy of httpbin + :target: http://pytest-plugs.herokuapp.com/output/pytest-httpbin-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-httpbin-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/kevin1024/pytest-httpbin + `pytest-httpretty-0.2.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-httpretty-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-httpretty-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png A thin wrapper of HTTPretty for pytest + :target: http://pytest-plugs.herokuapp.com/output/pytest-httpretty-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-httpretty-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/papaeye/pytest-httpretty + `pytest-incremental-0.3.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-incremental-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-incremental-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png an incremental test runner (pytest plugin) + :target: http://pytest-plugs.herokuapp.com/output/pytest-incremental-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-incremental-latest?py=py34&pytest=2.6.0.dev2 :target: https://bitbucket.org/schettino72/pytest-incremental + `pytest-instafail-0.2.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-instafail-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-instafail-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png py.test plugin to show failures instantly + :target: http://pytest-plugs.herokuapp.com/output/pytest-instafail-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-instafail-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/jpvanhal/pytest-instafail + `pytest-ipdb-0.1-prerelease `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-ipdb-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-ipdb-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png A py.test plug-in to enable drop to ipdb debugger on test failure. + :target: http://pytest-plugs.herokuapp.com/output/pytest-ipdb-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-ipdb-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/mverteuil/pytest-ipdb + `pytest-jira-0.01 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-jira-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-jira-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png py.test JIRA integration plugin, using markers + :target: http://pytest-plugs.herokuapp.com/output/pytest-jira-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-jira-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/jlaska/pytest_jira + `pytest-knows-0.1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-knows-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-knows-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png A pytest plugin that can automaticly skip test case based on dependence info calculated by trace + :target: http://pytest-plugs.herokuapp.com/output/pytest-knows-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-knows-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/mapix/ptknows + `pytest-konira-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-konira-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-konira-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Run Konira DSL tests with py.test + :target: http://pytest-plugs.herokuapp.com/output/pytest-konira-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-konira-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/alfredodeza/pytest-konira + `pytest-localserver-0.3.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-localserver-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-localserver-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png py.test plugin to test server connections locally. + :target: http://pytest-plugs.herokuapp.com/output/pytest-localserver-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-localserver-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/basti/pytest-localserver/ + `pytest-marker-bugzilla-0.06 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-marker-bugzilla-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-marker-bugzilla-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png py.test bugzilla integration plugin, using markers + :target: http://pytest-plugs.herokuapp.com/output/pytest-marker-bugzilla-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-marker-bugzilla-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/eanxgeek/pytest_marker_bugzilla + `pytest-markfiltration-0.8 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-markfiltration-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-markfiltration-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png UNKNOWN + :target: http://pytest-plugs.herokuapp.com/output/pytest-markfiltration-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-markfiltration-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/adamgoucher/pytest-markfiltration + `pytest-marks-0.4 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-marks-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-marks-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png UNKNOWN + :target: http://pytest-plugs.herokuapp.com/output/pytest-marks-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-marks-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/adamgoucher/pytest-marks + `pytest-monkeyplus-1.1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-monkeyplus-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-monkeyplus-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png pytest's monkeypatch subclass with extra functionalities + :target: http://pytest-plugs.herokuapp.com/output/pytest-monkeyplus-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-monkeyplus-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/hsoft/pytest-monkeyplus/ + `pytest-mozwebqa-1.1.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-mozwebqa-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-mozwebqa-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Mozilla WebQA plugin for py.test. + :target: http://pytest-plugs.herokuapp.com/output/pytest-mozwebqa-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-mozwebqa-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/davehunt/pytest-mozwebqa + `pytest-oerp-0.2.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-oerp-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-oerp-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png pytest plugin to test OpenERP modules + :target: http://pytest-plugs.herokuapp.com/output/pytest-oerp-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-oerp-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/santagada/pytest-oerp/ + `pytest-ordering-0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-ordering-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-ordering-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png pytest plugin to run your tests in a specific order + :target: http://pytest-plugs.herokuapp.com/output/pytest-ordering-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-ordering-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/ftobia/pytest-ordering + `pytest-osxnotify-0.1.4 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-osxnotify-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-osxnotify-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png OS X notifications for py.test results. + :target: http://pytest-plugs.herokuapp.com/output/pytest-osxnotify-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-osxnotify-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/dbader/pytest-osxnotify + `pytest-paste-config-0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-paste-config-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-paste-config-latest?py=py34&pytest=2.6.0.dev2 ? Allow setting the path to a paste config file + :target: http://pytest-plugs.herokuapp.com/output/pytest-paste-config-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-paste-config-latest?py=py34&pytest=2.6.0.dev2 + `pytest-pep8-1.0.6 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pep8-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pep8-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png pytest plugin to check PEP8 requirements + :target: http://pytest-plugs.herokuapp.com/output/pytest-pep8-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-pep8-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/hpk42/pytest-pep8/ + `pytest-poo-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-poo-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-poo-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Visualize your crappy tests + :target: http://pytest-plugs.herokuapp.com/output/pytest-poo-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-poo-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/pelme/pytest-poo + `pytest-pycharm-0.1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pycharm-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pycharm-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Plugin for py.test to enter PyCharm debugger on uncaught exceptions + :target: http://pytest-plugs.herokuapp.com/output/pytest-pycharm-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-pycharm-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/jlubcke/pytest-pycharm + `pytest-pydev-0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pydev-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pydev-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png py.test plugin to connect to a remote debug server with PyDev or PyCharm. + :target: http://pytest-plugs.herokuapp.com/output/pytest-pydev-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-pydev-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/basti/pytest-pydev/ + `pytest-pythonpath-0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pythonpath-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-pythonpath-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png pytest plugin for adding to the PYTHONPATH from command line or configs. + :target: http://pytest-plugs.herokuapp.com/output/pytest-pythonpath-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-pythonpath-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/bigsassy/pytest-pythonpath + `pytest-qt-1.2.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-qt-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-qt-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png pytest support for PyQt and PySide applications + :target: http://pytest-plugs.herokuapp.com/output/pytest-qt-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-qt-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/nicoddemus/pytest-qt + `pytest-quickcheck-0.8 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-quickcheck-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-quickcheck-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png pytest plugin to generate random data inspired by QuickCheck + :target: http://pytest-plugs.herokuapp.com/output/pytest-quickcheck-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-quickcheck-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/t2y/pytest-quickcheck/ + `pytest-rage-0.1 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-rage-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-rage-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png pytest plugin to implement PEP712 + :target: http://pytest-plugs.herokuapp.com/output/pytest-rage-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-rage-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/santagada/pytest-rage/ + `pytest-raisesregexp-1.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-raisesregexp-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-raisesregexp-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Simple pytest plugin to look for regex in Exceptions + :target: http://pytest-plugs.herokuapp.com/output/pytest-raisesregexp-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-raisesregexp-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/Walkman/pytest_raisesregexp + `pytest-random-0.02 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-random-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-random-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png py.test plugin to randomize tests + :target: http://pytest-plugs.herokuapp.com/output/pytest-random-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-random-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/klrmn/pytest-random + `pytest-rerunfailures-0.05 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-rerunfailures-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-rerunfailures-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png py.test plugin to re-run tests to eliminate flakey failures + :target: http://pytest-plugs.herokuapp.com/output/pytest-rerunfailures-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-rerunfailures-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/klrmn/pytest-rerunfailures + `pytest-runfailed-0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-runfailed-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-runfailed-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png implement a --failed option for pytest + :target: http://pytest-plugs.herokuapp.com/output/pytest-runfailed-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-runfailed-latest?py=py34&pytest=2.6.0.dev2 :target: http://github.com/dmerejkowsky/pytest-runfailed + `pytest-runner-2.0 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-runner-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-runner-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png UNKNOWN + :target: http://pytest-plugs.herokuapp.com/output/pytest-runner-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-runner-latest?py=py34&pytest=2.6.0.dev2 :target: https://bitbucket.org/jaraco/pytest-runner + `pytest-spec-0.2.22 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-spec-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-spec-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png pytest plugin to display test execution output like a SPECIFICATION + :target: http://pytest-plugs.herokuapp.com/output/pytest-spec-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-spec-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/pchomik/pytest-spec + `pytest-splinter-1.0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-splinter-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-splinter-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png Splinter subplugin for Pytest BDD plugin + :target: http://pytest-plugs.herokuapp.com/output/pytest-splinter-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-splinter-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/paylogic/pytest-splinter + `pytest-sugar-0.3.4 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-sugar-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-sugar-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png py.test is a plugin for py.test that changes the default look and feel of py.test (e.g. progressbar, show tests that fail instantly). + :target: http://pytest-plugs.herokuapp.com/output/pytest-sugar-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-sugar-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/Frozenball/pytest-sugar + `pytest-timeout-0.3 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-timeout-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-timeout-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png pytest plugin to abort tests after a timeout + :target: http://pytest-plugs.herokuapp.com/output/pytest-timeout-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-timeout-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/flub/pytest-timeout/ + `pytest-twisted-1.5 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-twisted-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-twisted-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png A twisted plugin for py.test. + :target: http://pytest-plugs.herokuapp.com/output/pytest-twisted-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-twisted-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/schmir/pytest-twisted + `pytest-xdist-1.10 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-xdist-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-xdist-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png py.test xdist plugin for distributed testing and loop-on-failing modes + :target: http://pytest-plugs.herokuapp.com/output/pytest-xdist-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-xdist-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/hpk42/pytest-xdist + `pytest-xprocess-0.8 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-xprocess-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-xprocess-latest?py=py34&pytest=2.6.0.dev2 .. image:: bitbucket.png pytest plugin to manage external processes across test runs + :target: http://pytest-plugs.herokuapp.com/output/pytest-xprocess-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-xprocess-latest?py=py34&pytest=2.6.0.dev2 :target: http://bitbucket.org/hpk42/pytest-xprocess/ + `pytest-yamlwsgi-0.6 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-yamlwsgi-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-yamlwsgi-latest?py=py34&pytest=2.6.0.dev2 ? Run tests against wsgi apps defined in yaml + :target: http://pytest-plugs.herokuapp.com/output/pytest-yamlwsgi-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-yamlwsgi-latest?py=py34&pytest=2.6.0.dev2 + `pytest-zap-0.2 `_ .. image:: http://pytest-plugs.herokuapp.com/status/pytest-zap-latest?py=py27&pytest=2.6.0.dev2 .. image:: http://pytest-plugs.herokuapp.com/status/pytest-zap-latest?py=py34&pytest=2.6.0.dev2 .. image:: github.png OWASP ZAP plugin for py.test. + :target: http://pytest-plugs.herokuapp.com/output/pytest-zap-latest?py=py27&pytest=2.6.0.dev2 :target: http://pytest-plugs.herokuapp.com/output/pytest-zap-latest?py=py34&pytest=2.6.0.dev2 :target: https://github.com/davehunt/pytest-zap -========================================================================================== ============================================================================================================ ============================================================================================================ ========================================================================= ============================================================================================================================================= +========================================================================================== ================================================================================================================= ================================================================================================================= ========================================================================= ============================================================================================================================================= -*(Updated on 2014-06-10)* +*(Updated on 2014-07-08)* 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 Sun Jul 13 07:11:00 2014 From: issues-reply at bitbucket.org (Tom Prince) Date: Sun, 13 Jul 2014 05:11:00 -0000 Subject: [Pytest-commit] Issue #539: `py.test --doctest-modules` fails if `python setup.py buld` has been run. (hpk42/pytest) Message-ID: <20140713051100.7841.9982@app13.ash-private.bitbucket.org> New issue 539: `py.test --doctest-modules` fails if `python setup.py buld` has been run. https://bitbucket.org/hpk42/pytest/issue/539/pytest-doctest-modules-fails-if-python Tom Prince: py.test will recurse into the distutils build directory looking for modules to run doc-tests for, but will try to import them from the root directory, leading to a mismatch between files: ``` ________________________________________________________ ERROR collecting service_identity/_common.py _________________________________________________________ ../../dev/tmp-111d346bc44a488b/lib/python2.7/site-packages/py/_path/local.py:639: in pyimport > raise self.ImportMismatchError(modname, modfile, self) E ImportMismatchError: ('service_identity._common', '/Users/cougar/src/service_identity/build/lib/service_identity/_common.py', local('/Users/cougar/src/service_identity/service_identity/_common.py')) ``` From commits-noreply at bitbucket.org Mon Jul 14 09:17:14 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 14 Jul 2014 07:17:14 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: with pypy this tests leaks one FD but it's probably a residual effect of the testing machinery and Pypy's lazy GC. Message-ID: <20140714071714.15677.73068@app05.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/d75e511c62f9/ Changeset: d75e511c62f9 User: hpk42 Date: 2014-07-14 09:17:04 Summary: with pypy this tests leaks one FD but it's probably a residual effect of the testing machinery and Pypy's lazy GC. Affected #: 1 file diff -r 78792abae40b6b4e4d077ccf62389e8aee9649ba -r d75e511c62f93da3c1c024b9972e81c7d935fc9b testing/test_doctest.py --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -80,6 +80,8 @@ assert isinstance(items[0].parent, DoctestModule) assert items[0].parent is items[1].parent + @pytest.mark.xfail('hasattr(sys, "pypy_version_info")', reason= + "pypy leaks one FD") def test_simple_doctestfile(self, testdir): p = testdir.maketxtfile(test_doc=""" >>> x = 1 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 Mon Jul 14 15:14:50 2014 From: issues-reply at bitbucket.org (Ionel Maries Cristian) Date: Mon, 14 Jul 2014 13:14:50 -0000 Subject: [Pytest-commit] Issue #540: Encoding failure in doctest error handling on py3/windows (hpk42/pytest) Message-ID: <20140714131450.4323.68173@app11.ash-private.bitbucket.org> New issue 540: Encoding failure in doctest error handling on py3/windows https://bitbucket.org/hpk42/pytest/issue/540/encoding-failure-in-doctest-error-handling Ionel Maries Cristian: I get this sort of failure: ``` C:\Users\ionel_000\Projects\asdfasdf>tox py34 create: C:\Users\ionel_000\Projects\asdfasdf\.tox\py34 py34 installdeps: pytest py34 runtests: PYTHONHASHSEED='922087378' py34 runtests: commands[0] | py.test -vv ============================= test session starts ============================= platform win32 -- Python 3.4.1 -- py-1.4.20 -- pytest-2.5.2 -- C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\Scripts\python.exe collected 1 items unicode.rst: [doctest] unicode.rst INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\main.py", line 81, in wrap_session INTERNALERROR> doit(config, session) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\main.py", line 118, in _main INTERNALERROR> config.hook.pytest_runtestloop(session=session) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\core.py", line 377, in __call__ INTERNALERROR> return self._docall(methods, kwargs) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\core.py", line 388, in _docall INTERNALERROR> res = mc.execute() INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\core.py", line 289, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\main.py", line 138, in pytest_runtestloop INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\core.py", line 377, in __call__ INTERNALERROR> return self._docall(methods, kwargs) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\core.py", line 388, in _docall INTERNALERROR> res = mc.execute() INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\core.py", line 289, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\runner.py", line 64, in pytest_runtest_protocol INTERNALERROR> runtestprotocol(item, nextitem=nextitem) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\runner.py", line 74, in runtestprotocol INTERNALERROR> reports.append(call_and_report(item, "call", log)) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\runner.py", line 110, in call_and_report INTERNALERROR> report = hook.pytest_runtest_makereport(item=item, call=call) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\main.py", line 162, in call_matching_hooks INTERNALERROR> return hookmethod.pcall(plugins, **kwargs) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\core.py", line 381, in pcall INTERNALERROR> return self._docall(methods, kwargs) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\core.py", line 388, in _docall INTERNALERROR> res = mc.execute() INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\core.py", line 289, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\capture.py", line 246, in pytest_runtest_makereport INTERNALERROR> rep = __multicall__.execute() INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\core.py", line 289, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\runner.py", line 208, in pytest_runtest_makereport INTERNALERROR> longrepr = item.repr_failure(excinfo) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\_pytest\doctest.py", line 61, in repr_failure INTERNALERROR> filelines = py.path.local(filename).readlines(cr=0) INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\py\_path\common.py", line 134, in readlines INTERNALERROR> content = self.read('rU') INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\site-packages\py\_path\common.py", line 126, in read INTERNALERROR> return f.read() INTERNALERROR> File "C:\Users\ionel_000\Projects\asdfasdf\.tox\py34\lib\encodings\cp1250.py", line 23, in decode INTERNALERROR> return codecs.charmap_decode(input,self.errors,decoding_table)[0] INTERNALERROR> UnicodeDecodeError: 'charmap' codec can't decode byte 0x83 in position 8: character maps to ============================== in 0.05 seconds =============================== ERROR: InvocationError: 'C:\\Users\\ionel_000\\Projects\\asdfasdf\\.tox\\py34\\Scripts\\py.test.EXE -vv' ___________________________________ summary ___________________________________ ERROR: py34: commands failed ``` Testcase: https://gist.github.com/ionelmc/4a56e2467aeb6d228ebe This fails because the unicode.rst file is utf8 while the windows' default encoding is some code page. Also tested with tip from py/pytest - still reproduces. I've glossed over the code but the fix involves adding "encoding awareness" all over in the `py` module. What to do ? From commits-noreply at bitbucket.org Mon Jul 14 22:01:01 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 14 Jul 2014 20:01:01 -0000 Subject: [Pytest-commit] commit/py: 2 new changesets Message-ID: <20140714200101.11429.53612@app05.ash-private.bitbucket.org> 2 new commits in py: https://bitbucket.org/hpk42/py/commits/d63b6afbc3c9/ Changeset: d63b6afbc3c9 User: hpk42 Date: 2014-07-14 15:09:48 Summary: we have to clear up some global state. Affected #: 1 file diff -r a990113bb086420f36489082fdc5220f46c6f8d0 -r d63b6afbc3c9af45d7755ca06bb2a1537f6b4683 testing/process/test_forkedfunc.py --- a/testing/process/test_forkedfunc.py +++ b/testing/process/test_forkedfunc.py @@ -1,7 +1,13 @@ +import pytest import py, sys, os pytestmark = py.test.mark.skipif("not hasattr(os, 'fork')") + at pytest.fixture(autouse=True) +def clear_forkedfunc(monkeypatch): + monkeypatch.setattr(py.process.ForkedFunc, "_on_start", []) + monkeypatch.setattr(py.process.ForkedFunc, "_on_exit", []) + def test_waitfinish_removes_tempdir(): ff = py.process.ForkedFunc(boxf1) assert ff.tempdir.check() https://bitbucket.org/hpk42/py/commits/5e48016c4a3a/ Changeset: 5e48016c4a3a User: hpk42 Date: 2014-07-14 14:55:06 Summary: win32: py.path.local.sysfind(name) will preferrably return files with extensions so that if "X" and "X.bat" or "X.exe" is on the PATH, one of the latter two will be returned. Affected #: 5 files diff -r d63b6afbc3c9af45d7755ca06bb2a1537f6b4683 -r 5e48016c4a3af8e7358a1267d33d021e71765bed CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -1.4.X +1.4.21 ================================================== - ForkedFunc now has class-level register_on_start/on_exit() @@ -14,6 +14,10 @@ on a per-entry basis such that a caller can force entries to be isplayed as short or long entries. +- win32: py.path.local.sysfind(name) will preferrably return files with + extensions so that if "X" and "X.bat" or "X.exe" is on the PATH, + one of the latter two will be returned. + 1.4.20 ================================================== diff -r d63b6afbc3c9af45d7755ca06bb2a1537f6b4683 -r 5e48016c4a3af8e7358a1267d33d021e71765bed py/__init__.py --- a/py/__init__.py +++ b/py/__init__.py @@ -8,7 +8,7 @@ (c) Holger Krekel and others, 2004-2013 """ -__version__ = '1.4.21.dev3' +__version__ = '1.4.21' from py import _apipkg diff -r d63b6afbc3c9af45d7755ca06bb2a1537f6b4683 -r 5e48016c4a3af8e7358a1267d33d021e71765bed py/_path/local.py --- a/py/_path/local.py +++ b/py/_path/local.py @@ -700,9 +700,10 @@ for path in paths] else: paths = py.std.os.environ['PATH'].split(':') - tryadd = [''] + tryadd = [] if iswin32: tryadd += os.environ['PATHEXT'].split(os.pathsep) + tryadd.append("") for x in paths: for addext in tryadd: diff -r d63b6afbc3c9af45d7755ca06bb2a1537f6b4683 -r 5e48016c4a3af8e7358a1267d33d021e71765bed setup.py --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ name='py', description='library with cross-python path, ini-parsing, io, code, log facilities', long_description = open('README.txt').read(), - version='1.4.21.dev3', + version='1.4.21', url='http://pylib.readthedocs.org/', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff -r d63b6afbc3c9af45d7755ca06bb2a1537f6b4683 -r 5e48016c4a3af8e7358a1267d33d021e71765bed testing/path/test_local.py --- a/testing/path/test_local.py +++ b/testing/path/test_local.py @@ -295,6 +295,14 @@ class TestExecutionOnWindows: pytestmark = win32only + def test_sysfind_bat_exe_before(self, tmpdir, monkeypatch): + monkeypatch.setenv("PATH", str(tmpdir), prepend=os.pathsep) + tmpdir.ensure("hello") + h = tmpdir.ensure("hello.bat") + x = py.path.local.sysfind("hello") + assert x == h + + class TestExecution: pytestmark = skiponwin32 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 Mon Jul 14 22:19:47 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 14 Jul 2014 20:19:47 -0000 Subject: [Pytest-commit] commit/py: hpk42: Added tag 1.4.21 for changeset 5e48016c4a3a Message-ID: <20140714201947.13496.14635@app11.ash-private.bitbucket.org> 1 new commit in py: https://bitbucket.org/hpk42/py/commits/89d472ccb355/ Changeset: 89d472ccb355 User: hpk42 Date: 2014-07-14 22:19:36 Summary: Added tag 1.4.21 for changeset 5e48016c4a3a Affected #: 1 file diff -r 5e48016c4a3af8e7358a1267d33d021e71765bed -r 89d472ccb3556f34f2a039c61f8b0090a8e4e9a2 .hgtags --- a/.hgtags +++ b/.hgtags @@ -54,3 +54,4 @@ c59201105a29801cc858eb9160b7a19791b91a35 1.4.18 284cc172e294d48edc840012e1451c32c3963d92 1.4.19 a3e0626aa0c5aecf271367dc77e476ab216ea3c8 1.4.20 +5e48016c4a3af8e7358a1267d33d021e71765bed 1.4.21 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 Jul 15 10:03:08 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 15 Jul 2014 08:03:08 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20140715080308.1782.94483@app06.ash-private.bitbucket.org> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/e319e464470a/ Changeset: e319e464470a User: hpk42 Date: 2014-07-15 09:53:42 Summary: bump version and release 1.7.2 Affected #: 5 files diff -r 18901cb31482da6c4db6ed312287f115e9ca5a41 -r e319e464470a5885505ab3e1da1a3a7abe5f86e2 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -development +1.7.2 ----------- - fix issue150: parse {posargs} more like we used to do it pre 1.7.0. diff -r 18901cb31482da6c4db6ed312287f115e9ca5a41 -r e319e464470a5885505ab3e1da1a3a7abe5f86e2 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.7.1" +release = version = "1.7.2" # The full version, including alpha/beta/rc tags. # The language for content autogenerated by Sphinx. Refer to documentation diff -r 18901cb31482da6c4db6ed312287f115e9ca5a41 -r e319e464470a5885505ab3e1da1a3a7abe5f86e2 setup.py --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ description='virtualenv-based automation of test activities', long_description=open("README.rst").read(), url='http://tox.testrun.org/', - version='1.7.2.dev1', + version='1.7.2', license='http://opensource.org/licenses/MIT', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel', diff -r 18901cb31482da6c4db6ed312287f115e9ca5a41 -r e319e464470a5885505ab3e1da1a3a7abe5f86e2 tests/test_venv.py --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -584,7 +584,7 @@ mocksession.report.not_expect("warning", "*test command found but not*") monkeypatch.setenv("PATH", str(tmpdir)) x4 = venv.getcommandpath("x", cwd=tmpdir) - assert x4.endswith('/x') + assert x4.endswith(os.sep + 'x') mocksession.report.expect("warning", "*test command found but not*") def test_sethome_only_on_option(newmocksession, monkeypatch): diff -r 18901cb31482da6c4db6ed312287f115e9ca5a41 -r e319e464470a5885505ab3e1da1a3a7abe5f86e2 tox/__init__.py --- a/tox/__init__.py +++ b/tox/__init__.py @@ -1,5 +1,5 @@ # -__version__ = '1.7.2.dev1' +__version__ = '1.7.2' class exception: class Error(Exception): https://bitbucket.org/hpk42/tox/commits/27b38ca7904a/ Changeset: 27b38ca7904a User: hpk42 Date: 2014-07-15 09:53:44 Summary: Added tag 1.7.2 for changeset e319e464470a Affected #: 1 file diff -r e319e464470a5885505ab3e1da1a3a7abe5f86e2 -r 27b38ca7904a514f5b9e51e3570fac218b522737 .hgtags --- a/.hgtags +++ b/.hgtags @@ -17,3 +17,4 @@ 2e580ee6feea934cc2e683635abded27c0de0be9 1.6.1 5b4e536b8d3810c791b742b2a8723c53b8d3d720 1.7.0 c7155565c89d1bb3684c881ca774d921188223a0 1.7.1 +e319e464470a5885505ab3e1da1a3a7abe5f86e2 1.7.2 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 Tue Jul 15 11:26:12 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 15 Jul 2014 09:26:12 -0000 Subject: [Pytest-commit] commit/pytest: 2 new changesets Message-ID: <20140715092612.16085.43812@app13.ash-private.bitbucket.org> 2 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/dda3095c6939/ Changeset: dda3095c6939 Branch: alex_gaynor/marked-pytest-as-being-a-universal-wheel-1405267754279 User: alex_gaynor Date: 2014-07-13 18:09:24 Summary: Marked pytest as being a universal wheel. Affected #: 1 file diff -r 78792abae40b6b4e4d077ccf62389e8aee9649ba -r dda3095c6939ec26044bd5324f6b3bc942f6415e setup.cfg --- a/setup.cfg +++ b/setup.cfg @@ -6,3 +6,5 @@ [upload_sphinx] upload-dir = doc/en/build/html +[wheel] +universal = 1 \ No newline at end of file https://bitbucket.org/hpk42/pytest/commits/2bc0f1714141/ Changeset: 2bc0f1714141 User: hpk42 Date: 2014-07-15 11:26:08 Summary: Merged in alex_gaynor/pytest/alex_gaynor/marked-pytest-as-being-a-universal-wheel-1405267754279 (pull request #179) Marked pytest as being a universal wheel. Affected #: 1 file diff -r d75e511c62f93da3c1c024b9972e81c7d935fc9b -r 2bc0f17141418719af8808f25bcd24d70baa0f03 setup.cfg --- a/setup.cfg +++ b/setup.cfg @@ -6,3 +6,5 @@ [upload_sphinx] upload-dir = doc/en/build/html +[wheel] +universal = 1 \ No newline at end of file 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 Jul 15 11:26:12 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 15 Jul 2014 09:26:12 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Merged in alex_gaynor/pytest/alex_gaynor/marked-pytest-as-being-a-universal-wheel-1405267754279 (pull request #179) Message-ID: <20140715092612.32703.7261@app05.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/2bc0f1714141/ Changeset: 2bc0f1714141 User: hpk42 Date: 2014-07-15 11:26:08 Summary: Merged in alex_gaynor/pytest/alex_gaynor/marked-pytest-as-being-a-universal-wheel-1405267754279 (pull request #179) Marked pytest as being a universal wheel. Affected #: 1 file diff -r d75e511c62f93da3c1c024b9972e81c7d935fc9b -r 2bc0f17141418719af8808f25bcd24d70baa0f03 setup.cfg --- a/setup.cfg +++ b/setup.cfg @@ -6,3 +6,5 @@ [upload_sphinx] upload-dir = doc/en/build/html +[wheel] +universal = 1 \ No newline at end of file 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 Jul 15 22:17:19 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 15 Jul 2014 20:17:19 -0000 Subject: [Pytest-commit] commit/pytest: 4 new changesets Message-ID: <20140715201719.3424.74515@app02.ash-private.bitbucket.org> 4 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/851daff059d5/ Changeset: 851daff059d5 User: wooparadog Date: 2014-04-23 08:50:21 Summary: Also replace `report.longrepr` with `bin_xml_escape`ed skipreason Affected #: 1 file diff -r 229f3213f7a629f547e6b89a20263a41611807a1 -r 851daff059d5fd956fda8d9af50b254d01cd29d8 _pytest/junitxml.py --- a/_pytest/junitxml.py +++ b/_pytest/junitxml.py @@ -162,6 +162,7 @@ filename, lineno, skipreason = report.longrepr if skipreason.startswith("Skipped: "): skipreason = bin_xml_escape(skipreason[9:]) + report.longrepr = filename, lineno, skipreason self.append( Junit.skipped("%s:%s: %s" % report.longrepr, type="pytest.skip", https://bitbucket.org/hpk42/pytest/commits/f3685129dbaa/ Changeset: f3685129dbaa User: wooparadog Date: 2014-04-23 09:38:40 Summary: Use processced skipreason for generating skip Junit node Affected #: 1 file diff -r 851daff059d5fd956fda8d9af50b254d01cd29d8 -r f3685129dbaad82c8e56caf1b03da91bd04e64e4 _pytest/junitxml.py --- a/_pytest/junitxml.py +++ b/_pytest/junitxml.py @@ -162,9 +162,8 @@ filename, lineno, skipreason = report.longrepr if skipreason.startswith("Skipped: "): skipreason = bin_xml_escape(skipreason[9:]) - report.longrepr = filename, lineno, skipreason self.append( - Junit.skipped("%s:%s: %s" % report.longrepr, + Junit.skipped("%s:%s: %s" % (filename, lineno, skipreason), type="pytest.skip", message=skipreason )) https://bitbucket.org/hpk42/pytest/commits/a3ef32bda54e/ Changeset: a3ef32bda54e User: wooparadog Date: 2014-04-24 04:45:39 Summary: Add test for skipped case with utf-8 message Affected #: 1 file diff -r f3685129dbaad82c8e56caf1b03da91bd04e64e4 -r a3ef32bda54e36006ff16b46473afb6caf1ac1d2 testing/test_junitxml.py --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -494,6 +494,8 @@ log.append_error(report) report.longrepr = "filename", 1, ustr log.append_skipped(report) + report.longrepr = "filename", 1, "Skipped: ???" + log.append_skipped(report) report.wasxfail = ustr log.append_skipped(report) log.pytest_sessionfinish() https://bitbucket.org/hpk42/pytest/commits/bc61fe662fa3/ Changeset: bc61fe662fa3 User: hpk42 Date: 2014-07-15 22:17:15 Summary: Merged in wooparadog/pytest (pull request #163) Also replace `report.longrepr` with `bin_xml_escape`ed skipreason Affected #: 2 files diff -r 2bc0f17141418719af8808f25bcd24d70baa0f03 -r bc61fe662fa32521eab0b6f2c4ca427bdac0cd1f _pytest/junitxml.py --- a/_pytest/junitxml.py +++ b/_pytest/junitxml.py @@ -163,7 +163,7 @@ if skipreason.startswith("Skipped: "): skipreason = bin_xml_escape(skipreason[9:]) self.append( - Junit.skipped("%s:%s: %s" % report.longrepr, + Junit.skipped("%s:%s: %s" % (filename, lineno, skipreason), type="pytest.skip", message=skipreason )) diff -r 2bc0f17141418719af8808f25bcd24d70baa0f03 -r bc61fe662fa32521eab0b6f2c4ca427bdac0cd1f testing/test_junitxml.py --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -494,6 +494,8 @@ log.append_error(report) report.longrepr = "filename", 1, ustr log.append_skipped(report) + report.longrepr = "filename", 1, "Skipped: ???" + log.append_skipped(report) report.wasxfail = ustr log.append_skipped(report) log.pytest_sessionfinish() 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 Jul 15 22:17:19 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 15 Jul 2014 20:17:19 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Merged in wooparadog/pytest (pull request #163) Message-ID: <20140715201719.10250.66852@app12.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/bc61fe662fa3/ Changeset: bc61fe662fa3 User: hpk42 Date: 2014-07-15 22:17:15 Summary: Merged in wooparadog/pytest (pull request #163) Also replace `report.longrepr` with `bin_xml_escape`ed skipreason Affected #: 2 files diff -r 2bc0f17141418719af8808f25bcd24d70baa0f03 -r bc61fe662fa32521eab0b6f2c4ca427bdac0cd1f _pytest/junitxml.py --- a/_pytest/junitxml.py +++ b/_pytest/junitxml.py @@ -163,7 +163,7 @@ if skipreason.startswith("Skipped: "): skipreason = bin_xml_escape(skipreason[9:]) self.append( - Junit.skipped("%s:%s: %s" % report.longrepr, + Junit.skipped("%s:%s: %s" % (filename, lineno, skipreason), type="pytest.skip", message=skipreason )) diff -r 2bc0f17141418719af8808f25bcd24d70baa0f03 -r bc61fe662fa32521eab0b6f2c4ca427bdac0cd1f testing/test_junitxml.py --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -494,6 +494,8 @@ log.append_error(report) report.longrepr = "filename", 1, ustr log.append_skipped(report) + report.longrepr = "filename", 1, "Skipped: ???" + log.append_skipped(report) report.wasxfail = ustr log.append_skipped(report) log.pytest_sessionfinish() 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 Wed Jul 16 17:52:58 2014 From: issues-reply at bitbucket.org (d3ph) Date: Wed, 16 Jul 2014 15:52:58 -0000 Subject: [Pytest-commit] Issue #541: Can't use pytest.mark.parametrize inside unittest class (hpk42/pytest) Message-ID: <20140716155258.27215.53795@app13.ash-private.bitbucket.org> New issue 541: Can't use pytest.mark.parametrize inside unittest class https://bitbucket.org/hpk42/pytest/issue/541/cant-use-pytestmarkparametrize-inside d3ph: ``` #!python def test_parametrize_unittest(testdir): testpath = testdir.makepyfile(""" import unittest import pytest pytest_plugins = "pytest_unittest" class MyTestCase(unittest.TestCase): @pytest.mark.parametrize('param', ['foo']) def testpassing(self, param): self.assertEquals(param, 'foo') @pytest.mark.parametrize('param', ['foo']) def test_failing(self, param): self.assertEquals(param, 'bar') """) reprec = testdir.inline_run(testpath) assert reprec.matchreport("testpassing").passed assert reprec.matchreport("test_failing").failed ``` From commits-noreply at bitbucket.org Thu Jul 17 02:21:32 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 17 Jul 2014 00:21:32 -0000 Subject: [Pytest-commit] commit/pytest: gutworth: avoid importing old assertion interpretation code by default (fixes #537) Message-ID: <20140717002132.18781.22360@app04.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/18e7ceb385f8/ Changeset: 18e7ceb385f8 User: gutworth Date: 2014-07-17 02:21:18 Summary: avoid importing old assertion interpretation code by default (fixes #537) Affected #: 2 files diff -r bc61fe662fa32521eab0b6f2c4ca427bdac0cd1f -r 18e7ceb385f84be419e6edb0630bdc048727c1c7 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ NEXT (2.6) ----------------------------------- +- fix issue537: Avoid importing old assertion reinterpretation code by default. + - fix issue364: shorten and enhance tracebacks representation by default. The new "--tb=auto" option (default) will only display long tracebacks for the first and last entry. You can get the old behaviour of printing diff -r bc61fe662fa32521eab0b6f2c4ca427bdac0cd1f -r 18e7ceb385f84be419e6edb0630bdc048727c1c7 _pytest/assertion/reinterpret.py --- a/_pytest/assertion/reinterpret.py +++ b/_pytest/assertion/reinterpret.py @@ -45,10 +45,8 @@ if sys.version_info > (3, 0): AssertionError.__module__ = "builtins" - reinterpret_old = "old reinterpretation not available for py3" -else: - from _pytest.assertion.oldinterpret import interpret as reinterpret_old + if sys.version_info >= (2, 6) or (sys.platform.startswith("java")): from _pytest.assertion.newinterpret import interpret as reinterpret else: - reinterpret = reinterpret_old + from _pytest.assertion.oldinterpret import interpret as reinterpret 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 Jul 17 03:23:43 2014 From: issues-reply at bitbucket.org (virtuald) Date: Thu, 17 Jul 2014 01:23:43 -0000 Subject: [Pytest-commit] Issue #542: Doesn't appear to be a supported way for plugins to detect test failures at teardown (hpk42/pytest) Message-ID: <20140717012343.27850.65005@app06.ash-private.bitbucket.org> New issue 542: Doesn't appear to be a supported way for plugins to detect test failures at teardown https://bitbucket.org/hpk42/pytest/issue/542/doesnt-appear-to-be-a-supported-way-for virtuald: What I'd like to be able to do is write a pytest plugin that would check proper usage of a fixture after a test has completed. If the test has failed, then I'd like to not do the check, since the additional error message would confuse the user. I found a way to do it, but since I'm using an internal variable I suspect that it might be subject to breakage. Here's what I'm doing now: ``` #!python def pytest_runtest_setup(item): item.__testsfailed = item.session._testsfailed def pytest_runtest_teardown(item): if fixture_enabled and item.__testsfailed == item.session._testsfailed: # assert that the fixture was used properly ``` I'm open to other ways of implementing this, particularly if there's an officially supported way to do it. Thanks! From commits-noreply at bitbucket.org Thu Jul 17 09:26:07 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 17 Jul 2014 07:26:07 -0000 Subject: [Pytest-commit] commit/pytest: jurko: remove extra parentheses - stylistic code change Message-ID: <20140717072607.31726.24685@app14.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/413a4e645601/ Changeset: 413a4e645601 User: jurko Date: 2014-07-17 08:35:36 Summary: remove extra parentheses - stylistic code change Affected #: 1 file diff -r 18e7ceb385f84be419e6edb0630bdc048727c1c7 -r 413a4e64560126df8371894e185fdf23cfa01a2d _pytest/assertion/reinterpret.py --- a/_pytest/assertion/reinterpret.py +++ b/_pytest/assertion/reinterpret.py @@ -46,7 +46,7 @@ if sys.version_info > (3, 0): AssertionError.__module__ = "builtins" -if sys.version_info >= (2, 6) or (sys.platform.startswith("java")): +if sys.version_info >= (2, 6) or sys.platform.startswith("java"): from _pytest.assertion.newinterpret import interpret as reinterpret else: from _pytest.assertion.oldinterpret import interpret as reinterpret 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 Jul 17 10:51:54 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 17 Jul 2014 08:51:54 -0000 Subject: [Pytest-commit] commit/py: hpk42: refactor class-level registry on ForkedFunc child start/finish Message-ID: <20140717085154.22354.3281@app06.ash-private.bitbucket.org> 1 new commit in py: https://bitbucket.org/hpk42/py/commits/37f557844498/ Changeset: 37f557844498 User: hpk42 Date: 2014-07-17 10:51:38 Summary: refactor class-level registry on ForkedFunc child start/finish event to become instance based (i.e. passed into the constructor) bump to 1.4.22 for release Affected #: 6 files diff -r 89d472ccb3556f34f2a039c61f8b0090a8e4e9a2 -r 37f557844498ef4943c1e68c8f40bc3713b0b393 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +1.4.22 +================================================== + +- refactor class-level registry on ForkedFunc child start/finish + event to become instance based (i.e. passed into the constructor) + 1.4.21 ================================================== diff -r 89d472ccb3556f34f2a039c61f8b0090a8e4e9a2 -r 37f557844498ef4943c1e68c8f40bc3713b0b393 README.txt --- a/README.txt +++ b/README.txt @@ -13,5 +13,5 @@ Bugs and issues: http://bitbucket.org/hpk42/py/issues/ -Authors: Holger Krekel and others, 2004-2013 +Authors: Holger Krekel and others, 2004-2014 diff -r 89d472ccb3556f34f2a039c61f8b0090a8e4e9a2 -r 37f557844498ef4943c1e68c8f40bc3713b0b393 py/__init__.py --- a/py/__init__.py +++ b/py/__init__.py @@ -8,7 +8,7 @@ (c) Holger Krekel and others, 2004-2013 """ -__version__ = '1.4.21' +__version__ = '1.4.22' from py import _apipkg diff -r 89d472ccb3556f34f2a039c61f8b0090a8e4e9a2 -r 37f557844498ef4943c1e68c8f40bc3713b0b393 py/_process/forkedfunc.py --- a/py/_process/forkedfunc.py +++ b/py/_process/forkedfunc.py @@ -11,31 +11,6 @@ import marshal -class HookMixin(object): - _on_start = list() - _on_exit = list() - - @classmethod - def register_on_start(cls, callback): - cls._on_start.append(callback) - - @classmethod - def register_on_exit(self, callback): - self._on_exit.append(callback) - - def _run_on_start(self): - self._run_callbacks(self._on_start) - - def _run_on_exit(self): - self._run_callbacks(self._on_exit) - - def _run_callbacks(self, callbacks): - for callback in callbacks: - callback(self) - sys.stdout.flush() - sys.stderr.flush() - - def get_unbuffered_io(fd, filename): f = open(str(filename), "w") if fd != f.fileno(): @@ -49,11 +24,12 @@ return AutoFlush() -class ForkedFunc(HookMixin): +class ForkedFunc: EXITSTATUS_EXCEPTION = 3 - def __init__(self, fun, args=None, kwargs=None, nice_level=0): + def __init__(self, fun, args=None, kwargs=None, nice_level=0, + child_on_start=None, child_on_exit=None): if args is None: args = [] if kwargs is None: @@ -71,9 +47,9 @@ self.pid = pid else: # in child process self.pid = None - self._child(nice_level) + self._child(nice_level, child_on_start, child_on_exit) - def _child(self, nice_level): + def _child(self, nice_level, child_on_start, child_on_exit): # right now we need to call a function, but first we need to # map all IO that might happen sys.stdout = stdout = get_unbuffered_io(1, self.STDOUT) @@ -84,10 +60,12 @@ if nice_level: os.nice(nice_level) try: - self._run_on_start() + if child_on_start is not None: + child_on_start() retval = self.fun(*self.args, **self.kwargs) retvalf.write(marshal.dumps(retval)) - self._run_on_exit() + if child_on_exit is not None: + child_on_exit() except: excinfo = py.code.ExceptionInfo() stderr.write(str(excinfo._getreprcrash())) diff -r 89d472ccb3556f34f2a039c61f8b0090a8e4e9a2 -r 37f557844498ef4943c1e68c8f40bc3713b0b393 setup.py --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ name='py', description='library with cross-python path, ini-parsing, io, code, log facilities', long_description = open('README.txt').read(), - version='1.4.21', + version='1.4.22', url='http://pylib.readthedocs.org/', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff -r 89d472ccb3556f34f2a039c61f8b0090a8e4e9a2 -r 37f557844498ef4943c1e68c8f40bc3713b0b393 testing/process/test_forkedfunc.py --- a/testing/process/test_forkedfunc.py +++ b/testing/process/test_forkedfunc.py @@ -3,10 +3,6 @@ pytestmark = py.test.mark.skipif("not hasattr(os, 'fork')") - at pytest.fixture(autouse=True) -def clear_forkedfunc(monkeypatch): - monkeypatch.setattr(py.process.ForkedFunc, "_on_start", []) - monkeypatch.setattr(py.process.ForkedFunc, "_on_exit", []) def test_waitfinish_removes_tempdir(): ff = py.process.ForkedFunc(boxf1) @@ -126,20 +122,19 @@ def test_hooks(monkeypatch): - monkeypatch.setattr(py.process.ForkedFunc, "_on_exit", []) - monkeypatch.setattr(py.process.ForkedFunc, "_on_start", []) def _boxed(): return 1 - def _on_start(proc): + def _on_start(): sys.stdout.write("some out\n") + sys.stdout.flush() - def _on_exit(proc): + def _on_exit(): sys.stderr.write("some err\n") + sys.stderr.flush() - py.process.ForkedFunc.register_on_start(_on_start) - py.process.ForkedFunc.register_on_exit(_on_exit) - result = py.process.ForkedFunc(_boxed).waitfinish() + result = py.process.ForkedFunc(_boxed, child_on_start=_on_start, + child_on_exit=_on_exit).waitfinish() assert result.out == "some out\n" assert result.err == "some err\n" assert result.exitstatus == 0 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 Jul 17 10:56:02 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 17 Jul 2014 08:56:02 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: pytest depends on the freshly released 1.4.22 to function properly Message-ID: <20140717085602.22354.62678@app06.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/6381ee1f32ec/ Changeset: 6381ee1f32ec User: hpk42 Date: 2014-07-17 10:55:52 Summary: pytest depends on the freshly released 1.4.22 to function properly Affected #: 2 files diff -r 413a4e64560126df8371894e185fdf23cfa01a2d -r 6381ee1f32ecd426b26d94f8acb579cae12565e9 _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.6.0.dev2' +__version__ = '2.6.0.dev3' diff -r 413a4e64560126df8371894e185fdf23cfa01a2d -r 6381ee1f32ecd426b26d94f8acb579cae12565e9 setup.py --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ def main(): - install_requires = ['py>=1.4.21.dev2'] + install_requires = ['py>=1.4.22'] if sys.version_info < (2, 7) or (3,) <= sys.version_info < (3, 2): install_requires.append('argparse') if sys.platform == 'win32': @@ -27,7 +27,7 @@ name='pytest', description='pytest: simple powerful testing with Python', long_description=long_description, - version='2.6.0.dev2', + version='2.6.0.dev3', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], 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 Jul 17 16:39:26 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 17 Jul 2014 14:39:26 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: bump version, preliminary announcement Message-ID: <20140717143926.8402.55598@app11.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/1e466ad27c01/ Changeset: 1e466ad27c01 User: hpk42 Date: 2014-07-17 16:38:54 Summary: bump version, preliminary announcement Affected #: 6 files diff -r 6381ee1f32ecd426b26d94f8acb579cae12565e9 -r 1e466ad27c019d969910e39e7c256710c5fbbbed CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -NEXT (2.6) +2.6.0 ----------------------------------- - fix issue537: Avoid importing old assertion reinterpretation code by default. diff -r 6381ee1f32ecd426b26d94f8acb579cae12565e9 -r 1e466ad27c019d969910e39e7c256710c5fbbbed _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.6.0.dev3' +__version__ = '2.6.0' diff -r 6381ee1f32ecd426b26d94f8acb579cae12565e9 -r 1e466ad27c019d969910e39e7c256710c5fbbbed doc/en/announce/release-2.6.0.txt --- /dev/null +++ b/doc/en/announce/release-2.6.0.txt @@ -0,0 +1,153 @@ +pytest-2.6.0: fixes +=========================================================================== + +pytest is a mature Python testing tool with more than a 1000 tests +against itself, passing on many different interpreters and platforms. + +The 2.6.0 release should be drop-in backward compatible to 2.5.2 and +fixes a number of bugs and brings some new features, mainly: + +- shorter tracebacks by default: only the first (test function) entry + and the last (failure location) entry are shown, the ones between + only in "short" format. Use ``--tb=long`` to get back the old + behaviour of showing "long" entries everywhere. + +- a new warning system which reports oddities during collection + and execution. For example, ignoring collecting Test* classes with an + ``__init__`` now produces a warning. + +- various improvements to nose/mock/unittest integration + +Note also that 2.6.0 departs with the "zero reported bugs" policy +because it has been too hard to keep up with it, unfortunately. +Instead we are for now rather bound to work on "upvoted" issues in +the https://bitbucket.org/hpk42/pytest/issues?status=new&status=open&sort=-votes +issue tracker. + +See docs at: + + http://pytest.org + +As usual, you can upgrade from pypi via:: + + pip install -U pytest + +Thanks to all who contributed, among them: + + Benjamin Peterson + Jurko Gospodneti? + Floris Bruynooghe + Marc Abramowitz + Marc Schlaich + Trevor Bekolay + Bruno Oliveira + Alex Groenholm + +have fun, +holger krekel + +2.6.0 +----------------------------------- + +- fix issue537: Avoid importing old assertion reinterpretation code by default. + Thanks Benjamin Peterson. + +- fix issue364: shorten and enhance tracebacks representation by default. + The new "--tb=auto" option (default) will only display long tracebacks + for the first and last entry. You can get the old behaviour of printing + all entries as long entries with "--tb=long". Also short entries by + default are now printed very similarly to "--tb=native" ones. + +- fix issue514: teach assertion reinterpretation about private class attributes + Thanks Benjamin Peterson. + +- change -v output to include full node IDs of tests. Users can copy + a node ID from a test run, including line number, and use it as a + positional argument in order to run only a single test. + +- fix issue 475: fail early and comprehensible if calling + pytest.raises with wrong exception type. + +- fix issue516: tell in getting-started about current dependencies. + +- cleanup setup.py a bit and specify supported versions. Thanks Jurko + Gospodnetic for the PR. + +- change XPASS colour to yellow rather then red when tests are run + with -v. + +- fix issue473: work around mock putting an unbound method into a class + dict when double-patching. + +- fix issue498: if a fixture finalizer fails, make sure that + the fixture is still invalidated. + +- fix issue453: the result of the pytest_assertrepr_compare hook now gets + it's newlines escaped so that format_exception does not blow up. + +- internal new warning system: pytest will now produce warnings when + it detects oddities in your test collection or execution. + Warnings are ultimately sent to a new pytest_logwarning hook which is + currently only implemented by the terminal plugin which displays + warnings in the summary line and shows more details when -rw (report on + warnings) is specified. + +- change skips into warnings for test classes with an __init__ and + callables in test modules which look like a test but are not functions. + +- fix issue436: improved finding of initial conftest files from command + line arguments by using the result of parse_known_args rather than + the previous flaky heuristics. Thanks Marc Abramowitz for tests + and initial fixing approaches in this area. + +- fix issue #479: properly handle nose/unittest(2) SkipTest exceptions + during collection/loading of test modules. Thanks to Marc Schlaich + for the complete PR. + +- fix issue490: include pytest_load_initial_conftests in documentation + and improve docstring. + +- fix issue472: clarify that ``pytest.config.getvalue()`` cannot work + if it's triggered ahead of command line parsing. + +- merge PR123: improved integration with mock.patch decorator on tests. + +- fix issue412: messing with stdout/stderr FD-level streams is now + captured without crashes. + +- fix issue483: trial/py33 works now properly. Thanks Daniel Grana for PR. + +- improve example for pytest integration with "python setup.py test" + which now has a generic "-a" or "--pytest-args" option where you + can pass additional options as a quoted string. Thanks Trevor Bekolay. + +- simplified internal capturing mechanism and made it more robust + against tests or setups changing FD1/FD2, also better integrated + now with pytest.pdb() in single tests. + +- improvements to pytest's own test-suite leakage detection, courtesy of PRs + from Marc Abramowitz + +- fix issue492: avoid leak in test_writeorg. Thanks Marc Abramowitz. + +- fix issue493: don't run tests in doc directory with ``python setup.py test`` + (use tox -e doctesting for that) + +- fix issue486: better reporting and handling of early conftest loading failures + +- some cleanup and simplification of internal conftest handling. + +- work a bit harder to break reference cycles when catching exceptions. + Thanks Jurko Gospodnetic. + +- fix issue443: fix skip examples to use proper comparison. Thanks Alex + Groenholm. + +- support nose-style ``__test__`` attribute on modules, classes and + functions, including unittest-style Classes. If set to False, the + test will not be collected. + +- fix issue512: show "" for arguments which might not be set + in monkeypatch plugin. Improves output in documentation. + +- avoid importing "py.test" (an old alias module for "pytest") diff -r 6381ee1f32ecd426b26d94f8acb579cae12565e9 -r 1e466ad27c019d969910e39e7c256710c5fbbbed doc/en/index.txt --- a/doc/en/index.txt +++ b/doc/en/index.txt @@ -8,17 +8,17 @@ **a mature full-featured Python testing tool** - - runs on Posix/Windows, Python 2.5-3.3, PyPy and Jython-2.5.1 - - **zero-reported-bugs** policy with >1000 tests against itself + - runs on Posix/Windows, Python 2.5-3.4, PyPy and Jython-2.5.1 + - **well tested** with more than a thousand tests against itself - **strict backward compatibility policy** for safe pytest upgrades - :ref:`comprehensive online ` and `PDF documentation `_ - - many :ref:`third party plugins ` and :ref:`builtin helpers `, + - many :ref:`third party plugins ` and :ref:`builtin helpers `, - used in :ref:`many small and large projects and organisations ` - comes with many :ref:`tested examples ` **provides easy no-boilerplate testing** - - makes it :ref:`easy to get started `, + - makes it :ref:`easy to get started `, has many :ref:`usage options ` - :ref:`assert with the assert statement` - helpful :ref:`traceback and failing assertion reporting ` @@ -38,7 +38,7 @@ **integrates with other testing methods and tools**: - - multi-paradigm: pytest can run ``nose``, ``unittest`` and + - multi-paradigm: pytest can run ``nose``, ``unittest`` and ``doctest`` style test suites, including running testcases made for Django and trial - supports :ref:`good integration practises ` diff -r 6381ee1f32ecd426b26d94f8acb579cae12565e9 -r 1e466ad27c019d969910e39e7c256710c5fbbbed setup.py --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ name='pytest', description='pytest: simple powerful testing with Python', long_description=long_description, - version='2.6.0.dev3', + version='2.6.0', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff -r 6381ee1f32ecd426b26d94f8acb579cae12565e9 -r 1e466ad27c019d969910e39e7c256710c5fbbbed tox.ini --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] distshare={homedir}/.tox/distshare -envlist=flakes,py26,py27,pypy,py27-pexpect,py33-pexpect,py27-nobyte,py32,py33,py27-xdist,py33-xdist,py27-trial,py33-trial,doctesting +envlist=flakes,py26,py27,py34,pypy,py27-pexpect,py33-pexpect,py27-nobyte,py32,py33,py27-xdist,py33-xdist,py27-trial,py33-trial,doctesting [testenv] changedir=testing 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 Jul 17 16:49:18 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 17 Jul 2014 14:49:18 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: mention py34 compatibility Message-ID: <20140717144918.32336.52992@app12.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/808a74ee97be/ Changeset: 808a74ee97be User: hpk42 Date: 2014-07-17 16:49:10 Summary: mention py34 compatibility Affected #: 2 files diff -r 1e466ad27c019d969910e39e7c256710c5fbbbed -r 808a74ee97be149c9db577091fb5a7c09f069805 README.rst --- a/README.rst +++ b/README.rst @@ -19,8 +19,8 @@ - multi-paradigm support: you can use ``pytest`` to run test suites based on `unittest `_ (or trial), `nose `_ -- single-source compatibility to Python2.5 all the way up to Python3.3, - PyPy-1.9 and Jython-2.5.1. +- single-source compatibility to Python2.5 all the way up to Python3.4, + PyPy-2.3 and Jython-2.5.1. - many `external plugins `_. diff -r 1e466ad27c019d969910e39e7c256710c5fbbbed -r 808a74ee97be149c9db577091fb5a7c09f069805 doc/en/getting-started.txt --- a/doc/en/getting-started.txt +++ b/doc/en/getting-started.txt @@ -1,7 +1,7 @@ Installation and Getting Started =================================== -**Pythons**: Python 2.6-3.3, Jython, PyPy +**Pythons**: Python 2.6-3.4, Jython, PyPy-2.3 **Platforms**: Unix/Posix and Windows @@ -51,17 +51,17 @@ =========================== test session starts ============================ platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 collected 1 items - + test_sample.py F - + ================================= FAILURES ================================= _______________________________ test_answer ________________________________ - + def test_answer(): > assert func(3) == 5 E assert 4 == 5 E + where 4 = func(3) - + test_sample.py:5: AssertionError ========================= 1 failed in 0.01 seconds ========================= @@ -126,14 +126,14 @@ .F ================================= FAILURES ================================= ____________________________ TestClass.test_two ____________________________ - + self = - + def test_two(self): x = "hello" > assert hasattr(x, 'check') E assert hasattr('hello', 'check') - + test_class.py:8: AssertionError 1 failed, 1 passed in 0.01 seconds @@ -162,14 +162,14 @@ F ================================= FAILURES ================================= _____________________________ test_needsfiles ______________________________ - + tmpdir = local('/tmp/pytest-1008/test_needsfiles0') - + def test_needsfiles(tmpdir): print tmpdir > assert 0 E assert 0 - + test_tmpdir.py:3: AssertionError ----------------------------- Captured stdout ------------------------------ /tmp/pytest-1008/test_needsfiles0 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 Jul 17 16:55:37 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 17 Jul 2014 14:55:37 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: regen docs for pytest-2.6 Message-ID: <20140717145537.7361.98735@app13.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/902bf34b5c9b/ Changeset: 902bf34b5c9b User: hpk42 Date: 2014-07-17 16:55:24 Summary: regen docs for pytest-2.6 Affected #: 19 files diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/assert.txt --- a/doc/en/assert.txt +++ b/doc/en/assert.txt @@ -26,7 +26,7 @@ $ py.test test_assert1.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 1 items test_assert1.py F @@ -116,7 +116,7 @@ $ py.test test_assert2.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 1 items test_assert2.py F diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/builtin.txt --- a/doc/en/builtin.txt +++ b/doc/en/builtin.txt @@ -80,7 +80,7 @@ capfd enables capturing of writes to file descriptors 1 and 2 and makes - captured output available via ``capsys.readouterr()`` method calls + captured output available via ``capfd.readouterr()`` method calls which return a ``(out, err)`` tuple. monkeypatch diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/capture.txt --- a/doc/en/capture.txt +++ b/doc/en/capture.txt @@ -64,7 +64,7 @@ $ py.test =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 2 items test_module.py .F @@ -77,8 +77,8 @@ E assert False test_module.py:9: AssertionError - ----------------------------- Captured stdout ------------------------------ - setting up + -------------------------- Captured stdout setup --------------------------- + setting up ==================== 1 failed, 1 passed in 0.01 seconds ==================== Accessing captured output from a test function diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/conf.py --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -54,7 +54,7 @@ # General information about the project. project = u'pytest' -copyright = u'2013, holger krekel' +copyright = u'2014, holger krekel' diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/doctest.txt --- a/doc/en/doctest.txt +++ b/doc/en/doctest.txt @@ -44,12 +44,12 @@ $ py.test =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 1 items mymodule.py . - ========================= 1 passed in 0.01 seconds ========================= + ========================= 1 passed in 0.04 seconds ========================= It is possible to use fixtures using the ``getfixture`` helper:: diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/example/markers.txt --- a/doc/en/example/markers.txt +++ b/doc/en/example/markers.txt @@ -31,10 +31,10 @@ $ py.test -v -m webtest =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python collecting ... collected 4 items - test_server.py:3: test_send_http PASSED + test_server.py at 3::test_send_http PASSED =================== 3 tests deselected by "-m 'webtest'" =================== ================== 1 passed, 3 deselected in 0.01 seconds ================== @@ -43,12 +43,12 @@ $ py.test -v -m "not webtest" =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python collecting ... collected 4 items - test_server.py:6: test_something_quick PASSED - test_server.py:8: test_another PASSED - test_server.py:11: TestClass.test_method PASSED + test_server.py at 6::test_something_quick PASSED + test_server.py at 8::test_another PASSED + test_server.py at 11::TestClass::test_method PASSED ================= 1 tests deselected by "-m 'not webtest'" ================= ================== 3 passed, 1 deselected in 0.01 seconds ================== @@ -62,36 +62,35 @@ $ py.test -v test_server.py::TestClass::test_method =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python - collecting ... collected 4 items - - test_server.py:11: TestClass.test_method PASSED - + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python + collecting ... collected 5 items + + test_server.py at 11::TestClass::test_method PASSED + ========================= 1 passed in 0.01 seconds ========================= You can also select on the class:: $ py.test -v test_server.py::TestClass =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python collecting ... collected 4 items - - test_server.py:11: TestClass.test_method PASSED - + + test_server.py at 11::TestClass::test_method PASSED + ========================= 1 passed in 0.01 seconds ========================= Or select multiple nodes:: $ py.test -v test_server.py::TestClass test_server.py::test_send_http - =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python - collecting ... collected 8 items - - test_server.py:11: TestClass.test_method PASSED - test_server.py:3: test_send_http PASSED - - ========================= 2 passed in 0.01 seconds ========================= - + =========================== test session starts ============================ + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python + collecting ... collected 8 items + + test_server.py at 11::TestClass::test_method PASSED + test_server.py at 3::test_send_http PASSED + + ========================= 2 passed in 0.01 seconds ========================= .. _node-id: @@ -121,10 +120,10 @@ $ py.test -v -k http # running with the above defined example module =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python collecting ... collected 4 items - test_server.py:3: test_send_http PASSED + test_server.py at 3::test_send_http PASSED ====================== 3 tests deselected by '-khttp' ====================== ================== 1 passed, 3 deselected in 0.01 seconds ================== @@ -133,12 +132,12 @@ $ py.test -k "not send_http" -v =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python collecting ... collected 4 items - test_server.py:6: test_something_quick PASSED - test_server.py:8: test_another PASSED - test_server.py:11: TestClass.test_method PASSED + test_server.py at 6::test_something_quick PASSED + test_server.py at 8::test_another PASSED + test_server.py at 11::TestClass::test_method PASSED ================= 1 tests deselected by '-knot send_http' ================== ================== 3 passed, 1 deselected in 0.01 seconds ================== @@ -147,11 +146,11 @@ $ py.test -k "http or quick" -v =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python collecting ... collected 4 items - test_server.py:3: test_send_http PASSED - test_server.py:6: test_something_quick PASSED + test_server.py at 3::test_send_http PASSED + test_server.py at 6::test_something_quick PASSED ================= 2 tests deselected by '-khttp or quick' ================== ================== 2 passed, 2 deselected in 0.01 seconds ================== @@ -327,7 +326,7 @@ $ py.test -E stage2 =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 1 items test_someenv.py s @@ -338,7 +337,7 @@ $ py.test -E stage1 =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 1 items test_someenv.py . @@ -456,12 +455,12 @@ $ py.test -rs # this option reports skip reasons =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 4 items test_plat.py s.s. ========================= short test summary info ========================== - SKIP [2] /tmp/doc-exec-65/conftest.py:12: cannot run on platform linux2 + SKIP [2] /tmp/doc-exec-142/conftest.py:12: cannot run on platform linux2 =================== 2 passed, 2 skipped in 0.01 seconds ==================== @@ -469,7 +468,7 @@ $ py.test -m linux2 =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 4 items test_plat.py . @@ -520,7 +519,7 @@ $ py.test -m interface --tb=short =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 4 items test_module.py FF @@ -528,12 +527,12 @@ ================================= FAILURES ================================= __________________________ test_interface_simple ___________________________ test_module.py:3: in test_interface_simple - > assert 0 - E assert 0 + assert 0 + E assert 0 __________________________ test_interface_complex __________________________ test_module.py:6: in test_interface_complex - > assert 0 - E assert 0 + assert 0 + E assert 0 ================== 2 tests deselected by "-m 'interface'" ================== ================== 2 failed, 2 deselected in 0.01 seconds ================== @@ -541,7 +540,7 @@ $ py.test -m "interface or event" --tb=short =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 4 items test_module.py FFF @@ -549,15 +548,15 @@ ================================= FAILURES ================================= __________________________ test_interface_simple ___________________________ test_module.py:3: in test_interface_simple - > assert 0 - E assert 0 + assert 0 + E assert 0 __________________________ test_interface_complex __________________________ test_module.py:6: in test_interface_complex - > assert 0 - E assert 0 + assert 0 + E assert 0 ____________________________ test_event_simple _____________________________ test_module.py:9: in test_event_simple - > assert 0 - E assert 0 + assert 0 + E assert 0 ============= 1 tests deselected by "-m 'interface or event'" ============== - ================== 3 failed, 1 deselected in 0.01 seconds ================== + ================== 3 failed, 1 deselected in 0.02 seconds ================== diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/example/nonpython.txt --- a/doc/en/example/nonpython.txt +++ b/doc/en/example/nonpython.txt @@ -27,10 +27,10 @@ nonpython $ py.test test_simple.yml =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 2 items - test_simple.yml F. + test_simple.yml .F ================================= FAILURES ================================= ______________________________ usecase: hello ______________________________ @@ -56,11 +56,11 @@ nonpython $ py.test -v =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python collecting ... collected 2 items - test_simple.yml:1: usecase: hello FAILED - test_simple.yml:1: usecase: ok PASSED + test_simple.yml at 1::usecase: ok PASSED + test_simple.yml at 1::usecase: hello FAILED ================================= FAILURES ================================= ______________________________ usecase: hello ______________________________ @@ -74,10 +74,10 @@ nonpython $ py.test --collect-only =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 2 items + - - ============================= in 0.02 seconds ============================= + ============================= in 0.03 seconds ============================= diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/example/parametrize.txt --- a/doc/en/example/parametrize.txt +++ b/doc/en/example/parametrize.txt @@ -106,7 +106,7 @@ $ py.test test_scenarios.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 4 items test_scenarios.py .... @@ -118,7 +118,7 @@ $ py.test --collect-only test_scenarios.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 4 items @@ -182,7 +182,7 @@ $ py.test test_backends.py --collect-only =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 2 items @@ -197,7 +197,7 @@ ================================= FAILURES ================================= _________________________ test_db_initialized[d2] __________________________ - db = + db = def test_db_initialized(db): # a dummy test @@ -253,7 +253,7 @@ ================================= FAILURES ================================= ________________________ TestClass.test_equals[1-2] ________________________ - self = , a = 1, b = 2 + self = , a = 1, b = 2 def test_equals(self, a, b): > assert a == b @@ -279,10 +279,12 @@ Running it results in some skips if we don't have all the python interpreters installed and otherwise runs all combinations (5 interpreters times 5 interpreters times 3 objects to serialize/deserialize):: . $ py.test -rs -q multipython.py - ............sss............sss............sss............ssssssssssssssssss + ssssssssssssssssssssssssssssssssssss......sssssssss......ssssssssssssssssss ========================= short test summary info ========================== - SKIP [27] /home/hpk/p/pytest/doc/en/example/multipython.py:22: 'python2.8' not found - 48 passed, 27 skipped in 1.30 seconds + SKIP [21] /home/hpk/p/pytest/doc/en/example/multipython.py:22: 'python2.4' not found + SKIP [21] /home/hpk/p/pytest/doc/en/example/multipython.py:22: 'python2.8' not found + SKIP [21] /home/hpk/p/pytest/doc/en/example/multipython.py:22: 'python2.5' not found + 12 passed, 63 skipped in 0.66 seconds Indirect parametrization of optional implementations/imports -------------------------------------------------------------------- @@ -329,12 +331,12 @@ $ py.test -rs test_module.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 2 items test_module.py .s ========================= short test summary info ========================== - SKIP [1] /tmp/doc-exec-67/conftest.py:10: could not import 'opt2' + SKIP [1] /tmp/doc-exec-144/conftest.py:10: could not import 'opt2' =================== 1 passed, 1 skipped in 0.01 seconds ==================== diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/example/pythoncollection.txt --- a/doc/en/example/pythoncollection.txt +++ b/doc/en/example/pythoncollection.txt @@ -43,7 +43,7 @@ $ py.test --collect-only =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 2 items @@ -88,7 +88,7 @@ . $ py.test --collect-only pythoncollection.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 3 items @@ -141,7 +141,7 @@ $ py.test --collect-only =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 1 items diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/example/reportingdemo.txt --- a/doc/en/example/reportingdemo.txt +++ b/doc/en/example/reportingdemo.txt @@ -13,7 +13,7 @@ assertion $ py.test failure_demo.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 39 items failure_demo.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF @@ -30,7 +30,7 @@ failure_demo.py:15: AssertionError _________________________ TestFailing.test_simple __________________________ - self = + self = def test_simple(self): def f(): @@ -40,13 +40,13 @@ > assert f() == g() E assert 42 == 43 - E + where 42 = () - E + and 43 = () + E + where 42 = () + E + and 43 = () failure_demo.py:28: AssertionError ____________________ TestFailing.test_simple_multiline _____________________ - self = + self = def test_simple_multiline(self): otherfunc_multi( @@ -66,19 +66,19 @@ failure_demo.py:11: AssertionError ___________________________ TestFailing.test_not ___________________________ - self = + self = def test_not(self): def f(): return 42 > assert not f() E assert not 42 - E + where 42 = () + E + where 42 = () failure_demo.py:38: AssertionError _________________ TestSpecialisedExplanations.test_eq_text _________________ - self = + self = def test_eq_text(self): > assert 'spam' == 'eggs' @@ -89,7 +89,7 @@ failure_demo.py:42: AssertionError _____________ TestSpecialisedExplanations.test_eq_similar_text _____________ - self = + self = def test_eq_similar_text(self): > assert 'foo 1 bar' == 'foo 2 bar' @@ -102,7 +102,7 @@ failure_demo.py:45: AssertionError ____________ TestSpecialisedExplanations.test_eq_multiline_text ____________ - self = + self = def test_eq_multiline_text(self): > assert 'foo\nspam\nbar' == 'foo\neggs\nbar' @@ -115,7 +115,7 @@ failure_demo.py:48: AssertionError ______________ TestSpecialisedExplanations.test_eq_long_text _______________ - self = + self = def test_eq_long_text(self): a = '1'*100 + 'a' + '2'*100 @@ -132,7 +132,7 @@ failure_demo.py:53: AssertionError _________ TestSpecialisedExplanations.test_eq_long_text_multiline __________ - self = + self = def test_eq_long_text_multiline(self): a = '1\n'*100 + 'a' + '2\n'*100 @@ -156,7 +156,7 @@ failure_demo.py:58: AssertionError _________________ TestSpecialisedExplanations.test_eq_list _________________ - self = + self = def test_eq_list(self): > assert [0, 1, 2] == [0, 1, 3] @@ -166,7 +166,7 @@ failure_demo.py:61: AssertionError ______________ TestSpecialisedExplanations.test_eq_list_long _______________ - self = + self = def test_eq_list_long(self): a = [0]*100 + [1] + [3]*100 @@ -178,7 +178,7 @@ failure_demo.py:66: AssertionError _________________ TestSpecialisedExplanations.test_eq_dict _________________ - self = + self = def test_eq_dict(self): > assert {'a': 0, 'b': 1, 'c': 0} == {'a': 0, 'b': 2, 'd': 0} @@ -194,7 +194,7 @@ failure_demo.py:69: AssertionError _________________ TestSpecialisedExplanations.test_eq_set __________________ - self = + self = def test_eq_set(self): > assert set([0, 10, 11, 12]) == set([0, 20, 21]) @@ -210,7 +210,7 @@ failure_demo.py:72: AssertionError _____________ TestSpecialisedExplanations.test_eq_longer_list ______________ - self = + self = def test_eq_longer_list(self): > assert [1,2] == [1,2,3] @@ -220,7 +220,7 @@ failure_demo.py:75: AssertionError _________________ TestSpecialisedExplanations.test_in_list _________________ - self = + self = def test_in_list(self): > assert 1 in [0, 2, 3, 4, 5] @@ -229,7 +229,7 @@ failure_demo.py:78: AssertionError __________ TestSpecialisedExplanations.test_not_in_text_multiline __________ - self = + self = def test_not_in_text_multiline(self): text = 'some multiline\ntext\nwhich\nincludes foo\nand a\ntail' @@ -247,7 +247,7 @@ failure_demo.py:82: AssertionError ___________ TestSpecialisedExplanations.test_not_in_text_single ____________ - self = + self = def test_not_in_text_single(self): text = 'single foo line' @@ -260,7 +260,7 @@ failure_demo.py:86: AssertionError _________ TestSpecialisedExplanations.test_not_in_text_single_long _________ - self = + self = def test_not_in_text_single_long(self): text = 'head ' * 50 + 'foo ' + 'tail ' * 20 @@ -273,7 +273,7 @@ failure_demo.py:90: AssertionError ______ TestSpecialisedExplanations.test_not_in_text_single_long_term _______ - self = + self = def test_not_in_text_single_long_term(self): text = 'head ' * 50 + 'f'*70 + 'tail ' * 20 @@ -292,7 +292,7 @@ i = Foo() > assert i.b == 2 E assert 1 == 2 - E + where 1 = .b + E + where 1 = .b failure_demo.py:101: AssertionError _________________________ test_attribute_instance __________________________ @@ -302,8 +302,8 @@ b = 1 > assert Foo().b == 2 E assert 1 == 2 - E + where 1 = .b - E + where = () + E + where 1 = .b + E + where = () failure_demo.py:107: AssertionError __________________________ test_attribute_failure __________________________ @@ -319,7 +319,7 @@ failure_demo.py:116: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - self = + self = def _get_b(self): > raise Exception('Failed to get attrib') @@ -335,15 +335,15 @@ b = 2 > assert Foo().b == Bar().b E assert 1 == 2 - E + where 1 = .b - E + where = () - E + and 2 = .b - E + where = () + E + where 1 = .b + E + where = () + E + and 2 = .b + E + where = () failure_demo.py:124: AssertionError __________________________ TestRaises.test_raises __________________________ - self = + self = def test_raises(self): s = 'qwe' @@ -355,10 +355,10 @@ > int(s) E ValueError: invalid literal for int() with base 10: 'qwe' - <0-codegen /home/hpk/p/pytest/.tox/regen/local/lib/python2.7/site-packages/_pytest/python.py:999>:1: ValueError + <0-codegen /home/hpk/p/pytest/.tox/regen/local/lib/python2.7/site-packages/_pytest/python.py:1028>:1: ValueError ______________________ TestRaises.test_raises_doesnt _______________________ - self = + self = def test_raises_doesnt(self): > raises(IOError, "int('3')") @@ -367,7 +367,7 @@ failure_demo.py:136: Failed __________________________ TestRaises.test_raise ___________________________ - self = + self = def test_raise(self): > raise ValueError("demo error") @@ -376,7 +376,7 @@ failure_demo.py:139: ValueError ________________________ TestRaises.test_tupleerror ________________________ - self = + self = def test_tupleerror(self): > a,b = [1] @@ -385,7 +385,7 @@ failure_demo.py:142: ValueError ______ TestRaises.test_reinterpret_fails_with_print_for_the_fun_of_it ______ - self = + self = def test_reinterpret_fails_with_print_for_the_fun_of_it(self): l = [1,2,3] @@ -394,11 +394,11 @@ E TypeError: 'int' object is not iterable failure_demo.py:147: TypeError - ----------------------------- Captured stdout ------------------------------ + --------------------------- Captured stdout call --------------------------- l is [1, 2, 3] ________________________ TestRaises.test_some_error ________________________ - self = + self = def test_some_error(self): > if namenotexi: @@ -426,7 +426,7 @@ <2-codegen 'abc-123' /home/hpk/p/pytest/doc/en/example/assertion/failure_demo.py:162>:2: AssertionError ____________________ TestMoreErrors.test_complex_error _____________________ - self = + self = def test_complex_error(self): def f(): @@ -437,13 +437,8 @@ failure_demo.py:175: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - - x = 44, y = 43 - - def somefunc(x,y): - > otherfunc(x,y) - - failure_demo.py:8: + failure_demo.py:8: in somefunc + otherfunc(x,y) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ a = 44, b = 43 @@ -455,7 +450,7 @@ failure_demo.py:5: AssertionError ___________________ TestMoreErrors.test_z1_unpack_error ____________________ - self = + self = def test_z1_unpack_error(self): l = [] @@ -465,7 +460,7 @@ failure_demo.py:179: ValueError ____________________ TestMoreErrors.test_z2_type_error _____________________ - self = + self = def test_z2_type_error(self): l = 3 @@ -475,19 +470,19 @@ failure_demo.py:183: TypeError ______________________ TestMoreErrors.test_startswith ______________________ - self = + self = def test_startswith(self): s = "123" g = "456" > assert s.startswith(g) - E assert ('456') - E + where = '123'.startswith + E assert ('456') + E + where = '123'.startswith failure_demo.py:188: AssertionError __________________ TestMoreErrors.test_startswith_nested ___________________ - self = + self = def test_startswith_nested(self): def f(): @@ -495,15 +490,15 @@ def g(): return "456" > assert f().startswith(g()) - E assert ('456') - E + where = '123'.startswith - E + where '123' = () - E + and '456' = () + E assert ('456') + E + where = '123'.startswith + E + where '123' = () + E + and '456' = () failure_demo.py:195: AssertionError _____________________ TestMoreErrors.test_global_func ______________________ - self = + self = def test_global_func(self): > assert isinstance(globf(42), float) @@ -513,18 +508,18 @@ failure_demo.py:198: AssertionError _______________________ TestMoreErrors.test_instance _______________________ - self = + self = def test_instance(self): self.x = 6*7 > assert self.x != 42 E assert 42 != 42 - E + where 42 = .x + E + where 42 = .x failure_demo.py:202: AssertionError _______________________ TestMoreErrors.test_compare ________________________ - self = + self = def test_compare(self): > assert globf(10) < 5 @@ -534,7 +529,7 @@ failure_demo.py:205: AssertionError _____________________ TestMoreErrors.test_try_finally ______________________ - self = + self = def test_try_finally(self): x = 1 @@ -543,4 +538,4 @@ E assert 1 == 0 failure_demo.py:210: AssertionError - ======================== 39 failed in 0.20 seconds ========================= + ======================== 39 failed in 0.21 seconds ========================= diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/example/simple.txt --- a/doc/en/example/simple.txt +++ b/doc/en/example/simple.txt @@ -41,9 +41,9 @@ F ================================= FAILURES ================================= _______________________________ test_answer ________________________________ - + cmdopt = 'type1' - + def test_answer(cmdopt): if cmdopt == "type1": print ("first") @@ -51,9 +51,9 @@ print ("second") > assert 0 # to see what was printed E assert 0 - + test_sample.py:6: AssertionError - ----------------------------- Captured stdout ------------------------------ + --------------------------- Captured stdout call --------------------------- first 1 failed in 0.01 seconds @@ -63,9 +63,9 @@ F ================================= FAILURES ================================= _______________________________ test_answer ________________________________ - + cmdopt = 'type2' - + def test_answer(cmdopt): if cmdopt == "type1": print ("first") @@ -73,9 +73,9 @@ print ("second") > assert 0 # to see what was printed E assert 0 - + test_sample.py:6: AssertionError - ----------------------------- Captured stdout ------------------------------ + --------------------------- Captured stdout call --------------------------- second 1 failed in 0.01 seconds @@ -108,7 +108,7 @@ $ py.test =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 0 items ============================= in 0.00 seconds ============================= @@ -152,12 +152,12 @@ $ py.test -rs # "-rs" means report details on the little 's' =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 2 items test_module.py .s ========================= short test summary info ========================== - SKIP [1] /tmp/doc-exec-70/conftest.py:9: need --runslow option to run + SKIP [1] /tmp/doc-exec-147/conftest.py:9: need --runslow option to run =================== 1 passed, 1 skipped in 0.01 seconds ==================== @@ -165,7 +165,7 @@ $ py.test --runslow =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 2 items test_module.py .. @@ -256,7 +256,7 @@ $ py.test =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 project deps: mylib-1.1 collected 0 items @@ -279,7 +279,7 @@ $ py.test -v =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python info1: did you know that ... did you? collecting ... collected 0 items @@ -290,7 +290,7 @@ $ py.test =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 0 items ============================= in 0.00 seconds ============================= @@ -322,7 +322,7 @@ $ py.test --durations=3 =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 3 items test_some_are_slow.py ... @@ -330,7 +330,7 @@ ========================= slowest 3 test durations ========================= 0.20s call test_some_are_slow.py::test_funcslow2 0.10s call test_some_are_slow.py::test_funcslow1 - 0.00s setup test_some_are_slow.py::test_funcfast + 0.00s setup test_some_are_slow.py::test_funcslow2 ========================= 3 passed in 0.31 seconds ========================= incremental testing - test steps @@ -383,7 +383,7 @@ $ py.test -rx =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 4 items test_step.py .Fx. @@ -391,7 +391,7 @@ ================================= FAILURES ================================= ____________________ TestUserHandling.test_modification ____________________ - self = + self = def test_modification(self): > assert 0 @@ -453,7 +453,7 @@ $ py.test =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 7 items test_step.py .Fx. @@ -463,17 +463,17 @@ ================================== ERRORS ================================== _______________________ ERROR at setup of test_root ________________________ - file /tmp/doc-exec-70/b/test_error.py, line 1 + file /tmp/doc-exec-147/b/test_error.py, line 1 def test_root(db): # no db here, will error out fixture 'db' not found - available fixtures: pytestconfig, capfd, monkeypatch, capsys, recwarn, tmpdir + available fixtures: tmpdir, monkeypatch, pytestconfig, recwarn, capsys, capfd use 'py.test --fixtures [testpath]' for help on them. - /tmp/doc-exec-70/b/test_error.py:1 + /tmp/doc-exec-147/b/test_error.py:1 ================================= FAILURES ================================= ____________________ TestUserHandling.test_modification ____________________ - self = + self = def test_modification(self): > assert 0 @@ -482,20 +482,20 @@ test_step.py:9: AssertionError _________________________________ test_a1 __________________________________ - db = + db = def test_a1(db): > assert 0, db # to show value - E AssertionError: + E AssertionError: a/test_db.py:2: AssertionError _________________________________ test_a2 __________________________________ - db = + db = def test_a2(db): > assert 0, db # to show value - E AssertionError: + E AssertionError: a/test_db2.py:2: AssertionError ========== 3 failed, 2 passed, 1 xfailed, 1 error in 0.03 seconds ========== @@ -553,7 +553,7 @@ $ py.test test_module.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 2 items test_module.py FF @@ -561,7 +561,7 @@ ================================= FAILURES ================================= ________________________________ test_fail1 ________________________________ - tmpdir = local('/tmp/pytest-1012/test_fail10') + tmpdir = local('/tmp/pytest-28/test_fail10') def test_fail1(tmpdir): > assert 0 @@ -580,7 +580,7 @@ you will have a "failures" file which contains the failing test ids:: $ cat failures - test_module.py::test_fail1 (/tmp/pytest-1012/test_fail10) + test_module.py::test_fail1 (/tmp/pytest-28/test_fail10) test_module.py::test_fail2 Making test result information available in fixtures @@ -643,7 +643,7 @@ $ py.test -s test_module.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 3 items test_module.py Esetting up a test failed! test_module.py::test_setup_fails diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/example/special.txt --- a/doc/en/example/special.txt +++ b/doc/en/example/special.txt @@ -69,4 +69,4 @@ .test other .test_unit1 method called . - 4 passed in 0.01 seconds + 4 passed in 0.03 seconds diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/fixture.txt --- a/doc/en/fixture.txt +++ b/doc/en/fixture.txt @@ -76,7 +76,7 @@ $ py.test test_smtpsimple.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 1 items test_smtpsimple.py F @@ -84,7 +84,7 @@ ================================= FAILURES ================================= ________________________________ test_ehlo _________________________________ - smtp = + smtp = def test_ehlo(smtp): response, msg = smtp.ehlo() @@ -94,7 +94,7 @@ E assert 0 test_smtpsimple.py:12: AssertionError - ========================= 1 failed in 0.21 seconds ========================= + ========================= 1 failed in 0.15 seconds ========================= In the failure traceback we see that the test function was called with a ``smtp`` argument, the ``smtplib.SMTP()`` instance created by the fixture @@ -194,7 +194,7 @@ $ py.test test_module.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 2 items test_module.py FF @@ -202,7 +202,7 @@ ================================= FAILURES ================================= ________________________________ test_ehlo _________________________________ - smtp = + smtp = def test_ehlo(smtp): response = smtp.ehlo() @@ -214,7 +214,7 @@ test_module.py:6: AssertionError ________________________________ test_noop _________________________________ - smtp = + smtp = def test_noop(smtp): response = smtp.noop() @@ -223,7 +223,7 @@ E assert 0 test_module.py:11: AssertionError - ========================= 2 failed in 0.23 seconds ========================= + ========================= 2 failed in 0.16 seconds ========================= You see the two ``assert 0`` failing and more importantly you can also see that the same (module-scoped) ``smtp`` object was passed into the two @@ -271,7 +271,7 @@ $ py.test -s -q --tb=no FFteardown smtp - 2 failed in 0.21 seconds + 2 failed in 0.16 seconds We see that the ``smtp`` instance is finalized after the two tests finished execution. Note that if we decorated our fixture @@ -312,7 +312,7 @@ $ py.test -s -q --tb=no FF - 2 failed in 0.59 seconds + 2 failed in 0.17 seconds Let's quickly create another test module that actually sets the server URL in its module namespace:: @@ -331,8 +331,8 @@ ================================= FAILURES ================================= ______________________________ test_showhelo _______________________________ test_anothersmtp.py:5: in test_showhelo - > assert 0, smtp.helo() - E AssertionError: (250, 'mail.python.org') + assert 0, smtp.helo() + E AssertionError: (250, 'mail.python.org') voila! The ``smtp`` fixture function picked up our mail server name from the module namespace. @@ -379,7 +379,7 @@ ================================= FAILURES ================================= __________________________ test_ehlo[merlinux.eu] __________________________ - smtp = + smtp = def test_ehlo(smtp): response = smtp.ehlo() @@ -391,7 +391,7 @@ test_module.py:6: AssertionError __________________________ test_noop[merlinux.eu] __________________________ - smtp = + smtp = def test_noop(smtp): response = smtp.noop() @@ -402,20 +402,20 @@ test_module.py:11: AssertionError ________________________ test_ehlo[mail.python.org] ________________________ - smtp = + smtp = def test_ehlo(smtp): response = smtp.ehlo() assert response[0] == 250 > assert "merlinux" in response[1] - E assert 'merlinux' in 'mail.python.org\nSIZE 25600000\nETRN\nSTARTTLS\nENHANCEDSTATUSCODES\n8BITMIME\nDSN' + E assert 'merlinux' in 'mail.python.org\nSIZE 25600000\nETRN\nSTARTTLS\nENHANCEDSTATUSCODES\n8BITMIME\nDSN\nSMTPUTF8' test_module.py:5: AssertionError - ----------------------------- Captured stdout ------------------------------ - finalizing + -------------------------- Captured stdout setup --------------------------- + finalizing ________________________ test_noop[mail.python.org] ________________________ - smtp = + smtp = def test_noop(smtp): response = smtp.noop() @@ -424,7 +424,7 @@ E assert 0 test_module.py:11: AssertionError - 4 failed in 6.06 seconds + 4 failed in 5.62 seconds We see that our two test functions each ran twice, against the different ``smtp`` instances. Note also, that with the ``mail.python.org`` @@ -464,13 +464,13 @@ $ py.test -v test_appsetup.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python collecting ... collected 2 items - test_appsetup.py:12: test_smtp_exists[merlinux.eu] PASSED - test_appsetup.py:12: test_smtp_exists[mail.python.org] PASSED + test_appsetup.py at 12::test_smtp_exists[merlinux.eu] PASSED + test_appsetup.py at 12::test_smtp_exists[mail.python.org] PASSED - ========================= 2 passed in 6.42 seconds ========================= + ========================= 2 passed in 6.27 seconds ========================= Due to the parametrization of ``smtp`` the test will run twice with two different ``App`` instances and respective smtp servers. There is no @@ -528,26 +528,26 @@ $ py.test -v -s test_module.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 -- /home/hpk/p/pytest/.tox/regen/bin/python + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 -- /home/hpk/p/pytest/.tox/regen/bin/python collecting ... collected 8 items - test_module.py:15: test_0[1] test0 1 + test_module.py at 15::test_0[1] test0 1 PASSED - test_module.py:15: test_0[2] test0 2 + test_module.py at 15::test_0[2] test0 2 PASSED - test_module.py:17: test_1[mod1] create mod1 + test_module.py at 17::test_1[mod1] create mod1 test1 mod1 PASSED - test_module.py:19: test_2[1-mod1] test2 1 mod1 + test_module.py at 19::test_2[1-mod1] test2 1 mod1 PASSED - test_module.py:19: test_2[2-mod1] test2 2 mod1 + test_module.py at 19::test_2[2-mod1] test2 2 mod1 PASSED - test_module.py:17: test_1[mod2] create mod2 + test_module.py at 17::test_1[mod2] create mod2 test1 mod2 PASSED - test_module.py:19: test_2[1-mod2] test2 1 mod2 + test_module.py at 19::test_2[1-mod2] test2 1 mod2 PASSED - test_module.py:19: test_2[2-mod2] test2 2 mod2 + test_module.py at 19::test_2[2-mod2] test2 2 mod2 PASSED ========================= 8 passed in 0.01 seconds ========================= diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/getting-started.txt --- a/doc/en/getting-started.txt +++ b/doc/en/getting-started.txt @@ -27,7 +27,7 @@ To check your installation has installed the correct version:: $ py.test --version - This is pytest version 2.5.2, imported from /home/hpk/p/pytest/.tox/regen/local/lib/python2.7/site-packages/pytest.pyc + This is pytest version 2.6.0, imported from /home/hpk/p/pytest/.tox/regen/local/lib/python2.7/site-packages/pytest.pyc If you get an error checkout :ref:`installation issues`. @@ -49,19 +49,19 @@ $ py.test =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 1 items - + test_sample.py F - + ================================= FAILURES ================================= _______________________________ test_answer ________________________________ - + def test_answer(): > assert func(3) == 5 E assert 4 == 5 E + where 4 = func(3) - + test_sample.py:5: AssertionError ========================= 1 failed in 0.01 seconds ========================= @@ -97,7 +97,7 @@ $ py.test -q test_sysexit.py . - 1 passed in 0.01 seconds + 1 passed in 0.00 seconds .. todo:: For further ways to assert exceptions see the `raises` @@ -126,14 +126,14 @@ .F ================================= FAILURES ================================= ____________________________ TestClass.test_two ____________________________ - - self = - + + self = + def test_two(self): x = "hello" > assert hasattr(x, 'check') E assert hasattr('hello', 'check') - + test_class.py:8: AssertionError 1 failed, 1 passed in 0.01 seconds @@ -162,17 +162,17 @@ F ================================= FAILURES ================================= _____________________________ test_needsfiles ______________________________ - - tmpdir = local('/tmp/pytest-1008/test_needsfiles0') - + + tmpdir = local('/tmp/pytest-24/test_needsfiles0') + def test_needsfiles(tmpdir): print tmpdir > assert 0 E assert 0 - + test_tmpdir.py:3: AssertionError - ----------------------------- Captured stdout ------------------------------ - /tmp/pytest-1008/test_needsfiles0 + --------------------------- Captured stdout call --------------------------- + /tmp/pytest-24/test_needsfiles0 1 failed in 0.01 seconds Before the test runs, a unique-per-test-invocation temporary directory diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/parametrize.txt --- a/doc/en/parametrize.txt +++ b/doc/en/parametrize.txt @@ -53,7 +53,7 @@ $ py.test =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 3 items test_expectation.py ..F @@ -100,7 +100,7 @@ $ py.test =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 3 items test_expectation.py ..x @@ -170,8 +170,8 @@ def test_valid_string(stringinput): > assert stringinput.isalpha() - E assert () - E + where = '!'.isalpha + E assert () + E + where = '!'.isalpha test_strings.py:3: AssertionError 1 failed in 0.01 seconds @@ -185,7 +185,7 @@ $ py.test -q -rs test_strings.py s ========================= short test summary info ========================== - SKIP [1] /home/hpk/p/pytest/.tox/regen/local/lib/python2.7/site-packages/_pytest/python.py:1110: got empty parameter set, function test_valid_string at /tmp/doc-exec-24/test_strings.py:1 + SKIP [1] /home/hpk/p/pytest/.tox/regen/local/lib/python2.7/site-packages/_pytest/python.py:1139: got empty parameter set, function test_valid_string at /tmp/doc-exec-100/test_strings.py:1 1 skipped in 0.01 seconds For further examples, you might want to look at :ref:`more diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/skipping.txt --- a/doc/en/skipping.txt +++ b/doc/en/skipping.txt @@ -159,7 +159,7 @@ example $ py.test -rx xfail_demo.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 6 items xfail_demo.py xxxxxx @@ -176,7 +176,7 @@ XFAIL xfail_demo.py::test_hello6 reason: reason - ======================== 6 xfailed in 0.04 seconds ========================= + ======================== 6 xfailed in 0.05 seconds ========================= .. _`skip/xfail with parametrize`: diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/tmpdir.txt --- a/doc/en/tmpdir.txt +++ b/doc/en/tmpdir.txt @@ -29,7 +29,7 @@ $ py.test test_tmpdir.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 1 items test_tmpdir.py F @@ -37,7 +37,7 @@ ================================= FAILURES ================================= _____________________________ test_create_file _____________________________ - tmpdir = local('/tmp/pytest-1009/test_create_file0') + tmpdir = local('/tmp/pytest-25/test_create_file0') def test_create_file(tmpdir): p = tmpdir.mkdir("sub").join("hello.txt") diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/unittest.txt --- a/doc/en/unittest.txt +++ b/doc/en/unittest.txt @@ -88,7 +88,7 @@ $ py.test test_unittest_db.py =========================== test session starts ============================ - platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2 + platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 2 items test_unittest_db.py FF @@ -101,7 +101,7 @@ def test_method1(self): assert hasattr(self, "db") > assert 0, self.db # fail for demo purposes - E AssertionError: + E AssertionError: test_unittest_db.py:9: AssertionError ___________________________ MyTest.test_method2 ____________________________ @@ -110,10 +110,10 @@ def test_method2(self): > assert 0, self.db # fail for demo purposes - E AssertionError: + E AssertionError: test_unittest_db.py:12: AssertionError - ========================= 2 failed in 0.01 seconds ========================= + ========================= 2 failed in 0.04 seconds ========================= This default pytest traceback shows that the two test methods share the same ``self.db`` instance which was our intention @@ -160,7 +160,7 @@ $ py.test -q test_unittest_cleandir.py . - 1 passed in 0.01 seconds + 1 passed in 0.03 seconds ... gives us one passed test because the ``initdir`` fixture function was executed ahead of the ``test_method``. diff -r 808a74ee97be149c9db577091fb5a7c09f069805 -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c doc/en/yieldfixture.txt --- a/doc/en/yieldfixture.txt +++ b/doc/en/yieldfixture.txt @@ -51,7 +51,7 @@ test called .teardown after yield - 1 passed in 0.00 seconds + 1 passed in 0.01 seconds We can also seamlessly use the new syntax with ``with`` statements. Let's simplify the above ``passwd`` fixture:: 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 Jul 17 17:21:54 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 17 Jul 2014 15:21:54 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: mention next open trainings at EP2014 and in Freiburg in November 2014 Message-ID: <20140717152154.31572.14600@app11.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/bcc205692757/ Changeset: bcc205692757 User: hpk42 Date: 2014-07-17 17:21:45 Summary: mention next open trainings at EP2014 and in Freiburg in November 2014 Affected #: 2 files diff -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c -r bcc2056927578d6c3f155497b738199f8fab1bc9 doc/en/index.txt --- a/doc/en/index.txt +++ b/doc/en/index.txt @@ -1,7 +1,12 @@ .. _features: -.. second training: `professional testing with Python `_ , 25-27th November 2013, Leipzig. +.. sidebar:: Next Open Trainings + + `improving your automated testing with pytest `_, July 25th 2014, Berlin, Germany + + `professional testing with pytest and tox `_, 24-26th November 2014, Freiburg, Germany + pytest: helps you write better programs ============================================= diff -r 902bf34b5c9b92fa8048f2e680e1a1d2469ab12c -r bcc2056927578d6c3f155497b738199f8fab1bc9 doc/en/talks.txt --- a/doc/en/talks.txt +++ b/doc/en/talks.txt @@ -2,6 +2,12 @@ Talks and Tutorials ========================== +.. sidebar:: Next Open Trainings + + `improving your automated testing with pytest `_, July 25th 2014, Berlin, Germany + + `professional testing with pytest and tox `_, 24-26th November 2014, Freiburg, Germany + .. _`funcargs`: funcargs.html Tutorial examples and blog postings 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 Jul 20 08:52:19 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 20 Jul 2014 06:52:19 -0000 Subject: [Pytest-commit] commit/pytest-xdist: 2 new changesets Message-ID: <20140720065219.18281.28179@app10.ash-private.bitbucket.org> 2 new commits in pytest-xdist: https://bitbucket.org/hpk42/pytest-xdist/commits/b8195374a4aa/ Changeset: b8195374a4aa User: hpk42 Date: 2014-07-05 17:34:56 Summary: depend on latest py dev version to support "--boxed" properly Affected #: 1 file diff -r 5ba5bdb77d302b621508bde6fdca37349f7d17d7 -r b8195374a4aa758a5f09562acd4d669d9f53cad8 setup.py --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ packages = ['xdist'], entry_points = {'pytest11': ['xdist = xdist.plugin'],}, zip_safe=False, - install_requires = ['execnet>=1.1', 'pytest>=2.4.2'], + install_requires = ['execnet>=1.1', 'pytest>=2.4.2', 'py>=1.4.21.dev3'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', https://bitbucket.org/hpk42/pytest-xdist/commits/35661a1ed8b5/ Changeset: 35661a1ed8b5 User: hpk42 Date: 2014-07-20 08:51:53 Summary: bump version, add py34 to tox.ini Affected #: 3 files diff -r b8195374a4aa758a5f09562acd4d669d9f53cad8 -r 35661a1ed8b5c542fbee90206a0e5ddbefd7f729 setup.py --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="pytest-xdist", - version='1.11.dev1', + version='1.11', description='py.test xdist plugin for distributed testing and loop-on-failing modes', long_description=open('README.txt').read(), license='MIT', @@ -13,7 +13,7 @@ packages = ['xdist'], entry_points = {'pytest11': ['xdist = xdist.plugin'],}, zip_safe=False, - install_requires = ['execnet>=1.1', 'pytest>=2.4.2', 'py>=1.4.21.dev3'], + install_requires = ['execnet>=1.1', 'pytest>=2.4.2', 'py>=1.4.22'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', diff -r b8195374a4aa758a5f09562acd4d669d9f53cad8 -r 35661a1ed8b5c542fbee90206a0e5ddbefd7f729 tox.ini --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py26,py32,py33,py27,py27-pexpect,py33-pexpect,py26,py26-old,py33-old +envlist=py26,py32,py33,py34,py27,py27-pexpect,py33-pexpect,py26,py26-old,py33-old [testenv] changedir=testing diff -r b8195374a4aa758a5f09562acd4d669d9f53cad8 -r 35661a1ed8b5c542fbee90206a0e5ddbefd7f729 xdist/__init__.py --- a/xdist/__init__.py +++ b/xdist/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '1.11.dev1' +__version__ = '1.11' Repository URL: https://bitbucket.org/hpk42/pytest-xdist/ -- 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 Jul 20 13:15:30 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 20 Jul 2014 11:15:30 -0000 Subject: [Pytest-commit] commit/pytest: 5 new changesets Message-ID: <20140720111530.371.5344@app14.ash-private.bitbucket.org> 5 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/ac7cccd443f3/ Changeset: ac7cccd443f3 User: hpk42 Date: 2014-07-17 17:22:44 Summary: bump doc version Affected #: 1 file diff -r bcc2056927578d6c3f155497b738199f8fab1bc9 -r ac7cccd443f3cdd1d0231a99413927656b5dcc41 doc/en/conf.py --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -17,8 +17,8 @@ # # The full version, including alpha/beta/rc tags. # The short X.Y version. -version = "2.5.2" -release = "2.5.2" +version = "2.6" +release = "2.6.0" import sys, os https://bitbucket.org/hpk42/pytest/commits/60725b17a9d1/ Changeset: 60725b17a9d1 User: hpk42 Date: 2014-07-20 11:07:18 Summary: fix release announce Affected #: 1 file diff -r 51fb835529406c3e9a4ee70b8fd99c77efdf7006 -r 60725b17a9d1af4100abb8be3f9f4ddf6262bf34 doc/en/announce/release-2.6.0.txt --- a/doc/en/announce/release-2.6.0.txt +++ b/doc/en/announce/release-2.6.0.txt @@ -1,4 +1,4 @@ -pytest-2.6.0: fixes +pytest-2.6.0: shorter tracebacks, new warning system, test runner compat =========================================================================== pytest is a mature Python testing tool with more than a 1000 tests https://bitbucket.org/hpk42/pytest/commits/8ce584c4248b/ Changeset: 8ce584c4248b User: hpk42 Date: 2014-07-20 13:03:11 Summary: Added tag 2.6.0 for changeset 60725b17a9d1 Affected #: 1 file diff -r 60725b17a9d1af4100abb8be3f9f4ddf6262bf34 -r 8ce584c4248b212b365a8fe46d6271c91c001fa0 .hgtags --- a/.hgtags +++ b/.hgtags @@ -66,3 +66,4 @@ a064ad64d167508a8e9e73766b1a4e6bd10c85db 2.5.0 039d543d1ca02a716c0b0de9a7131beb8021e8a2 2.5.1 421d3b4d150d901de24b1cbeb8955547b1420483 2.5.2 +60725b17a9d1af4100abb8be3f9f4ddf6262bf34 2.6.0 https://bitbucket.org/hpk42/pytest/commits/84e72a2a1848/ Changeset: 84e72a2a1848 User: hpk42 Date: 2014-07-20 13:07:38 Summary: some notes about upcoming trainings Affected #: 2 files diff -r 8ce584c4248b212b365a8fe46d6271c91c001fa0 -r 84e72a2a1848a7c6f0a7c716641af0507570eb51 doc/en/contents.txt --- a/doc/en/contents.txt +++ b/doc/en/contents.txt @@ -1,3 +1,9 @@ + +.. note:: + + `improving your automated testing with pytest `_, July 25th 2014, Berlin, Germany + + `professional testing with pytest and tox `_, 24-26th November 2014, Freiburg, Germany .. _toc: diff -r 8ce584c4248b212b365a8fe46d6271c91c001fa0 -r 84e72a2a1848a7c6f0a7c716641af0507570eb51 doc/en/index.txt --- a/doc/en/index.txt +++ b/doc/en/index.txt @@ -1,7 +1,7 @@ .. _features: -.. sidebar:: Next Open Trainings +.. note:: `improving your automated testing with pytest `_, July 25th 2014, Berlin, Germany https://bitbucket.org/hpk42/pytest/commits/88af949b9611/ Changeset: 88af949b9611 User: hpk42 Date: 2014-07-20 13:15:21 Summary: merge Affected #: 1 file diff -r 84e72a2a1848a7c6f0a7c716641af0507570eb51 -r 88af949b9611494e2c65d528f9e565b00fb7e8ca doc/en/conf.py --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -17,8 +17,8 @@ # # The full version, including alpha/beta/rc tags. # The short X.Y version. -version = "2.5.2" -release = "2.5.2" +version = "2.6" +release = "2.6.0" import sys, os 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 Jul 20 13:15:52 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 20 Jul 2014 11:15:52 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Added tag 2.6.0 for changeset 88af949b9611 Message-ID: <20140720111552.32171.20106@app12.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/853ffb854a48/ Changeset: 853ffb854a48 User: hpk42 Date: 2014-07-20 13:15:44 Summary: Added tag 2.6.0 for changeset 88af949b9611 Affected #: 1 file diff -r 88af949b9611494e2c65d528f9e565b00fb7e8ca -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 .hgtags --- a/.hgtags +++ b/.hgtags @@ -67,3 +67,5 @@ 039d543d1ca02a716c0b0de9a7131beb8021e8a2 2.5.1 421d3b4d150d901de24b1cbeb8955547b1420483 2.5.2 60725b17a9d1af4100abb8be3f9f4ddf6262bf34 2.6.0 +60725b17a9d1af4100abb8be3f9f4ddf6262bf34 2.6.0 +88af949b9611494e2c65d528f9e565b00fb7e8ca 2.6.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 Sun Jul 20 17:21:21 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 20 Jul 2014 15:21:21 -0000 Subject: [Pytest-commit] commit/pytest-xdist: 2 new changesets Message-ID: <20140720152121.32443.91041@app07.ash-private.bitbucket.org> 2 new commits in pytest-xdist: https://bitbucket.org/hpk42/pytest-xdist/commits/e95235ad5f8e/ Changeset: e95235ad5f8e User: hpk42 Date: 2014-07-20 16:41:03 Summary: fix pytest issue503: avoid random re-setup of broad scoped fixtures (anything above function). Affected #: 5 files diff -r 35661a1ed8b5c542fbee90206a0e5ddbefd7f729 -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,14 @@ -XXX +1.11 ------------------------- -- fix pytest/xdist issue485 (also depends on py-1.4.21.dev1): +- fix pytest/xdist issue485 (also depends on py-1.4.22): attach stdout/stderr on --boxed processes that die. +- fix pytest/xdist issue503: make sure that a node has usually + two items to execute to avoid scoped fixtures to be torn down + pre-maturely (fixture teardown/setup is "nextitem" sensitive). + Thanks to Andreas Pelme for bug analysis and failing test. + 1.10 ------------------------- diff -r 35661a1ed8b5c542fbee90206a0e5ddbefd7f729 -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 testing/acceptance_test.py --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1,3 +1,4 @@ +import pytest import py import sys @@ -459,3 +460,29 @@ result.stdout.fnmatch_lines([ "*1 passed*", ]) + + +def test_fixture_scope_caching_issue503(testdir): + p1 = testdir.makepyfile(""" + import pytest + + @pytest.fixture(scope='session') + def fix(): + assert fix.counter == 0, 'session fixture was invoked multiple times' + fix.counter += 1 + fix.counter = 0 + + def test_a(fix): + pass + + def test_b(fix): + pass + """) + result = testdir.runpytest(p1, '-v', '-n1') + assert result.ret == 0 + result.stdout.fnmatch_lines([ + "*2 passed*", + ]) + + + diff -r 35661a1ed8b5c542fbee90206a0e5ddbefd7f729 -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 testing/test_dsession.py --- a/testing/test_dsession.py +++ b/testing/test_dsession.py @@ -98,15 +98,15 @@ assert sched.node2collection[node1] == collection assert sched.node2collection[node2] == collection sched.init_distribute() + assert not sched.pending + assert not sched.tests_finished() + assert len(node1.sent) == 2 + assert len(node2.sent) == 0 + assert node1.sent == [0, 1] + sched.remove_item(node1, node1.sent[0]) assert sched.tests_finished() - assert len(node1.sent) == 1 - assert len(node2.sent) == 1 - x = sorted(node1.sent + node2.sent) - assert x == [0, 1] - sched.remove_item(node1, node1.sent[0]) - sched.remove_item(node2, node2.sent[0]) + sched.remove_item(node1, node1.sent[1]) assert sched.tests_finished() - assert not sched.pending def test_init_distribute_chunksize(self): sched = LoadScheduling(2) @@ -114,22 +114,25 @@ node2 = MockNode() sched.addnode(node1) sched.addnode(node2) - col = ["xyz"] * (3) + col = ["xyz"] * (6) sched.addnode_collection(node1, col) sched.addnode_collection(node2, col) sched.init_distribute() #assert not sched.tests_finished() sent1 = node1.sent sent2 = node2.sent - chunkitems = col[:1] - assert (sent1 == [0] and sent2 == [1]) or ( - sent1 == [1] and sent2 == [0]) + assert sent1 == [0, 1] + assert sent2 == [2, 3] + assert sched.pending == [4, 5] assert sched.node2pending[node1] == sent1 assert sched.node2pending[node2] == sent2 - assert len(sched.pending) == 1 - for node in (node1, node2): - for i in sched.node2pending[node]: - sched.remove_item(node, i) + assert len(sched.pending) == 2 + sched.remove_item(node1, 0) + assert node1.sent == [0, 1, 4] + assert sched.pending == [5] + assert node2.sent == [2, 3] + sched.remove_item(node1, 1) + assert node1.sent == [0, 1, 4, 5] assert not sched.pending def test_add_remove_node(self): diff -r 35661a1ed8b5c542fbee90206a0e5ddbefd7f729 -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 xdist/dsession.py --- a/xdist/dsession.py +++ b/xdist/dsession.py @@ -49,7 +49,7 @@ if not pending: return crashitem = self.node2collection[node][pending.pop(0)] - # XXX what about the rest of pending? + # XXX do or report something wrt the remaining per-node pending items? return crashitem def init_distribute(self): @@ -58,11 +58,13 @@ node.send_runtest_all() pending[:] = range(len(self.node2collection[node])) + class LoadScheduling: def __init__(self, numnodes, log=None): self.numnodes = numnodes self.node2pending = {} self.node2collection = {} + self.nodes = [] self.pending = [] if log is None: self.log = py.log.Producer("loadsched") @@ -75,13 +77,14 @@ def addnode(self, node): self.node2pending[node] = [] + self.nodes.append(node) def tests_finished(self): - if not self.collection_is_completed or self.pending: + if not self.collection_is_completed: return False - #for items in self.node2pending.values(): - # if items: - # return False + for pending in self.node2pending.values(): + if len(pending) >= 2: + return False return True def addnode_collection(self, node, collection): @@ -92,37 +95,46 @@ self.collection_is_completed = True def remove_item(self, node, item_index, duration=0): - node_pending = self.node2pending[node] - node_pending.remove(item_index) - # pre-load items-to-test if the node may become ready + self.node2pending[node].remove(item_index) + self.check_schedule(node, duration=duration) + def check_schedule(self, node, duration=0): if self.pending: - if duration >= 0.1 and node_pending: - # seems the node is doing long-running tests - # so let's rather wait with sending new items - return - # how many nodes do we have remaining per node roughly? + # how many nodes do we have? num_nodes = len(self.node2pending) # if our node goes below a heuristic minimum, fill it out to # heuristic maximum items_per_node_min = max( - 1, len(self.pending) // num_nodes // 4) + 2, len(self.pending) // num_nodes // 4) items_per_node_max = max( - 1, len(self.pending) // num_nodes // 2) - if len(node_pending) <= items_per_node_min: - num_send = items_per_node_max - len(node_pending) + 1 + 2, len(self.pending) // num_nodes // 2) + node_pending = self.node2pending[node] + if len(node_pending) < items_per_node_min: + if duration >= 0.1 and len(node_pending) >= 2: + # seems the node is doing long-running tests + # and has enough items to continue + # so let's rather wait with sending new items + return + num_send = items_per_node_max - len(node_pending) self._send_tests(node, num_send) self.log("num items waiting for node:", len(self.pending)) #self.log("node2pending:", self.node2pending) def remove_node(self, node): + self.nodes.remove(node) pending = self.node2pending.pop(node) if not pending: return - # the node must have crashed on the item if there are pending ones + # the node has crashed on the item if there are pending ones + # and we are told to remove the node crashitem = self.collection[pending.pop(0)] + + # put the remaining items back to the general pending list self.pending.extend(pending) + # see if some nodes can pick the remaining tests up already + for node in self.node2pending: + self.check_schedule(node) return crashitem def init_distribute(self): @@ -147,9 +159,9 @@ # how many items per node do we have about? items_per_node = len(self.collection) // len(self.node2pending) # take a fraction of tests for initial distribution - node_chunksize = max(items_per_node // 4, 1) + node_chunksize = max(items_per_node // 4, 2) # and initialize each node with a chunk of tests - for node in self.node2pending: + for node in self.nodes: self._send_tests(node, node_chunksize) #f = open("/tmp/sent", "w") diff -r 35661a1ed8b5c542fbee90206a0e5ddbefd7f729 -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 xdist/remote.py --- a/xdist/remote.py +++ b/xdist/remote.py @@ -51,9 +51,12 @@ elif name == "runtests_all": torun.extend(range(len(session.items))) self.log("items to run:", torun) - while torun: + # only run if we have an item and a next item + while len(torun) >= 2: self.run_tests(torun) if name == "shutdown": + if torun: + self.run_tests(torun) break return True https://bitbucket.org/hpk42/pytest-xdist/commits/4c6c39266031/ Changeset: 4c6c39266031 User: hpk42 Date: 2014-07-20 16:56:21 Summary: fix various flakes issues and add "flakes" to tox tests Affected #: 10 files diff -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 -r 4c6c3926603135015691bcf537ed8dfe15b59874 testing/acceptance_test.py --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1,6 +1,4 @@ -import pytest import py -import sys class TestDistribution: def test_n1_pass(self, testdir): @@ -194,7 +192,7 @@ assert dest.join(subdir.basename).check(dir=1) def test_data_exchange(self, testdir): - c1 = testdir.makeconftest(""" + testdir.makeconftest(""" # This hook only called on master. def pytest_configure_node(node): node.slaveinput['a'] = 42 @@ -251,7 +249,7 @@ def test_keyboard_interrupt_dist(self, testdir): # xxx could be refined to check for return code - p = testdir.makepyfile(""" + testdir.makepyfile(""" def test_sleep(): import time time.sleep(10) @@ -301,7 +299,7 @@ class TestTerminalReporting: def test_pass_skip_fail(self, testdir): - p = testdir.makepyfile(""" + testdir.makepyfile(""" import py def test_ok(): pass @@ -323,7 +321,7 @@ ]) def test_fail_platinfo(self, testdir): - p = testdir.makepyfile(""" + testdir.makepyfile(""" def test_func(): assert 0 """) diff -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 -r 4c6c3926603135015691bcf537ed8dfe15b59874 testing/conftest.py --- a/testing/conftest.py +++ b/testing/conftest.py @@ -7,14 +7,11 @@ def pytest_addoption(parser): parser.addoption('--gx', - action="append", dest="gspecs", + action="append", dest="gspecs", help=("add a global test environment, XSpec-syntax. ")) def pytest_funcarg__specssh(request): return getspecssh(request.config) -def getgspecs(config): - return [execnet.XSpec(spec) - for spec in config.getvalueorskip("gspecs")] # configuration information for tests def getgspecs(config): diff -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 -r 4c6c3926603135015691bcf537ed8dfe15b59874 testing/test_dsession.py --- a/testing/test_dsession.py +++ b/testing/test_dsession.py @@ -4,7 +4,6 @@ EachScheduling, report_collection_diff, ) -from _pytest import main as outcome import py import pytest import execnet diff -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 -r 4c6c3926603135015691bcf537ed8dfe15b59874 testing/test_looponfail.py --- a/testing/test_looponfail.py +++ b/testing/test_looponfail.py @@ -42,7 +42,7 @@ def test_dirchange(self, tmpdir): tmp = tmpdir - hello = tmp.ensure("dir", "hello.py") + tmp.ensure("dir", "hello.py") sd = StatRecorder([tmp]) assert not sd.fil(tmp.join("dir")) diff -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 -r 4c6c3926603135015691bcf537ed8dfe15b59874 testing/test_remote.py --- a/testing/test_remote.py +++ b/testing/test_remote.py @@ -3,7 +3,6 @@ from xdist.remote import serialize_report import execnet queue = py.builtin._tryimport("queue", "Queue") -from py.builtin import print_ import marshal WAIT_TIMEOUT = 10.0 @@ -26,7 +25,7 @@ use_callback = False def __init__(self, request): - self.testdir = testdir = request.getfuncargvalue("testdir") + self.testdir = request.getfuncargvalue("testdir") self.request = request self.events = queue.Queue() @@ -140,7 +139,7 @@ class TestSlaveInteractor: def test_basic_collect_and_runtests(self, slave): - p = slave.testdir.makepyfile(""" + slave.testdir.makepyfile(""" def test_func(): pass """) @@ -170,7 +169,7 @@ assert 'slaveoutput' in ev.kwargs def test_remote_collect_skip(self, slave): - p = slave.testdir.makepyfile(""" + slave.testdir.makepyfile(""" import py py.test.skip("hello") """) @@ -187,7 +186,7 @@ assert not ev.kwargs['ids'] def test_remote_collect_fail(self, slave): - p = slave.testdir.makepyfile("""aasd qwe""") + slave.testdir.makepyfile("""aasd qwe""") slave.setup() ev = slave.popevent("collectionstart") assert not ev.kwargs @@ -201,7 +200,7 @@ assert not ev.kwargs['ids'] def test_runtests_all(self, slave): - p = slave.testdir.makepyfile(""" + slave.testdir.makepyfile(""" def test_func(): pass def test_func2(): pass """) @@ -228,7 +227,7 @@ def test_happy_run_events_converted(self, testdir, slave): py.test.xfail("implement a simple test for event production") assert not slave.use_callback - p = slave.testdir.makepyfile(""" + slave.testdir.makepyfile(""" def test_func(): pass """) diff -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 -r 4c6c3926603135015691bcf537ed8dfe15b59874 testing/test_slavemanage.py --- a/testing/test_slavemanage.py +++ b/testing/test_slavemanage.py @@ -1,5 +1,4 @@ import py -import os import execnet from xdist.slavemanage import HostRSync, NodeManager @@ -108,7 +107,7 @@ return mysetup(request) def test_hrsync_filter(self, mysetup): - source, dest = mysetup.source, mysetup.dest + source, _ = mysetup.source, mysetup.dest # noqa source.ensure("dir", "file.txt") source.ensure(".svn", "entries") source.ensure(".somedotfile", "moreentries") @@ -139,7 +138,7 @@ @py.test.mark.xfail def test_rsync_roots_no_roots(self, testdir, mysetup): mysetup.source.ensure("dir1", "file1").write("hello") - config = testdir.parseconfig(source) + config = testdir.parseconfig(mysetup.source) nodemanager = NodeManager(config, ["popen//chdir=%s" % mysetup.dest]) #assert nodemanager.config.topdir == source == config.topdir nodemanager.makegateways() @@ -194,11 +193,11 @@ def test_rsyncignore(self, testdir, mysetup): source, dest = mysetup.source, mysetup.dest dir2 = source.ensure("dir1", "dir2", dir=1) - dir5 = source.ensure("dir5", "dir6", "bogus") - dirf = source.ensure("dir5", "file") + source.ensure("dir5", "dir6", "bogus") + source.ensure("dir5", "file") dir2.ensure("hello") - dirfoo = source.ensure("foo", "bar") - dirbar = source.ensure("bar", "foo") + source.ensure("foo", "bar") + source.ensure("bar", "foo") source.join("tox.ini").write(py.std.textwrap.dedent(""" [pytest] rsyncdirs = dir1 dir5 @@ -217,7 +216,7 @@ assert not dest.join('bar').check() def test_optimise_popen(self, testdir, mysetup): - source, dest = mysetup.source, mysetup.dest + source = mysetup.source specs = ["popen"] * 3 source.join("conftest.py").write("rsyncdirs = ['a']") source.ensure('a', dir=1) diff -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 -r 4c6c3926603135015691bcf537ed8dfe15b59874 tox.ini --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py26,py32,py33,py34,py27,py27-pexpect,py33-pexpect,py26,py26-old,py33-old +envlist=py26,py32,py33,py34,py27,py27-pexpect,py33-pexpect,py26,py26-old,py33-old,flakes [testenv] changedir=testing @@ -13,6 +13,11 @@ deps={[testenv]deps} pexpect +[testenv:flakes] +changedir= +deps = pytest-flakes>=0.2 +commands = py.test --flakes -m flakes testing xdist + [testenv:py26-old] deps= pytest==2.4.2 diff -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 -r 4c6c3926603135015691bcf537ed8dfe15b59874 xdist/dsession.py --- a/xdist/dsession.py +++ b/xdist/dsession.py @@ -1,4 +1,3 @@ -import sys import difflib import pytest @@ -295,7 +294,7 @@ self.slave_errordown(node, "keyboard-interrupt") return crashitem = self.sched.remove_node(node) - #assert not crashitem, (crashitem, node) + assert not crashitem, (crashitem, node) if self.shuttingdown and not self.sched.hasnodes(): self.session_finished = True diff -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 -r 4c6c3926603135015691bcf537ed8dfe15b59874 xdist/looponfail.py --- a/xdist/looponfail.py +++ b/xdist/looponfail.py @@ -87,7 +87,7 @@ result = self.runsession() failures, reports, collection_failed = result if collection_failed: - reports = ["Collection failed, keeping previous failure set"] + pass # "Collection failed, keeping previous failure set" else: uniq_failures = [] for failure in failures: @@ -109,7 +109,6 @@ def init_slave_session(channel, args, option_dict): import os, sys - import py outchannel = channel.gateway.newchannel() sys.stdout = sys.stderr = outchannel.makefile('w') channel.send(outchannel) diff -r e95235ad5f8e07f3ba0cad07a0d76e899066ffd1 -r 4c6c3926603135015691bcf537ed8dfe15b59874 xdist/remote.py --- a/xdist/remote.py +++ b/xdist/remote.py @@ -128,6 +128,7 @@ if __name__ == '__channelexec__': + channel = channel # noqa # python3.2 is not concurrent import safe, so let's play it safe # https://bitbucket.org/hpk42/pytest/issue/347/pytest-xdist-and-python-32 if sys.version_info[:2] == (3,2): Repository URL: https://bitbucket.org/hpk42/pytest-xdist/ -- 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 Mon Jul 21 11:21:37 2014 From: issues-reply at bitbucket.org (Christian Theune) Date: Mon, 21 Jul 2014 09:21:37 -0000 Subject: [Pytest-commit] Issue #543: Should tmpdir clean up after itself? (hpk42/pytest) Message-ID: <20140721092137.23929.94955@app03.ash-private.bitbucket.org> New issue 543: Should tmpdir clean up after itself? https://bitbucket.org/hpk42/pytest/issue/543/should-tmpdir-clean-up-after-itself Christian Theune: We noticed that tmpdir isn't cleaning up after itself. Is there a reason why not? The docs don't mention it. Otherwise: I'd be happy to provide a patch to make tmpdir clean up after itself. From issues-reply at bitbucket.org Wed Jul 23 08:43:16 2014 From: issues-reply at bitbucket.org (mapi) Date: Wed, 23 Jul 2014 06:43:16 -0000 Subject: [Pytest-commit] Issue #544: pytest 2.6 remove some strings in pathname (hpk42/pytest) Message-ID: <20140723064316.2777.71285@app02.ash-private.bitbucket.org> New issue 544: pytest 2.6 remove some strings in pathname https://bitbucket.org/hpk42/pytest/issue/544/pytest-26-remove-some-strings-in-pathname mapi: in pytest 2.6 If pathname include '@[0-9]' , these strings would removed. here is some sample. ``` #!shell % ls > mycode at 2 mycode at abc % py.test mycode at 2/test > ============================= test session starts ============================== > platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 > ERROR: file not found: mycode/test > > =============================== in 0.00 seconds =============================== % py.test mycode at abc/test > ============================= test session starts ============================== > platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 > collected 0 items > > =============================== in 0.00 seconds =============================== ``` `mycode at abc/test` is works, but `mycode at 2/test` replaced `mycode/test` From issues-reply at bitbucket.org Thu Jul 24 13:43:02 2014 From: issues-reply at bitbucket.org (Florian Ludwig) Date: Thu, 24 Jul 2014 11:43:02 -0000 Subject: [Pytest-commit] Issue #181: hash / number sign cannot be escaped in tox.ini (hpk42/tox) Message-ID: <20140724114302.8221.44842@app10.ash-private.bitbucket.org> New issue 181: hash / number sign cannot be escaped in tox.ini https://bitbucket.org/hpk42/tox/issue/181/hash-number-sign-cannot-be-escaped-in Florian Ludwig: The tox.ini parser does not provide a way to use the #-character as it is always interpreted as comment-begin. The built-in python ini parser avoids the problem altogether by allowing comments to only start at line beginning. With pip urls often containing the character this breaks several use cases. From issues-reply at bitbucket.org Fri Jul 25 01:17:40 2014 From: issues-reply at bitbucket.org (Patrick Putnam) Date: Thu, 24 Jul 2014 23:17:40 -0000 Subject: [Pytest-commit] Issue #545: _pytest/mark.py pytest_collection_modifyitems orders results differently across threads (hpk42/pytest) Message-ID: <20140724231740.15719.74583@app13.ash-private.bitbucket.org> New issue 545: _pytest/mark.py pytest_collection_modifyitems orders results differently across threads https://bitbucket.org/hpk42/pytest/issue/545/_pytest-markpy Patrick Putnam: I had an issue running marked tests in multi-threaded fashion where each thread would seem to get the tests in a different order once the marks had been applied. This would cause report_collection_diff in xdist/dsession.py to report errors like: INTERNALERROR> AssertionError: Different tests were collected between gw0 and gw2. The difference is: INTERNALERROR> --- gw0 INTERNALERROR> INTERNALERROR> +++ gw2 INTERNALERROR> INTERNALERROR> @@ -1,3 +1,3 @@ INTERNALERROR> INTERNALERROR> +scripts/Departments.py::TestMain::()::test_select_department_palette INTERNALERROR> scripts/Header.py::TestMain::()::test_login INTERNALERROR> scripts/Header.py::TestMain::()::test_basic_search INTERNALERROR> -scripts/Departments.py::TestMain::()::test_select_department_palette (Same test, just different location). I managed to fix this with a one-line change in mark.py: 64 remaining = [] 65 deselected = [] >66 for colitem in sorted(items): # sorted items preserves ordering across threads 67 if keywordexpr and not matchkeyword(colitem, keywordexpr): 68 deselected.append(colitem) I'm not sure if I'm doing something wrong somewhere, or if I've found an actual bug, but I've been running with this fix for a week now and everything seems to be working well. Should I submit this as a pull request, or am I doing something incorrect somewhere, and if so how what's the best way to figure that out? From issues-reply at bitbucket.org Fri Jul 25 17:15:40 2014 From: issues-reply at bitbucket.org (Joren Retel) Date: Fri, 25 Jul 2014 15:15:40 -0000 Subject: [Pytest-commit] Issue #546: cython functions not discovered/recognized (hpk42/pytest) Message-ID: <20140725151540.8911.93519@app06.ash-private.bitbucket.org> New issue 546: cython functions not discovered/recognized https://bitbucket.org/hpk42/pytest/issue/546/cython-functions-not-discovered-recognized Joren Retel: Cython functions are currently not recognized. The problem seems to be that inspect.isfunction() uses isinstance(obj, types.FunctionType) which fails for cython functions (_pytest/python.py:227). Attached a small example package. To reproduce, install cython and compile the code with: python setup.py build_ext --inplace the cython test 'test something' should be discoverable by opening test_everything.py. From issues-reply at bitbucket.org Sat Jul 26 18:42:19 2014 From: issues-reply at bitbucket.org (=?utf-8?q?Ignacy_Soko=C5=82owski?=) Date: Sat, 26 Jul 2014 16:42:19 -0000 Subject: [Pytest-commit] Issue #547: ``capsys``: ``AttributeError`` is raised and output is not captured when using the ``-s`` option (hpk42/pytest) Message-ID: <20140726164219.13180.59677@app07.ash-private.bitbucket.org> New issue 547: ``capsys``: ``AttributeError`` is raised and output is not captured when using the ``-s`` option https://bitbucket.org/hpk42/pytest/issue/547/capsys-attributeerror-is-raised-and-output Ignacy Soko?owski: Test: ``` #!python def print_foo(): print('foo') def test_print_foo(capsys): print_foo() output, __ = capsys.readouterr() assert output == 'foo\n' ``` Output for ``py.test``: ``` test_capsys.py . ``` Output for ``py.test -s`` ``` test_capsys.py foo F ================================= FAILURES ================================== ______________________________ test_print_foo _______________________________ capsys = <_pytest.capture.CaptureFixture object at 0x7fdf0ed8d9b0> def test_print_foo(capsys): print_foo() > output, __ = capsys.readouterr() test_capsys.py:9: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.capture.CaptureFixture object at 0x7fdf0ed8d9b0> def readouterr(self): try: return self._capture.readouterr() except AttributeError: > return self._outerr E AttributeError: 'CaptureFixture' object has no attribute '_outerr' ../env/lib/python3.4/site-packages/_pytest/capture.py:205: AttributeError ``` Looks like the ``CaptureFixture._start`` method, where the ``_capture`` attribute is set, is not called. This test fails on pytest 2.6 but passes on 2.5.2. On 2.5.2 the print output is captured even though the ``-s`` option was set. I think it's the expected behavior. From commits-noreply at bitbucket.org Mon Jul 28 09:55:09 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 07:55:09 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Close branch xfail-cause Message-ID: <20140728075509.10155.85677@app08.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/d67df704bd1d/ Changeset: d67df704bd1d Branch: xfail-cause User: hpk42 Date: 2014-07-28 09:55:02 Summary: Close branch xfail-cause Affected #: 0 files 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 Jul 28 09:55:09 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 07:55:09 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Merged in squisher/pytest/xfail-cause (pull request #183) Message-ID: <20140728075509.3081.81665@app05.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/3decf8c96e3c/ Changeset: 3decf8c96e3c User: hpk42 Date: 2014-07-28 09:55:02 Summary: Merged in squisher/pytest/xfail-cause (pull request #183) Add mark.xfail argument raises so that unexpected exceptions show up as test failures. Affected #: 5 files diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 3decf8c96e3c85b722302a2618b088ed93a8628a _pytest/skipping.py --- a/_pytest/skipping.py +++ b/_pytest/skipping.py @@ -26,11 +26,13 @@ "http://pytest.org/latest/skipping.html" ) config.addinivalue_line("markers", - "xfail(condition, reason=None, run=True): mark the the test function " + "xfail(condition, reason=None, run=True, raises=None): mark the the test function " "as an expected failure if eval(condition) has a True value. " "Optionally specify a reason for better reporting and run=False if " - "you don't even want to execute the test function. See " - "http://pytest.org/latest/skipping.html" + "you don't even want to execute the test function. If only specific " + "exception(s) are expected, you can list them in raises, and if the test fails " + "in other ways, it will be reported as a true failure. " + "See http://pytest.org/latest/skipping.html" ) def pytest_namespace(): @@ -60,6 +62,12 @@ def wasvalid(self): return not hasattr(self, 'exc') + def invalidraise(self, exc): + raises = self.get('raises') + if not raises: + return + return not isinstance(exc, raises) + def istrue(self): try: return self._istrue() @@ -171,7 +179,11 @@ if not item.config.option.runxfail: if evalxfail.wasvalid() and evalxfail.istrue(): if call.excinfo: - rep.outcome = "skipped" + if evalxfail.invalidraise(call.excinfo.value): + rep.outcome = "failed" + return rep + else: + rep.outcome = "skipped" elif call.when == "call": rep.outcome = "failed" else: diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 3decf8c96e3c85b722302a2618b088ed93a8628a doc/en/assert.txt --- a/doc/en/assert.txt +++ b/doc/en/assert.txt @@ -95,6 +95,22 @@ provide you with helpful output in case of failures such as *no exception* or *wrong exception*. +Note that it is also possible to specify a "raises" argument to +``pytest.mark.xfail``, which checks that the test is failing in a more +specific way than just having any exception raised:: + + @pytest.mark.xfail(raises=IndexError) + def test_f(): + f() + +Using ``pytest.raises`` is likely to be better for cases where you are testing +exceptions your own code is deliberately raising, whereas using +``@pytest.mark.xfail`` with a check function is probably better for something +like documenting unfixed bugs (where the test describes what "should" happen) +or bugs in dependencies. + + + .. _newreport: Making use of context-sensitive comparisons diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 3decf8c96e3c85b722302a2618b088ed93a8628a doc/en/example/xfail_demo.py --- a/doc/en/example/xfail_demo.py +++ b/doc/en/example/xfail_demo.py @@ -23,3 +23,8 @@ def test_hello6(): pytest.xfail("reason") + + at xfail(raises=IndexError) +def test_hello7() + x = [] + x[1] = 1 diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 3decf8c96e3c85b722302a2618b088ed93a8628a doc/en/skipping.txt --- a/doc/en/skipping.txt +++ b/doc/en/skipping.txt @@ -149,6 +149,11 @@ def test_function(): ... +If you want to be more specific as to why the test is failing, you can specify +a single exception, or a list of exceptions, in the ``raises`` argument. Then +the test will be reported as a regular failure if it fails with an +exception not mentioned in ``raises``. + You can furthermore prevent the running of an "xfail" test or specify a reason such as a bug ID or similar. Here is a simple test file with the several usages: diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 3decf8c96e3c85b722302a2618b088ed93a8628a testing/test_skipping.py --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -330,6 +330,26 @@ "*1 xfailed*", ]) + + @pytest.mark.parametrize('expected, actual, matchline', + [('TypeError', 'TypeError', "*1 xfailed*"), + ('(AttributeError, TypeError)', 'TypeError', "*1 xfailed*"), + ('TypeError', 'IndexError', "*1 failed*"), + ('(AttributeError, TypeError)', 'IndexError', "*1 failed*"), + ]) + def test_xfail_raises(self, expected, actual, matchline, testdir): + p = testdir.makepyfile(""" + import pytest + @pytest.mark.xfail(raises=%s) + def test_raises(): + raise %s() + """ % (expected, actual)) + result = testdir.runpytest(p) + result.stdout.fnmatch_lines([ + matchline, + ]) + + class TestXFailwithSetupTeardown: def test_failing_setup_issue9(self, testdir): testdir.makepyfile(""" @@ -575,7 +595,7 @@ result = testdir.runpytest("--markers") result.stdout.fnmatch_lines([ "*skipif(*condition)*skip*", - "*xfail(*condition, reason=None, run=True)*expected failure*", + "*xfail(*condition, reason=None, run=True, raises=None)*expected failure*", ]) def test_xfail_test_setup_exception(testdir): @@ -617,7 +637,6 @@ *2 skipped* """) - class TestBooleanCondition: def test_skipif(self, testdir): testdir.makepyfile(""" 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 Jul 28 09:55:09 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 07:55:09 -0000 Subject: [Pytest-commit] commit/pytest: 6 new changesets Message-ID: <20140728075509.15942.91925@app11.ash-private.bitbucket.org> 6 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/712b5fcfc605/ Changeset: 712b5fcfc605 Branch: xfail-cause User: da... at mcbf.net Date: 2014-07-26 15:11:05 Summary: Add mark.xfail argument raises so that unexpected exceptions show up as test failures. Affected #: 2 files diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 712b5fcfc605043261980789e63cdb01b7f49345 _pytest/skipping.py --- a/_pytest/skipping.py +++ b/_pytest/skipping.py @@ -26,11 +26,13 @@ "http://pytest.org/latest/skipping.html" ) config.addinivalue_line("markers", - "xfail(condition, reason=None, run=True): mark the the test function " + "xfail(condition, reason=None, run=True, raises=None): mark the the test function " "as an expected failure if eval(condition) has a True value. " "Optionally specify a reason for better reporting and run=False if " - "you don't even want to execute the test function. See " - "http://pytest.org/latest/skipping.html" + "you don't even want to execute the test function. If only specific " + "exception(s) are expected, you can list them in raises, and if the test fails " + "in other ways, it will be reported as a true failure. " + "See http://pytest.org/latest/skipping.html" ) def pytest_namespace(): @@ -60,6 +62,15 @@ def wasvalid(self): return not hasattr(self, 'exc') + def invalidraise(self, exctype): + raises = self.get('raises') + if not raises: + return + if isinstance(raises, tuple): + return exctype not in raises + else: + return raises != exctype + def istrue(self): try: return self._istrue() @@ -171,7 +182,11 @@ if not item.config.option.runxfail: if evalxfail.wasvalid() and evalxfail.istrue(): if call.excinfo: - rep.outcome = "skipped" + if evalxfail.invalidraise(call.excinfo.type): + rep.outcome = "failed" + return rep + else: + rep.outcome = "skipped" elif call.when == "call": rep.outcome = "failed" else: diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 712b5fcfc605043261980789e63cdb01b7f49345 testing/test_skipping.py --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -330,6 +330,53 @@ "*1 xfailed*", ]) + def test_xfail_raises_match(self, testdir): + p = testdir.makepyfile(""" + import pytest + @pytest.mark.xfail(raises=TypeError) + def test_raises(): + raise TypeError() + """) + result = testdir.runpytest(p) + result.stdout.fnmatch_lines([ + "*1 xfailed*", + ]) + + def test_xfail_raises_mismatch(self, testdir): + p = testdir.makepyfile(""" + import pytest + @pytest.mark.xfail(raises=IndexError) + def test_raises(): + raise TypeError() + """) + result = testdir.runpytest(p) + result.stdout.fnmatch_lines([ + "*1 failed*", + ]) + def test_xfail_raises_tuple_match(self, testdir): + p = testdir.makepyfile(""" + import pytest + @pytest.mark.xfail(raises=(AttributeError, TypeError)) + def test_raises(): + raise TypeError() + """) + result = testdir.runpytest(p) + result.stdout.fnmatch_lines([ + "*1 xfailed*", + ]) + + def test_xfail_raises_tuple_mismatch(self, testdir): + p = testdir.makepyfile(""" + import pytest + @pytest.mark.xfail(raises=(AttributeError, IndexError)) + def test_raises(): + raise TypeError() + """) + result = testdir.runpytest(p) + result.stdout.fnmatch_lines([ + "*1 failed*", + ]) + class TestXFailwithSetupTeardown: def test_failing_setup_issue9(self, testdir): testdir.makepyfile(""" @@ -575,7 +622,7 @@ result = testdir.runpytest("--markers") result.stdout.fnmatch_lines([ "*skipif(*condition)*skip*", - "*xfail(*condition, reason=None, run=True)*expected failure*", + "*xfail(*condition, reason=None, run=True, raises=None)*expected failure*", ]) def test_xfail_test_setup_exception(testdir): @@ -617,7 +664,6 @@ *2 skipped* """) - class TestBooleanCondition: def test_skipif(self, testdir): testdir.makepyfile(""" https://bitbucket.org/hpk42/pytest/commits/86566f7208bf/ Changeset: 86566f7208bf Branch: xfail-cause User: da... at mcbf.net Date: 2014-07-26 17:46:50 Summary: isinstance() on exception value instead of comparing types, consolidate tests Affected #: 2 files diff -r 712b5fcfc605043261980789e63cdb01b7f49345 -r 86566f7208bf9302fad9ce7aa5c4d455df74ebd3 _pytest/skipping.py --- a/_pytest/skipping.py +++ b/_pytest/skipping.py @@ -62,14 +62,11 @@ def wasvalid(self): return not hasattr(self, 'exc') - def invalidraise(self, exctype): + def invalidraise(self, exc): raises = self.get('raises') if not raises: return - if isinstance(raises, tuple): - return exctype not in raises - else: - return raises != exctype + return not isinstance(exc, raises) def istrue(self): try: @@ -182,7 +179,7 @@ if not item.config.option.runxfail: if evalxfail.wasvalid() and evalxfail.istrue(): if call.excinfo: - if evalxfail.invalidraise(call.excinfo.type): + if evalxfail.invalidraise(call.excinfo.value): rep.outcome = "failed" return rep else: diff -r 712b5fcfc605043261980789e63cdb01b7f49345 -r 86566f7208bf9302fad9ce7aa5c4d455df74ebd3 testing/test_skipping.py --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -330,52 +330,27 @@ "*1 xfailed*", ]) - def test_xfail_raises_match(self, testdir): + + @pytest.mark.parametrize('params', [('TypeError', 'TypeError', "*1 xfailed*"), + ('(AttributeError, TypeError)', 'TypeError', + "*1 xfailed*"), + ('TypeError', 'IndexError', "*1 failed*"), + ('(AttributeError, TypeError)', 'IndexError', + "*1 failed*"), + ]) + def test_xfail_raises(self, params, testdir): + expected, actual, matchline = params p = testdir.makepyfile(""" import pytest - @pytest.mark.xfail(raises=TypeError) + @pytest.mark.xfail(raises=%s) def test_raises(): - raise TypeError() - """) + raise %s() + """ % (expected, actual)) result = testdir.runpytest(p) result.stdout.fnmatch_lines([ - "*1 xfailed*", + matchline, ]) - def test_xfail_raises_mismatch(self, testdir): - p = testdir.makepyfile(""" - import pytest - @pytest.mark.xfail(raises=IndexError) - def test_raises(): - raise TypeError() - """) - result = testdir.runpytest(p) - result.stdout.fnmatch_lines([ - "*1 failed*", - ]) - def test_xfail_raises_tuple_match(self, testdir): - p = testdir.makepyfile(""" - import pytest - @pytest.mark.xfail(raises=(AttributeError, TypeError)) - def test_raises(): - raise TypeError() - """) - result = testdir.runpytest(p) - result.stdout.fnmatch_lines([ - "*1 xfailed*", - ]) - - def test_xfail_raises_tuple_mismatch(self, testdir): - p = testdir.makepyfile(""" - import pytest - @pytest.mark.xfail(raises=(AttributeError, IndexError)) - def test_raises(): - raise TypeError() - """) - result = testdir.runpytest(p) - result.stdout.fnmatch_lines([ - "*1 failed*", - ]) class TestXFailwithSetupTeardown: def test_failing_setup_issue9(self, testdir): https://bitbucket.org/hpk42/pytest/commits/b8b2c7d3d129/ Changeset: b8b2c7d3d129 Branch: xfail-cause User: da... at mcbf.net Date: 2014-07-26 18:10:32 Summary: Update documentation Affected #: 3 files diff -r 86566f7208bf9302fad9ce7aa5c4d455df74ebd3 -r b8b2c7d3d129ca21350fdd9f554c9639ae63ab98 doc/en/assert.txt --- a/doc/en/assert.txt +++ b/doc/en/assert.txt @@ -95,6 +95,22 @@ provide you with helpful output in case of failures such as *no exception* or *wrong exception*. +Note that it is also possible to specify a "raises" argument to +``pytest.mark.xfail``, which checks that the test is failing in a more +specific way than just having any exception raised:: + + @pytest.mark.xfail(raises=IndexError) + def test_f(): + f() + +Using ``pytest.raises`` is likely to be better for cases where you are testing +exceptions your own code is deliberately raising, whereas using +``@pytest.mark.xfail`` with a check function is probably better for something +like documenting unfixed bugs (where the test describes what "should" happen) +or bugs in dependencies. + + + .. _newreport: Making use of context-sensitive comparisons diff -r 86566f7208bf9302fad9ce7aa5c4d455df74ebd3 -r b8b2c7d3d129ca21350fdd9f554c9639ae63ab98 doc/en/example/xfail_demo.py --- a/doc/en/example/xfail_demo.py +++ b/doc/en/example/xfail_demo.py @@ -23,3 +23,8 @@ def test_hello6(): pytest.xfail("reason") + + at xfail(raises=IndexError) +def test_hello7() + x = [] + assert x[1] == 1 diff -r 86566f7208bf9302fad9ce7aa5c4d455df74ebd3 -r b8b2c7d3d129ca21350fdd9f554c9639ae63ab98 doc/en/skipping.txt --- a/doc/en/skipping.txt +++ b/doc/en/skipping.txt @@ -149,6 +149,11 @@ def test_function(): ... +If you want to be more specific as to why the test is failing, you can specify +a single exception, or a list of exceptions, in the ``raises`` argument. Then +the test will be reported as a regular failure if it fails with an +exception not mentioned in ``raises``. + You can furthermore prevent the running of an "xfail" test or specify a reason such as a bug ID or similar. Here is a simple test file with the several usages: https://bitbucket.org/hpk42/pytest/commits/bbbbedb1af92/ Changeset: bbbbedb1af92 Branch: xfail-cause User: da... at mcbf.net Date: 2014-07-26 18:19:27 Summary: Directly pass multiple parameters with mark.parametrize() Affected #: 1 file diff -r b8b2c7d3d129ca21350fdd9f554c9639ae63ab98 -r bbbbedb1af9240ca346a87a218313da5a169f9ee testing/test_skipping.py --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -331,15 +331,13 @@ ]) - @pytest.mark.parametrize('params', [('TypeError', 'TypeError', "*1 xfailed*"), - ('(AttributeError, TypeError)', 'TypeError', - "*1 xfailed*"), - ('TypeError', 'IndexError', "*1 failed*"), - ('(AttributeError, TypeError)', 'IndexError', - "*1 failed*"), - ]) - def test_xfail_raises(self, params, testdir): - expected, actual, matchline = params + @pytest.mark.parametrize('expected, actual, matchline', + [('TypeError', 'TypeError', "*1 xfailed*"), + ('(AttributeError, TypeError)', 'TypeError', "*1 xfailed*"), + ('TypeError', 'IndexError', "*1 failed*"), + ('(AttributeError, TypeError)', 'IndexError', "*1 failed*"), + ]) + def test_xfail_raises(self, expected, actual, matchline, testdir): p = testdir.makepyfile(""" import pytest @pytest.mark.xfail(raises=%s) https://bitbucket.org/hpk42/pytest/commits/cdde7d5fbe9f/ Changeset: cdde7d5fbe9f Branch: xfail-cause User: da... at mcbf.net Date: 2014-07-26 18:24:55 Summary: Tiny example update for clarification Affected #: 1 file diff -r bbbbedb1af9240ca346a87a218313da5a169f9ee -r cdde7d5fbe9f83cb359e331ca2a3ea9a5aba19ca doc/en/example/xfail_demo.py --- a/doc/en/example/xfail_demo.py +++ b/doc/en/example/xfail_demo.py @@ -27,4 +27,4 @@ @xfail(raises=IndexError) def test_hello7() x = [] - assert x[1] == 1 + x[1] = 1 https://bitbucket.org/hpk42/pytest/commits/3decf8c96e3c/ Changeset: 3decf8c96e3c User: hpk42 Date: 2014-07-28 09:55:02 Summary: Merged in squisher/pytest/xfail-cause (pull request #183) Add mark.xfail argument raises so that unexpected exceptions show up as test failures. Affected #: 5 files diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 3decf8c96e3c85b722302a2618b088ed93a8628a _pytest/skipping.py --- a/_pytest/skipping.py +++ b/_pytest/skipping.py @@ -26,11 +26,13 @@ "http://pytest.org/latest/skipping.html" ) config.addinivalue_line("markers", - "xfail(condition, reason=None, run=True): mark the the test function " + "xfail(condition, reason=None, run=True, raises=None): mark the the test function " "as an expected failure if eval(condition) has a True value. " "Optionally specify a reason for better reporting and run=False if " - "you don't even want to execute the test function. See " - "http://pytest.org/latest/skipping.html" + "you don't even want to execute the test function. If only specific " + "exception(s) are expected, you can list them in raises, and if the test fails " + "in other ways, it will be reported as a true failure. " + "See http://pytest.org/latest/skipping.html" ) def pytest_namespace(): @@ -60,6 +62,12 @@ def wasvalid(self): return not hasattr(self, 'exc') + def invalidraise(self, exc): + raises = self.get('raises') + if not raises: + return + return not isinstance(exc, raises) + def istrue(self): try: return self._istrue() @@ -171,7 +179,11 @@ if not item.config.option.runxfail: if evalxfail.wasvalid() and evalxfail.istrue(): if call.excinfo: - rep.outcome = "skipped" + if evalxfail.invalidraise(call.excinfo.value): + rep.outcome = "failed" + return rep + else: + rep.outcome = "skipped" elif call.when == "call": rep.outcome = "failed" else: diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 3decf8c96e3c85b722302a2618b088ed93a8628a doc/en/assert.txt --- a/doc/en/assert.txt +++ b/doc/en/assert.txt @@ -95,6 +95,22 @@ provide you with helpful output in case of failures such as *no exception* or *wrong exception*. +Note that it is also possible to specify a "raises" argument to +``pytest.mark.xfail``, which checks that the test is failing in a more +specific way than just having any exception raised:: + + @pytest.mark.xfail(raises=IndexError) + def test_f(): + f() + +Using ``pytest.raises`` is likely to be better for cases where you are testing +exceptions your own code is deliberately raising, whereas using +``@pytest.mark.xfail`` with a check function is probably better for something +like documenting unfixed bugs (where the test describes what "should" happen) +or bugs in dependencies. + + + .. _newreport: Making use of context-sensitive comparisons diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 3decf8c96e3c85b722302a2618b088ed93a8628a doc/en/example/xfail_demo.py --- a/doc/en/example/xfail_demo.py +++ b/doc/en/example/xfail_demo.py @@ -23,3 +23,8 @@ def test_hello6(): pytest.xfail("reason") + + at xfail(raises=IndexError) +def test_hello7() + x = [] + x[1] = 1 diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 3decf8c96e3c85b722302a2618b088ed93a8628a doc/en/skipping.txt --- a/doc/en/skipping.txt +++ b/doc/en/skipping.txt @@ -149,6 +149,11 @@ def test_function(): ... +If you want to be more specific as to why the test is failing, you can specify +a single exception, or a list of exceptions, in the ``raises`` argument. Then +the test will be reported as a regular failure if it fails with an +exception not mentioned in ``raises``. + You can furthermore prevent the running of an "xfail" test or specify a reason such as a bug ID or similar. Here is a simple test file with the several usages: diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 3decf8c96e3c85b722302a2618b088ed93a8628a testing/test_skipping.py --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -330,6 +330,26 @@ "*1 xfailed*", ]) + + @pytest.mark.parametrize('expected, actual, matchline', + [('TypeError', 'TypeError', "*1 xfailed*"), + ('(AttributeError, TypeError)', 'TypeError', "*1 xfailed*"), + ('TypeError', 'IndexError', "*1 failed*"), + ('(AttributeError, TypeError)', 'IndexError', "*1 failed*"), + ]) + def test_xfail_raises(self, expected, actual, matchline, testdir): + p = testdir.makepyfile(""" + import pytest + @pytest.mark.xfail(raises=%s) + def test_raises(): + raise %s() + """ % (expected, actual)) + result = testdir.runpytest(p) + result.stdout.fnmatch_lines([ + matchline, + ]) + + class TestXFailwithSetupTeardown: def test_failing_setup_issue9(self, testdir): testdir.makepyfile(""" @@ -575,7 +595,7 @@ result = testdir.runpytest("--markers") result.stdout.fnmatch_lines([ "*skipif(*condition)*skip*", - "*xfail(*condition, reason=None, run=True)*expected failure*", + "*xfail(*condition, reason=None, run=True, raises=None)*expected failure*", ]) def test_xfail_test_setup_exception(testdir): @@ -617,7 +637,6 @@ *2 skipped* """) - class TestBooleanCondition: def test_skipif(self, testdir): testdir.makepyfile(""" 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 Jul 28 10:02:02 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 08:02:02 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: address issue170 by merging David Mohr's PR on adding "raises" as an optional Message-ID: <20140728080202.12108.76469@app07.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/c49801c86150/ Changeset: c49801c86150 User: hpk42 Date: 2014-07-28 09:59:22 Summary: address issue170 by merging David Mohr's PR on adding "raises" as an optional argument to pytest.mark.xfail. Affected #: 4 files diff -r 3decf8c96e3c85b722302a2618b088ed93a8628a -r c49801c86150891478719d8ca94505da2cf3f4e8 AUTHORS --- a/AUTHORS +++ b/AUTHORS @@ -43,3 +43,4 @@ Daniel Grana Andy Freeland Trevor Bekolay +David Mohr diff -r 3decf8c96e3c85b722302a2618b088ed93a8628a -r c49801c86150891478719d8ca94505da2cf3f4e8 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,13 @@ -NEXT (2.6) +NEXT +----------------------------------- + +- address issue170: allow pytest.mark.xfail(...) to specify expected exceptions via + an optional "raises=EXC" argument where EXC can be a single exception + or a tuple of exception classes. Thanks David Mohr for the complete + PR. + + +2.6 ----------------------------------- - Cache exceptions from fixtures according to their scope (issue 467). diff -r 3decf8c96e3c85b722302a2618b088ed93a8628a -r c49801c86150891478719d8ca94505da2cf3f4e8 _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.6.0' +__version__ = '2.6.1.dev1' diff -r 3decf8c96e3c85b722302a2618b088ed93a8628a -r c49801c86150891478719d8ca94505da2cf3f4e8 setup.py --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ name='pytest', description='pytest: simple powerful testing with Python', long_description=long_description, - version='2.6.0', + version='2.6.1.dev1', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], 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 Jul 28 10:31:34 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 08:31:34 -0000 Subject: [Pytest-commit] commit/pytest: 4 new changesets Message-ID: <20140728083134.7812.70715@app11.ash-private.bitbucket.org> 4 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/761d60bd87a6/ Changeset: 761d60bd87a6 Branch: mock-unittest-252 User: ticosax Date: 2014-07-26 17:26:18 Summary: Injection of fixture doesn't work when decorated with unittest.mock.patch This is a continuation of #182 Affected #: 1 file diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 761d60bd87a6794d9a25ca48aa7dff968ffc415b testing/python/integration.py --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -112,6 +112,26 @@ reprec = testdir.inline_run() reprec.assertoutcome(passed=1) + def test_unittest_mock_and_fixture(self, testdir): + pytest.importorskip("unittest.mock") + testdir.makepyfile(""" + import os.path + import unittest.mock + import pytest + + @pytest.fixture + def inject_me(): + pass + + @unittest.mock.patch.object(os.path, "abspath", + new=unittest.mock.MagicMock) + def test_hello(inject_me): + import os + os.path.abspath("hello") + """) + reprec = testdir.inline_run() + reprec.assertoutcome(passed=1) + def test_mock(self, testdir): pytest.importorskip("mock", "1.0.1") testdir.makepyfile(""" https://bitbucket.org/hpk42/pytest/commits/15115d747734/ Changeset: 15115d747734 Branch: mock-unittest-252 User: ticosax Date: 2014-07-27 10:43:50 Summary: Handle also unittest.mock Move handling in dedicated function to isolate its logic Affected #: 1 file diff -r 761d60bd87a6794d9a25ca48aa7dff968ffc415b -r 15115d747734b6431805e32411fa95999402502a _pytest/python.py --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1861,6 +1861,27 @@ return ("" % (self.argname, self.scope, self.baseid)) +def handle_mock_module_patching(function, startindex): + """ + Special treatment when test_function is decorated + by mock.patch + """ + for candidate_module_name in ('unittest.mock', 'mock'): + # stdlib comes first + try: + mock = sys.modules[candidate_module_name] + except KeyError: + pass + else: + for patching in getattr(function, "patchings", []): + if (not patching.attribute_name + and patching.new is mock.DEFAULT): + startindex += 1 + break + else: + startindex += len(getattr(function, "patchings", [])) + return startindex + def getfuncargnames(function, startindex=None): # XXX merge with main.py's varnames #assert not inspect.isclass(function) @@ -1870,13 +1891,7 @@ if startindex is None: startindex = inspect.ismethod(function) and 1 or 0 if realfunction != function: - mock = sys.modules.get('mock') - if mock is not None: - for patching in getattr(function, "patchings", []): - if not patching.attribute_name and patching.new is mock.DEFAULT: - startindex += 1 - else: - startindex += len(getattr(function, "patchings", [])) + startindex = handle_mock_module_patching(function, startindex) function = realfunction argnames = inspect.getargs(py.code.getrawcode(function))[0] defaults = getattr(function, 'func_defaults', https://bitbucket.org/hpk42/pytest/commits/06e38b54a90f/ Changeset: 06e38b54a90f Branch: mock-unittest-252 User: ticosax Date: 2014-07-27 12:11:39 Summary: unittest.mock from stdlib should come last Affected #: 1 file diff -r 15115d747734b6431805e32411fa95999402502a -r 06e38b54a90f9f7d74f3e5a28f0c0eeac7e44835 _pytest/python.py --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1866,8 +1866,10 @@ Special treatment when test_function is decorated by mock.patch """ - for candidate_module_name in ('unittest.mock', 'mock'): - # stdlib comes first + for candidate_module_name in ('mock', 'unittest.mock'): + # stdlib comes last, because mock might be also installed + # as a third party with upgraded version compare to + # unittest.mock try: mock = sys.modules[candidate_module_name] except KeyError: https://bitbucket.org/hpk42/pytest/commits/7b861c1de21d/ Changeset: 7b861c1de21d User: hpk42 Date: 2014-07-28 10:31:31 Summary: Merged in ticosax/pytest/mock-unittest-252 (pull request #184) Injection of fixture doesn't work when decorated with unittest.mock.patch Affected #: 2 files diff -r c49801c86150891478719d8ca94505da2cf3f4e8 -r 7b861c1de21df974bf015ee9b254bf266d73d300 _pytest/python.py --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1861,6 +1861,29 @@ return ("" % (self.argname, self.scope, self.baseid)) +def handle_mock_module_patching(function, startindex): + """ + Special treatment when test_function is decorated + by mock.patch + """ + for candidate_module_name in ('mock', 'unittest.mock'): + # stdlib comes last, because mock might be also installed + # as a third party with upgraded version compare to + # unittest.mock + try: + mock = sys.modules[candidate_module_name] + except KeyError: + pass + else: + for patching in getattr(function, "patchings", []): + if (not patching.attribute_name + and patching.new is mock.DEFAULT): + startindex += 1 + break + else: + startindex += len(getattr(function, "patchings", [])) + return startindex + def getfuncargnames(function, startindex=None): # XXX merge with main.py's varnames #assert not inspect.isclass(function) @@ -1870,13 +1893,7 @@ if startindex is None: startindex = inspect.ismethod(function) and 1 or 0 if realfunction != function: - mock = sys.modules.get('mock') - if mock is not None: - for patching in getattr(function, "patchings", []): - if not patching.attribute_name and patching.new is mock.DEFAULT: - startindex += 1 - else: - startindex += len(getattr(function, "patchings", [])) + startindex = handle_mock_module_patching(function, startindex) function = realfunction argnames = inspect.getargs(py.code.getrawcode(function))[0] defaults = getattr(function, 'func_defaults', diff -r c49801c86150891478719d8ca94505da2cf3f4e8 -r 7b861c1de21df974bf015ee9b254bf266d73d300 testing/python/integration.py --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -112,6 +112,26 @@ reprec = testdir.inline_run() reprec.assertoutcome(passed=1) + def test_unittest_mock_and_fixture(self, testdir): + pytest.importorskip("unittest.mock") + testdir.makepyfile(""" + import os.path + import unittest.mock + import pytest + + @pytest.fixture + def inject_me(): + pass + + @unittest.mock.patch.object(os.path, "abspath", + new=unittest.mock.MagicMock) + def test_hello(inject_me): + import os + os.path.abspath("hello") + """) + reprec = testdir.inline_run() + reprec.assertoutcome(passed=1) + def test_mock(self, testdir): pytest.importorskip("mock", "1.0.1") testdir.makepyfile(""" 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 Jul 28 10:31:35 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 08:31:35 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Merged in ticosax/pytest/mock-unittest-252 (pull request #184) Message-ID: <20140728083135.26153.94685@app02.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/7b861c1de21d/ Changeset: 7b861c1de21d User: hpk42 Date: 2014-07-28 10:31:31 Summary: Merged in ticosax/pytest/mock-unittest-252 (pull request #184) Injection of fixture doesn't work when decorated with unittest.mock.patch Affected #: 2 files diff -r c49801c86150891478719d8ca94505da2cf3f4e8 -r 7b861c1de21df974bf015ee9b254bf266d73d300 _pytest/python.py --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1861,6 +1861,29 @@ return ("" % (self.argname, self.scope, self.baseid)) +def handle_mock_module_patching(function, startindex): + """ + Special treatment when test_function is decorated + by mock.patch + """ + for candidate_module_name in ('mock', 'unittest.mock'): + # stdlib comes last, because mock might be also installed + # as a third party with upgraded version compare to + # unittest.mock + try: + mock = sys.modules[candidate_module_name] + except KeyError: + pass + else: + for patching in getattr(function, "patchings", []): + if (not patching.attribute_name + and patching.new is mock.DEFAULT): + startindex += 1 + break + else: + startindex += len(getattr(function, "patchings", [])) + return startindex + def getfuncargnames(function, startindex=None): # XXX merge with main.py's varnames #assert not inspect.isclass(function) @@ -1870,13 +1893,7 @@ if startindex is None: startindex = inspect.ismethod(function) and 1 or 0 if realfunction != function: - mock = sys.modules.get('mock') - if mock is not None: - for patching in getattr(function, "patchings", []): - if not patching.attribute_name and patching.new is mock.DEFAULT: - startindex += 1 - else: - startindex += len(getattr(function, "patchings", [])) + startindex = handle_mock_module_patching(function, startindex) function = realfunction argnames = inspect.getargs(py.code.getrawcode(function))[0] defaults = getattr(function, 'func_defaults', diff -r c49801c86150891478719d8ca94505da2cf3f4e8 -r 7b861c1de21df974bf015ee9b254bf266d73d300 testing/python/integration.py --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -112,6 +112,26 @@ reprec = testdir.inline_run() reprec.assertoutcome(passed=1) + def test_unittest_mock_and_fixture(self, testdir): + pytest.importorskip("unittest.mock") + testdir.makepyfile(""" + import os.path + import unittest.mock + import pytest + + @pytest.fixture + def inject_me(): + pass + + @unittest.mock.patch.object(os.path, "abspath", + new=unittest.mock.MagicMock) + def test_hello(inject_me): + import os + os.path.abspath("hello") + """) + reprec = testdir.inline_run() + reprec.assertoutcome(passed=1) + def test_mock(self, testdir): pytest.importorskip("mock", "1.0.1") testdir.makepyfile(""" 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 Jul 28 10:44:12 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 08:44:12 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: add changelog entry and refactor unittest.mock.patch fix a bit Message-ID: <20140728084412.7812.67625@app11.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/40c9e9432ff6/ Changeset: 40c9e9432ff6 User: hpk42 Date: 2014-07-28 10:34:01 Summary: add changelog entry and refactor unittest.mock.patch fix a bit Affected #: 3 files diff -r 7b861c1de21df974bf015ee9b254bf266d73d300 -r 40c9e9432ff68474553a702b718262ee8e2fa1ac AUTHORS --- a/AUTHORS +++ b/AUTHORS @@ -44,3 +44,4 @@ Andy Freeland Trevor Bekolay David Mohr +Nicolas Delaby diff -r 7b861c1de21df974bf015ee9b254bf266d73d300 -r 40c9e9432ff68474553a702b718262ee8e2fa1ac CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,9 @@ or a tuple of exception classes. Thanks David Mohr for the complete PR. +- fix integration of pytest with unittest.mock.patch decorator when + it uses the "new" argument. Thanks Nicolas Delaby for test and PR. + 2.6 ----------------------------------- diff -r 7b861c1de21df974bf015ee9b254bf266d73d300 -r 40c9e9432ff68474553a702b718262ee8e2fa1ac _pytest/python.py --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1861,28 +1861,17 @@ return ("" % (self.argname, self.scope, self.baseid)) -def handle_mock_module_patching(function, startindex): - """ - Special treatment when test_function is decorated - by mock.patch - """ - for candidate_module_name in ('mock', 'unittest.mock'): - # stdlib comes last, because mock might be also installed - # as a third party with upgraded version compare to - # unittest.mock - try: - mock = sys.modules[candidate_module_name] - except KeyError: - pass - else: - for patching in getattr(function, "patchings", []): - if (not patching.attribute_name - and patching.new is mock.DEFAULT): - startindex += 1 - break - else: - startindex += len(getattr(function, "patchings", [])) - return startindex +def num_mock_patch_args(function): + """ return number of arguments used up by mock arguments (if any) """ + patchings = getattr(function, "patchings", None) + if not patchings: + return 0 + mock = sys.modules.get("mock", sys.modules.get("unittest.mock", None)) + if mock is not None: + return len([p for p in patchings + if not p.attribute_name and p.new is mock.DEFAULT]) + return len(patchings) + def getfuncargnames(function, startindex=None): # XXX merge with main.py's varnames @@ -1893,7 +1882,7 @@ if startindex is None: startindex = inspect.ismethod(function) and 1 or 0 if realfunction != function: - startindex = handle_mock_module_patching(function, startindex) + startindex += num_mock_patch_args(function) function = realfunction argnames = inspect.getargs(py.code.getrawcode(function))[0] defaults = getattr(function, 'func_defaults', 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 Jul 28 12:14:36 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 10:14:36 -0000 Subject: [Pytest-commit] commit/pytest: 2 new changesets Message-ID: <20140728101436.19014.58177@app04.ash-private.bitbucket.org> 2 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/ed7bd81e5fb9/ Changeset: ed7bd81e5fb9 Branch: fix_initial_parsing User: hpk42 Date: 2014-07-28 11:48:37 Summary: fix conftest detection if commandline arguments contain "::" syntax Affected #: 3 files diff -r 40c9e9432ff68474553a702b718262ee8e2fa1ac -r ed7bd81e5fb9378bd069114c57e119e47b63edb0 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,9 @@ - fix integration of pytest with unittest.mock.patch decorator when it uses the "new" argument. Thanks Nicolas Delaby for test and PR. +- fix issue with detecting conftest files if the arguments contain + "::" node id specifications (copy pasted from "-v" output) + 2.6 ----------------------------------- diff -r 40c9e9432ff68474553a702b718262ee8e2fa1ac -r ed7bd81e5fb9378bd069114c57e119e47b63edb0 _pytest/config.py --- a/_pytest/config.py +++ b/_pytest/config.py @@ -485,6 +485,11 @@ testpaths = namespace.file_or_dir foundanchor = False for path in testpaths: + path = str(path) + # remove node-id syntax + i = path.find("::") + if i != -1: + path = path[:i] anchor = current.join(path, abs=1) if exists(anchor): # we found some file object self._try_load_conftest(anchor) diff -r 40c9e9432ff68474553a702b718262ee8e2fa1ac -r ed7bd81e5fb9378bd069114c57e119e47b63edb0 testing/test_conftest.py --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -237,3 +237,21 @@ """)) result = testdir.runpytest("sub") result.stdout.fnmatch_lines(["*1 passed*"]) + + +def test_conftest_found_with_double_dash(testdir): + sub = testdir.mkdir("sub") + sub.join("conftest.py").write(py.std.textwrap.dedent(""" + def pytest_addoption(parser): + parser.addoption("--hello-world", action="store_true") + """)) + p = sub.join("test_hello.py") + p.write(py.std.textwrap.dedent(""" + import pytest + def test_hello(found): + assert found == 1 + """)) + result = testdir.runpytest(str(p) + "@2::test_hello", "-h") + result.stdout.fnmatch_lines(""" + *--hello-world* + """) https://bitbucket.org/hpk42/pytest/commits/ae1f2ff32bfb/ Changeset: ae1f2ff32bfb Branch: fix_initial_parsing User: hpk42 Date: 2014-07-28 12:07:15 Summary: fix issue544 by only removing "@NUM" at the end of a part (parts are separated by "::") and if the part has an .py extension. Affected #: 3 files diff -r ed7bd81e5fb9378bd069114c57e119e47b63edb0 -r ae1f2ff32bfb93cabb8395de20d026364179ba02 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,8 @@ - fix issue with detecting conftest files if the arguments contain "::" node id specifications (copy pasted from "-v" output) +- fix issue544 by only removing "@NUM" at the end of "::" separated parts + and if the part has an ".py" extension 2.6 ----------------------------------- diff -r ed7bd81e5fb9378bd069114c57e119e47b63edb0 -r ae1f2ff32bfb93cabb8395de20d026364179ba02 _pytest/config.py --- a/_pytest/config.py +++ b/_pytest/config.py @@ -863,9 +863,13 @@ def node_with_line_number(string): - split = string.split('[') - split[0] = re.sub(r'@\d+', '', split[0]) - return '['.join(split) + newparts = [] + for part in string.split("::"): + m = re.match(r'.*\.py@\d+$', part) + if m is not None: + part = part[:part.rfind("@")] + newparts.append(part) + return "::".join(newparts) def setns(obj, dic): diff -r ed7bd81e5fb9378bd069114c57e119e47b63edb0 -r ae1f2ff32bfb93cabb8395de20d026364179ba02 testing/test_parseopt.py --- a/testing/test_parseopt.py +++ b/testing/test_parseopt.py @@ -146,8 +146,17 @@ assert args.S == False def test_parse_removes_line_number_from_positional_arguments(self, parser): - args = parser.parse(['path at 2::func', 'path2 at 5::func2[param with @]']) - assert getattr(args, parseopt.FILE_OR_DIR) == ['path::func', 'path2::func2[param with @]'] + args = parser.parse(['path.txt at 2::item', + 'path2.py::func2[param with .py at 123]', + 'path.py at 123', + 'hello/path.py at 123', + ]) + assert getattr(args, parseopt.FILE_OR_DIR) == [ + 'path.txt at 2::item', + 'path2.py::func2[param with .py at 123]', + 'path.py', + 'hello/path.py', + ] def test_parse_defaultgetter(self): def defaultget(option): 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 Jul 28 13:18:34 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 11:18:34 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: fix issue547 2.6 regression: capsys/capfd now work again when output capturing ("-s") is disabled. Message-ID: <20140728111834.17442.31604@app04.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/16fab48aa572/ Changeset: 16fab48aa572 User: hpk42 Date: 2014-07-28 13:17:37 Summary: fix issue547 2.6 regression: capsys/capfd now work again when output capturing ("-s") is disabled. Affected #: 3 files diff -r 40c9e9432ff68474553a702b718262ee8e2fa1ac -r 16fab48aa572f966878eecc12d7344ec1102d02e CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ NEXT ----------------------------------- +- fix issue547 capsys/capfd also work when output capturing ("-s") is disabled. + - address issue170: allow pytest.mark.xfail(...) to specify expected exceptions via an optional "raises=EXC" argument where EXC can be a single exception or a tuple of exception classes. Thanks David Mohr for the complete diff -r 40c9e9432ff68474553a702b718262ee8e2fa1ac -r 16fab48aa572f966878eecc12d7344ec1102d02e _pytest/capture.py --- a/_pytest/capture.py +++ b/_pytest/capture.py @@ -20,7 +20,7 @@ def pytest_addoption(parser): group = parser.getgroup("general") group._addoption( - '--capture', action="store", + '--capture', action="store", default="fd" if hasattr(os, "dup") else "sys", metavar="method", choices=['fd', 'sys', 'no'], help="per-test capturing method: one of fd|sys|no.") @@ -33,8 +33,6 @@ def pytest_load_initial_conftests(early_config, parser, args, __multicall__): ns = early_config.known_args_namespace pluginmanager = early_config.pluginmanager - if ns.capture == "no": - return capman = CaptureManager(ns.capture) pluginmanager.register(capman, "capturemanager") diff -r 40c9e9432ff68474553a702b718262ee8e2fa1ac -r 16fab48aa572f966878eecc12d7344ec1102d02e testing/test_capture.py --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -392,13 +392,14 @@ class TestCaptureFixture: - def test_std_functional(self, testdir): + @pytest.mark.parametrize("opt", [[], ["-s"]]) + def test_std_functional(self, testdir, opt): reprec = testdir.inline_runsource(""" def test_hello(capsys): print (42) out, err = capsys.readouterr() assert out.startswith("42") - """) + """, *opt) reprec.assertoutcome(passed=1) def test_capsyscapfd(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 Mon Jul 28 13:20:50 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 11:20:50 -0000 Subject: [Pytest-commit] commit/pytest: 4 new changesets Message-ID: <20140728112050.32147.9542@app05.ash-private.bitbucket.org> 4 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/4ce0a1f1dbe1/ Changeset: 4ce0a1f1dbe1 Branch: mock-unittest-252 User: hpk42 Date: 2014-07-28 13:20:17 Summary: close branch Affected #: 0 files https://bitbucket.org/hpk42/pytest/commits/6c1abf6e2feb/ Changeset: 6c1abf6e2feb Branch: alex_gaynor/marked-pytest-as-being-a-universal-wheel-1405267754279 User: hpk42 Date: 2014-07-28 13:20:27 Summary: close branch Affected #: 0 files https://bitbucket.org/hpk42/pytest/commits/8203705034ce/ Changeset: 8203705034ce Branch: zyegfryed/fixed-typo-noticed-by-dcramer-httpstwitt-1401780587159 User: hpk42 Date: 2014-07-28 13:20:33 Summary: close branch Affected #: 0 files https://bitbucket.org/hpk42/pytest/commits/17038d0e48ab/ Changeset: 17038d0e48ab Branch: tbekolay/better-setuptools-integration-in-goodpra-1400520902689 User: hpk42 Date: 2014-07-28 13:20:37 Summary: close branch Affected #: 0 files 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 Jul 28 13:54:03 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 11:54:03 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: speedup @ replacement for the massive lists from pytest-bdd :) Message-ID: <20140728115403.16969.41701@app14.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/ae861e335daf/ Changeset: ae861e335daf Branch: fix_initial_parsing User: hpk42 Date: 2014-07-28 13:53:53 Summary: speedup @ replacement for the massive lists from pytest-bdd :) Affected #: 1 file diff -r ae1f2ff32bfb93cabb8395de20d026364179ba02 -r ae861e335daf21dc2a0480fa540467264016e4cb _pytest/config.py --- a/_pytest/config.py +++ b/_pytest/config.py @@ -862,14 +862,11 @@ return {} +rex_pyat = re.compile(r'(.*\.py)@\d+$') + def node_with_line_number(string): - newparts = [] - for part in string.split("::"): - m = re.match(r'.*\.py@\d+$', part) - if m is not None: - part = part[:part.rfind("@")] - newparts.append(part) - return "::".join(newparts) + return "::".join(rex_pyat.sub(lambda m: m.group(1), part) + for part in string.split("::")) def setns(obj, dic): 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 Jul 28 13:56:17 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 11:56:17 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: add a comment for why we only consider .py files when removing @ Message-ID: <20140728115617.3482.19714@app13.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/d8958acde81e/ Changeset: d8958acde81e Branch: fix_initial_parsing User: hpk42 Date: 2014-07-28 13:56:10 Summary: add a comment for why we only consider .py files when removing @ Affected #: 1 file diff -r ae861e335daf21dc2a0480fa540467264016e4cb -r d8958acde81ea1bddbcb8a6fa45f61462e40b788 testing/test_parseopt.py --- a/testing/test_parseopt.py +++ b/testing/test_parseopt.py @@ -151,11 +151,13 @@ 'path.py at 123', 'hello/path.py at 123', ]) + # we only remove "@NUM" syntax for .py files which are currently + # the only ones which can produce it. assert getattr(args, parseopt.FILE_OR_DIR) == [ - 'path.txt at 2::item', - 'path2.py::func2[param with .py at 123]', - 'path.py', - 'hello/path.py', + 'path.txt at 2::item', + 'path2.py::func2[param with .py at 123]', + 'path.py', + 'hello/path.py', ] def test_parse_defaultgetter(self): 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 Jul 28 14:16:07 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 12:16:07 -0000 Subject: [Pytest-commit] commit/pytest: bubenkoff: Merged in fix_initial_parsing (pull request #186) Message-ID: <20140728121607.25223.58908@app11.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/1189057a5a52/ Changeset: 1189057a5a52 User: bubenkoff Date: 2014-07-28 14:16:02 Summary: Merged in fix_initial_parsing (pull request #186) Fix issue544 and fix another issue with parsing ``::`` Affected #: 4 files diff -r 16fab48aa572f966878eecc12d7344ec1102d02e -r 1189057a5a525222c98ceaf8d91a3e9614316409 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,11 @@ - fix integration of pytest with unittest.mock.patch decorator when it uses the "new" argument. Thanks Nicolas Delaby for test and PR. +- fix issue with detecting conftest files if the arguments contain + "::" node id specifications (copy pasted from "-v" output) + +- fix issue544 by only removing "@NUM" at the end of "::" separated parts + and if the part has an ".py" extension 2.6 ----------------------------------- diff -r 16fab48aa572f966878eecc12d7344ec1102d02e -r 1189057a5a525222c98ceaf8d91a3e9614316409 _pytest/config.py --- a/_pytest/config.py +++ b/_pytest/config.py @@ -485,6 +485,11 @@ testpaths = namespace.file_or_dir foundanchor = False for path in testpaths: + path = str(path) + # remove node-id syntax + i = path.find("::") + if i != -1: + path = path[:i] anchor = current.join(path, abs=1) if exists(anchor): # we found some file object self._try_load_conftest(anchor) @@ -857,10 +862,11 @@ return {} +rex_pyat = re.compile(r'(.*\.py)@\d+$') + def node_with_line_number(string): - split = string.split('[') - split[0] = re.sub(r'@\d+', '', split[0]) - return '['.join(split) + return "::".join(rex_pyat.sub(lambda m: m.group(1), part) + for part in string.split("::")) def setns(obj, dic): diff -r 16fab48aa572f966878eecc12d7344ec1102d02e -r 1189057a5a525222c98ceaf8d91a3e9614316409 testing/test_conftest.py --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -237,3 +237,21 @@ """)) result = testdir.runpytest("sub") result.stdout.fnmatch_lines(["*1 passed*"]) + + +def test_conftest_found_with_double_dash(testdir): + sub = testdir.mkdir("sub") + sub.join("conftest.py").write(py.std.textwrap.dedent(""" + def pytest_addoption(parser): + parser.addoption("--hello-world", action="store_true") + """)) + p = sub.join("test_hello.py") + p.write(py.std.textwrap.dedent(""" + import pytest + def test_hello(found): + assert found == 1 + """)) + result = testdir.runpytest(str(p) + "@2::test_hello", "-h") + result.stdout.fnmatch_lines(""" + *--hello-world* + """) diff -r 16fab48aa572f966878eecc12d7344ec1102d02e -r 1189057a5a525222c98ceaf8d91a3e9614316409 testing/test_parseopt.py --- a/testing/test_parseopt.py +++ b/testing/test_parseopt.py @@ -146,8 +146,19 @@ assert args.S == False def test_parse_removes_line_number_from_positional_arguments(self, parser): - args = parser.parse(['path at 2::func', 'path2 at 5::func2[param with @]']) - assert getattr(args, parseopt.FILE_OR_DIR) == ['path::func', 'path2::func2[param with @]'] + args = parser.parse(['path.txt at 2::item', + 'path2.py::func2[param with .py at 123]', + 'path.py at 123', + 'hello/path.py at 123', + ]) + # we only remove "@NUM" syntax for .py files which are currently + # the only ones which can produce it. + assert getattr(args, parseopt.FILE_OR_DIR) == [ + 'path.txt at 2::item', + 'path2.py::func2[param with .py at 123]', + 'path.py', + 'hello/path.py', + ] def test_parse_defaultgetter(self): def defaultget(option): 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 Jul 28 14:16:07 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 28 Jul 2014 12:16:07 -0000 Subject: [Pytest-commit] commit/pytest: bubenkoff: Close branch fix_initial_parsing Message-ID: <20140728121607.29262.60510@app04.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/07c1cd12509d/ Changeset: 07c1cd12509d Branch: fix_initial_parsing User: bubenkoff Date: 2014-07-28 14:16:02 Summary: Close branch fix_initial_parsing Affected #: 0 files 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 Tue Jul 29 11:29:29 2014 From: issues-reply at bitbucket.org (Andreas Pelme) Date: Tue, 29 Jul 2014 09:29:29 -0000 Subject: [Pytest-commit] Issue #548: isinstance check in warn() is inconsistent on py2/py3 (hpk42/pytest) Message-ID: <20140729092929.4346.87102@app10.ash-private.bitbucket.org> New issue 548: isinstance check in warn() is inconsistent on py2/py3 https://bitbucket.org/hpk42/pytest/issue/548/isinstance-check-in-warn-is-inconsistent Andreas Pelme: There is an assertion that reads ``` assert isinstance(code, str) ``` in `warn()` in _pytest/main.py. I guess the purpose here is to check for a Python 2 str or unicode, and Python 3 str. Currently it fails with an assertion error for unicode strings on Python 2. What is the intended behavior here? From commits-noreply at bitbucket.org Tue Jul 29 12:43:09 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 29 Jul 2014 10:43:09 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Merged in nicoddemus/pytest/cx_freeze-docs (pull request #188) Message-ID: <20140729104309.28923.90651@app13.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/cb8998b708a6/ Changeset: cb8998b708a6 User: hpk42 Date: 2014-07-29 12:43:04 Summary: Merged in nicoddemus/pytest/cx_freeze-docs (pull request #188) Documentation example on how to integrate pytest and cx_freeze Affected #: 1 file diff -r 1189057a5a525222c98ceaf8d91a3e9614316409 -r cb8998b708a6ee9645a7dbc4255d7f6395623ff3 doc/en/example/simple.txt --- a/doc/en/example/simple.txt +++ b/doc/en/example/simple.txt @@ -681,3 +681,59 @@ You'll see that the fixture finalizers could use the precise reporting information. +Integrating pytest runner and cx_freeze +----------------------------------------------------------- + +If you freeze your application using a tool like +`cx_freeze `_ in order to distribute it +to your end-users, it is a good idea to also package your test runner and run +your tests using the frozen application. + +This way packaging errors such as dependencies not being +included into the executable can be detected early while also allowing you to +send test files to users so they can run them in their machines, which can be +invaluable to obtain more information about a hard to reproduce bug. + +Unfortunately embedding the ``pytest`` runner into a frozen executable using +``cx_freeze`` is not as straightforward as one would like, +because ``pytest`` makes heavy use of dynamic module loading which +``cx_freeze`` can't resolve by itself. + +To solve this, you have to manually include ``pytest`` and ``py`` +modules by using the ``build_exe`` option in your ``setup.py`` script, like this:: + + # contents of setup.py + from cx_Freeze import setup, Executable + + includes = [ + '_pytest.doctest', + '_pytest.unittest', + # ... lots more + ] + setup( + name="runtests", + options={"build_exe": {'includes': includes}}, + # ... other options + ) + +(For the complete list, check out the modules under ``_pytest`` in your +site-packages). + +With that, you can make your program check for a certain flag and pass control +over to ``pytest``:: + + # contents of app_main.py + import sys + + if len(sys.argv) > 1 and sys.argv[1] == '--pytest': + import pytest + sys.exit(pytest.main(sys.argv[2:])) + else: + # normal application execution: at this point argv can be parsed + # by your argument-parsing library of choice as usual + ... + +This makes it convenient to execute your tests from within your frozen +application, using standard ``py.test`` command-line:: + + $ ./app_main --pytest --verbose --tb=long --junit-xml=results.xml test-suite/ \ No newline at end of file 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 Jul 29 12:43:09 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 29 Jul 2014 10:43:09 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Close branch cx_freeze-docs Message-ID: <20140729104309.30331.17687@app11.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/754f2fce9197/ Changeset: 754f2fce9197 Branch: cx_freeze-docs User: hpk42 Date: 2014-07-29 12:43:04 Summary: Close branch cx_freeze-docs Affected #: 0 files 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 Jul 29 12:43:09 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 29 Jul 2014 10:43:09 -0000 Subject: [Pytest-commit] commit/pytest: 3 new changesets Message-ID: <20140729104309.18830.98943@app12.ash-private.bitbucket.org> 3 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/977c9b0aadb4/ Changeset: 977c9b0aadb4 Branch: cx_freeze-docs User: nicoddemus Date: 2014-07-29 03:40:23 Summary: Adding blurb about using pytest runner and cx_freeze Affected #: 1 file diff -r 853ffb854a4813a6a2f9e0ad4229dde770f6c7a8 -r 977c9b0aadb4f869ea51f9c3d0aa0650d70ce1df doc/en/example/simple.txt --- a/doc/en/example/simple.txt +++ b/doc/en/example/simple.txt @@ -681,3 +681,58 @@ You'll see that the fixture finalizers could use the precise reporting information. +Integrate pytest runner with cx_freeze +----------------------------------------------------------- + +If you freeze your application using a tool like +`cx_freeze `_ in order to distribute it +to your end-users, it is a good idea to also package your test runner and run +your tests using the frozen application. + +This way you can detect packaging errors such as dependencies not being +included into the executable while also allowing you to send test files to +users so they can run them in their machines, which can be invaluable to +obtain more information about a hard to reproduce bug. + +Unfortunately embedding the ``pytest`` runner into a frozen executable using +``cx_freeze`` is not as straightforward as one would like, +because ``pytest`` makes heavy use of dynamic module loading which +``cx_freeze`` can't resolve by itself. + +To solve this, you have to manually include internal ``pytest`` and ``py`` +modules by using the ``build_exe`` option in your ``setup.py`` script like this:: + + # contents of setup.py + from cx_Freeze import setup, Executable + + includes = [ + '_pytest.doctest', + '_pytest.unittest', + # ... lots more + ] + setup( + name="runtests", + options={"build_exe": {'includes': includes}}, + # ... other options + ) + +(For the complete list, check out the modules under ``_pytest`` in your +site-packages). + +With that, you can make your program pass control over to ``pytest`` by looking +for a certain flag and handing over the other arguments:: + + # contents of app_main.py + import sys + + if len(sys.argv) > 1 and sys.argv[1] == '--pytest': + import pytest + sys.exit(pytest.main(sys.argv[2:])) + else: + # normal application execution: at this point argv can be parsed + # by your argument-parsing library of choice as usual + ... + +Making it easy to execute your tests from within your frozen application:: + + $ ./app_main --pytest --verbose --tb=long tests/ \ No newline at end of file https://bitbucket.org/hpk42/pytest/commits/8b7156f51879/ Changeset: 8b7156f51879 Branch: cx_freeze-docs User: nicoddemus Date: 2014-07-29 03:46:57 Summary: Improved the text a little Affected #: 1 file diff -r 977c9b0aadb4f869ea51f9c3d0aa0650d70ce1df -r 8b7156f518793f69b72a5b60cb8df84df2eb75c6 doc/en/example/simple.txt --- a/doc/en/example/simple.txt +++ b/doc/en/example/simple.txt @@ -681,7 +681,7 @@ You'll see that the fixture finalizers could use the precise reporting information. -Integrate pytest runner with cx_freeze +Integrating pytest runner and cx_freeze ----------------------------------------------------------- If you freeze your application using a tool like @@ -689,18 +689,18 @@ to your end-users, it is a good idea to also package your test runner and run your tests using the frozen application. -This way you can detect packaging errors such as dependencies not being -included into the executable while also allowing you to send test files to -users so they can run them in their machines, which can be invaluable to -obtain more information about a hard to reproduce bug. +This way packaging errors such as dependencies not being +included into the executable can be detected early while also allowing you to +send test files to users so they can run them in their machines, which can be +invaluable to obtain more information about a hard to reproduce bug. Unfortunately embedding the ``pytest`` runner into a frozen executable using ``cx_freeze`` is not as straightforward as one would like, because ``pytest`` makes heavy use of dynamic module loading which ``cx_freeze`` can't resolve by itself. -To solve this, you have to manually include internal ``pytest`` and ``py`` -modules by using the ``build_exe`` option in your ``setup.py`` script like this:: +To solve this, you have to manually include ``pytest`` and ``py`` +modules by using the ``build_exe`` option in your ``setup.py`` script, like this:: # contents of setup.py from cx_Freeze import setup, Executable @@ -719,8 +719,8 @@ (For the complete list, check out the modules under ``_pytest`` in your site-packages). -With that, you can make your program pass control over to ``pytest`` by looking -for a certain flag and handing over the other arguments:: +With that, you can make your program check for a certain flag and pass control +over to ``pytest``:: # contents of app_main.py import sys @@ -733,6 +733,7 @@ # by your argument-parsing library of choice as usual ... -Making it easy to execute your tests from within your frozen application:: +This makes it convenient to execute your tests from within your frozen +application, using standard ``py.test`` command-line:: - $ ./app_main --pytest --verbose --tb=long tests/ \ No newline at end of file + $ ./app_main --pytest --verbose --tb=long --junit-xml=results.xml test-suite/ \ No newline at end of file https://bitbucket.org/hpk42/pytest/commits/cb8998b708a6/ Changeset: cb8998b708a6 User: hpk42 Date: 2014-07-29 12:43:04 Summary: Merged in nicoddemus/pytest/cx_freeze-docs (pull request #188) Documentation example on how to integrate pytest and cx_freeze Affected #: 1 file diff -r 1189057a5a525222c98ceaf8d91a3e9614316409 -r cb8998b708a6ee9645a7dbc4255d7f6395623ff3 doc/en/example/simple.txt --- a/doc/en/example/simple.txt +++ b/doc/en/example/simple.txt @@ -681,3 +681,59 @@ You'll see that the fixture finalizers could use the precise reporting information. +Integrating pytest runner and cx_freeze +----------------------------------------------------------- + +If you freeze your application using a tool like +`cx_freeze `_ in order to distribute it +to your end-users, it is a good idea to also package your test runner and run +your tests using the frozen application. + +This way packaging errors such as dependencies not being +included into the executable can be detected early while also allowing you to +send test files to users so they can run them in their machines, which can be +invaluable to obtain more information about a hard to reproduce bug. + +Unfortunately embedding the ``pytest`` runner into a frozen executable using +``cx_freeze`` is not as straightforward as one would like, +because ``pytest`` makes heavy use of dynamic module loading which +``cx_freeze`` can't resolve by itself. + +To solve this, you have to manually include ``pytest`` and ``py`` +modules by using the ``build_exe`` option in your ``setup.py`` script, like this:: + + # contents of setup.py + from cx_Freeze import setup, Executable + + includes = [ + '_pytest.doctest', + '_pytest.unittest', + # ... lots more + ] + setup( + name="runtests", + options={"build_exe": {'includes': includes}}, + # ... other options + ) + +(For the complete list, check out the modules under ``_pytest`` in your +site-packages). + +With that, you can make your program check for a certain flag and pass control +over to ``pytest``:: + + # contents of app_main.py + import sys + + if len(sys.argv) > 1 and sys.argv[1] == '--pytest': + import pytest + sys.exit(pytest.main(sys.argv[2:])) + else: + # normal application execution: at this point argv can be parsed + # by your argument-parsing library of choice as usual + ... + +This makes it convenient to execute your tests from within your frozen +application, using standard ``py.test`` command-line:: + + $ ./app_main --pytest --verbose --tb=long --junit-xml=results.xml test-suite/ \ No newline at end of file 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 Tue Jul 29 13:18:49 2014 From: issues-reply at bitbucket.org (Sarah Bird) Date: Tue, 29 Jul 2014 11:18:49 -0000 Subject: [Pytest-commit] Issue #549: Provide option for message & diff. (hpk42/pytest) Message-ID: <20140729111849.3398.20645@app05.ash-private.bitbucket.org> New issue 549: Provide option for message & diff. https://bitbucket.org/hpk42/pytest/issue/549/provide-option-for-message-diff Sarah Bird: Currently, if I have a test: ``` #!python def test_string(): assert 'my silly string' == 'my not so silly string' ``` Then I get the fail message: ``` #!shell E assert 'my silly string' == 'my not so silly string' E - my silly string E + my not so silly string E ? +++++++ ``` With all its pytest helpful diff glory. If I have the test: ``` #!python def test_string(): assert 'my silly string' == 'my not so silly string', 'Silly strings should always match.' ``` I get the fail message: ``` #!shell E AssertionError: Silly strings should always match. ``` I discussed this a little with the pytest team sprinting at EuroPython and this is correct in the sense that a message is meant to be the defining output. But at the same time, as soon as I use a message I have no way to access all of pytest's helpful diffing and I'd like a way. It may be a tag like --message-full, but I'd love to get the error message: ``` #!shell E AssertionError: Silly strings should always match. E E assert 'my silly string' == 'my not so silly string' E - my silly string E + my not so silly string E ? +++++++ ``` From commits-noreply at bitbucket.org Tue Jul 29 14:25:26 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 29 Jul 2014 12:25:26 -0000 Subject: [Pytest-commit] commit/tox: 9 new changesets Message-ID: <20140729122526.11429.90226@app13.ash-private.bitbucket.org> 9 new commits in tox: https://bitbucket.org/hpk42/tox/commits/de361f0a345c/ Changeset: de361f0a345c User: suor Date: 2014-06-20 12:10:04 Summary: First stab at multidimensional config Affected #: 1 file diff -r cefc0fd28dda72ac76a9170b4c586e0eb3f1d124 -r de361f0a345ce1843425fa3128eab4ef8e437977 tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -303,10 +303,18 @@ config.skipsdist = reader.getbool(toxsection, "skipsdist", all_develop) - def _makeenvconfig(self, name, section, subs, config): + # interpolate missing configs + for name in config.envlist: + if name not in config.envconfigs: + config.envconfigs[name] = \ + self._makeenvconfig(name, "testenv", reader._subs, config, + factors=name.split('-')) + + def _makeenvconfig(self, name, section, subs, config, factors=()): vc = VenvConfig(envname=name) vc.config = config - reader = IniReader(self._cfg, fallbacksections=["testenv"]) + reader = IniReader(self._cfg, fallbacksections=["testenv"], + factors=factors) reader.addsubstitutions(**subs) vc.develop = not config.option.installpkg and \ reader.getbool(section, "usedevelop", config.option.develop) @@ -391,16 +399,33 @@ if not env: env = os.environ.get("TOXENV", None) if not env: - envlist = reader.getlist(toxsection, "envlist", sep=",") + envstr = reader.getdefault(toxsection, "envlist", default="", + replace=False) + envlist = self._expand_envstr(envstr) if not envlist: envlist = self.config.envconfigs.keys() return envlist + # TODO: move envsplit magic to _split_env() envlist = _split_env(env) if "ALL" in envlist: envlist = list(self.config.envconfigs) envlist.sort() return envlist + def _expand_envstr(self, envstr): + from itertools import groupby, product, chain + + # split by commas not in groups + tokens = re.split(r'(\{[^}]+\})|,', envstr) + envlist = [''.join(g).strip() for k, g in groupby(tokens, key=bool) if k] + + def expand(env): + tokens = re.split(r'\{([^}]+)\}', env) + parts = [token.split(',') for token in tokens] + return [''.join(variant) for variant in product(*parts)] + + return list(chain(*map(expand, envlist))) + def _replace_forced_dep(self, name, config): """ Override the given dependency config name taking --force-dep-version @@ -468,9 +493,10 @@ class IniReader: - def __init__(self, cfgparser, fallbacksections=None): + def __init__(self, cfgparser, fallbacksections=None, factors=()): self._cfg = cfgparser self.fallbacksections = fallbacksections or [] + self.factors = factors self._subs = {} self._subststack = [] @@ -586,18 +612,19 @@ return s def getdefault(self, section, name, default=None, replace=True): - try: - x = self._cfg[section][name] - except KeyError: - for fallbacksection in self.fallbacksections: - try: - x = self._cfg[fallbacksection][name] - except KeyError: - pass - else: - break - else: - x = default + x = None + for s in [section] + self.fallbacksections: + try: + x = self._cfg[s][name] + break + except KeyError: + continue + + if x is None: + x = default + else: + x = self._apply_factors(x) + if replace and x and hasattr(x, 'replace'): self._subststack.append((section, name)) try: @@ -607,6 +634,19 @@ #print "getdefault", section, name, "returned", repr(x) return x + def _apply_factors(self, s): + def factor_line(line): + m = re.search(r'^(!)?(\w+)?\:\s*(.+)', line) + if not m: + return line + + negate, factor, line = m.groups() + if bool(negate) ^ (factor in self.factors): + return line + + lines = s.strip().splitlines() + return '\n'.join(filter(None, map(factor_line, lines))) + def _replace_env(self, match): match_value = match.group('substitution_value') if not match_value: https://bitbucket.org/hpk42/tox/commits/26612b04a9fd/ Changeset: 26612b04a9fd User: suor Date: 2014-06-28 16:17:46 Summary: Fix regressions after adding factors Affected #: 1 file diff -r de361f0a345ce1843425fa3128eab4ef8e437977 -r 26612b04a9fd86702309469182b16f47ae56fc8d tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -636,7 +636,7 @@ def _apply_factors(self, s): def factor_line(line): - m = re.search(r'^(!)?(\w+)?\:\s*(.+)', line) + m = re.search(r'^(!)?(\w+)\:\s+(.+)', line) if not m: return line https://bitbucket.org/hpk42/tox/commits/c3c0b8cf5e00/ Changeset: c3c0b8cf5e00 User: suor Date: 2014-06-29 11:01:28 Summary: Parse env and args for factors, detect undefined envs Affected #: 1 file diff -r 26612b04a9fd86702309469182b16f47ae56fc8d -r c3c0b8cf5e00e99761e892c113cbfe95150de3cb tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -6,6 +6,7 @@ import shlex import string import pkg_resources +import itertools from tox.interpreters import Interpreters @@ -280,22 +281,19 @@ config.sdistsrc = reader.getpath(toxsection, "sdistsrc", None) config.setupdir = reader.getpath(toxsection, "setupdir", "{toxinidir}") config.logdir = config.toxworkdir.join("log") - for sectionwrapper in self._cfg: - section = sectionwrapper.name - if section.startswith(testenvprefix): - name = section[len(testenvprefix):] - envconfig = self._makeenvconfig(name, section, reader._subs, - config) - config.envconfigs[name] = envconfig - if not config.envconfigs: - config.envconfigs['python'] = \ - self._makeenvconfig("python", "_xz_9", reader._subs, config) - config.envlist = self._getenvlist(reader, toxsection) - for name in config.envlist: - if name not in config.envconfigs: - if name in defaultenvs: - config.envconfigs[name] = \ - self._makeenvconfig(name, "_xz_9", reader._subs, config) + + config.envlist, all_envs = self._getenvdata(reader, toxsection) + + # configure testenvs + known_factors = self._list_section_factors("testenv") + known_factors.update(defaultenvs) + known_factors.add("python") + for name in all_envs: + section = testenvprefix + name + factors = set(name.split('-')) + if section in self._cfg or factors & known_factors: + config.envconfigs[name] = \ + self._makeenvconfig(name, section, reader._subs, config) all_develop = all(name in config.envconfigs and config.envconfigs[name].develop @@ -303,18 +301,18 @@ config.skipsdist = reader.getbool(toxsection, "skipsdist", all_develop) - # interpolate missing configs - for name in config.envlist: - if name not in config.envconfigs: - config.envconfigs[name] = \ - self._makeenvconfig(name, "testenv", reader._subs, config, - factors=name.split('-')) + def _list_section_factors(self, section): + factors = set() + if section in self._cfg: + for _, value in self._cfg[section].items(): + factors.update(re.findall(r'^(!)?(\w+)\:\s+(.+)', value)) + return factors - def _makeenvconfig(self, name, section, subs, config, factors=()): + def _makeenvconfig(self, name, section, subs, config): vc = VenvConfig(envname=name) vc.config = config reader = IniReader(self._cfg, fallbacksections=["testenv"], - factors=factors) + factors=name.split('-')) reader.addsubstitutions(**subs) vc.develop = not config.option.installpkg and \ reader.getbool(section, "usedevelop", config.option.develop) @@ -394,37 +392,25 @@ "'install_command' must contain '{packages}' substitution") return vc - def _getenvlist(self, reader, toxsection): - env = self.config.option.env - if not env: - env = os.environ.get("TOXENV", None) - if not env: - envstr = reader.getdefault(toxsection, "envlist", default="", - replace=False) - envlist = self._expand_envstr(envstr) - if not envlist: - envlist = self.config.envconfigs.keys() - return envlist - # TODO: move envsplit magic to _split_env() - envlist = _split_env(env) - if "ALL" in envlist: - envlist = list(self.config.envconfigs) - envlist.sort() - return envlist + def _getenvdata(self, reader, toxsection): + envstr = self.config.option.env \ + or os.environ.get("TOXENV") \ + or reader.getdefault(toxsection, "envlist", replace=False) \ + or [] + envlist = _split_env(envstr) - def _expand_envstr(self, envstr): - from itertools import groupby, product, chain + # collect section envs + all_envs = set(envlist) - set(["ALL"]) + for section in self._cfg: + if section.name.startswith(testenvprefix): + all_envs.add(section.name[len(testenvprefix):]) + if not all_envs: + all_envs.add("python") - # split by commas not in groups - tokens = re.split(r'(\{[^}]+\})|,', envstr) - envlist = [''.join(g).strip() for k, g in groupby(tokens, key=bool) if k] + if not envlist or "ALL" in envlist: + envlist = sorted(all_envs) - def expand(env): - tokens = re.split(r'\{([^}]+)\}', env) - parts = [token.split(',') for token in tokens] - return [''.join(variant) for variant in product(*parts)] - - return list(chain(*map(expand, envlist))) + return envlist, all_envs def _replace_forced_dep(self, name, config): """ @@ -454,15 +440,25 @@ def _split_env(env): """if handed a list, action="append" was used for -e """ - envlist = [] if not isinstance(env, list): env = [env] - for to_split in env: - for single_env in to_split.split(","): - # "remove True or", if not allowing multiple same runs, update tests - if True or single_env not in envlist: - envlist.append(single_env) - return envlist + return mapcat(_expand_envstr, env) + +def _expand_envstr(envstr): + # split by commas not in groups + tokens = re.split(r'(\{[^}]+\})|,', envstr) + envlist = [''.join(g).strip() + for k, g in itertools.groupby(tokens, key=bool) if k] + + def expand(env): + tokens = re.split(r'\{([^}]+)\}', env) + parts = [token.split(',') for token in tokens] + return [''.join(variant) for variant in itertools.product(*parts)] + + return mapcat(expand, envlist) + +def mapcat(f, seq): + return list(itertools.chain.from_iterable(map(f, seq))) class DepConfig: def __init__(self, name, indexserver=None): https://bitbucket.org/hpk42/tox/commits/7a0dd904a4fb/ Changeset: 7a0dd904a4fb User: suor Date: 2014-07-03 12:22:28 Summary: Test factors and envlist expansion Affected #: 1 file diff -r c3c0b8cf5e00e99761e892c113cbfe95150de3cb -r 7a0dd904a4fbacfe93c223f4eec746ef9f9b4f07 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -832,6 +832,24 @@ assert conf.changedir.basename == 'testing' assert conf.changedir.dirpath().realpath() == tmpdir.realpath() + def test_factors(self, newconfig): + inisource=""" + [tox] + envlist = a,b + + [testenv] + deps= + dep-all + a: dep-a + b: dep-b + !a: dep-not-a + """ + conf = newconfig([], inisource) + configs = conf.envconfigs + assert [dep.name for dep in configs['a'].deps] == ["dep-all", "dep-a"] + assert [dep.name for dep in configs['b'].deps] == \ + ["dep-all", "dep-b", "dep-not-a"] + class TestGlobalOptions: def test_notest(self, newconfig): config = newconfig([], "") @@ -935,6 +953,23 @@ bp = "python%s.%s" %(name[2], name[3]) assert env.basepython == bp + def test_envlist_expansion(self, newconfig): + inisource = """ + [tox] + envlist = py{26,27},docs + """ + config = newconfig([], inisource) + assert config.envlist == ["py26", "py27", "docs"] + + def test_envlist_cross_product(self, newconfig): + inisource = """ + [tox] + envlist = py{26,27}-dep{1,2} + """ + config = newconfig([], inisource) + assert config.envlist == \ + ["py26-dep1", "py26-dep2", "py27-dep1", "py27-dep2"] + def test_minversion(self, tmpdir, newconfig, monkeypatch): inisource = """ [tox] https://bitbucket.org/hpk42/tox/commits/a6ef74cfe446/ Changeset: a6ef74cfe446 User: suor Date: 2014-07-03 12:34:23 Summary: Fix undefined env check Affected #: 1 file diff -r 7a0dd904a4fbacfe93c223f4eec746ef9f9b4f07 -r a6ef74cfe44662feff5bda94bdaf83c362e505d3 tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -291,7 +291,7 @@ for name in all_envs: section = testenvprefix + name factors = set(name.split('-')) - if section in self._cfg or factors & known_factors: + if section in self._cfg or factors <= known_factors: config.envconfigs[name] = \ self._makeenvconfig(name, section, reader._subs, config) @@ -305,7 +305,7 @@ factors = set() if section in self._cfg: for _, value in self._cfg[section].items(): - factors.update(re.findall(r'^(!)?(\w+)\:\s+(.+)', value)) + factors.update(re.findall(r'^!?(\w+)\:\s+', value, re.M)) return factors def _makeenvconfig(self, name, section, subs, config): https://bitbucket.org/hpk42/tox/commits/7130bc740587/ Changeset: 7130bc740587 User: suor Date: 2014-07-17 09:12:02 Summary: Docs on factors and envlist expansion Affected #: 1 file diff -r a6ef74cfe44662feff5bda94bdaf83c362e505d3 -r 7130bc7405879fa2254cfcb618d07ff7aec9a7d5 doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -382,6 +382,115 @@ {[base]deps} +Generating environments and selecting factors +--------------------------------------------- + +.. versionadded:: 1.8 + +Suppose you want to test your package against python2.6, python2.7 and against +several versions of a dependency, say Django 1.5 and Django 1.6. You can +accomplish that by writing down 2*2 = 4 ``[testenv:*]`` sections and then +listing all of them in ``envlist``. + +However, a better approach would be generating ``envlist`` and then selecting +dependencies this way:: + + [tox] + envlist = {py26,py27}-django{15,16} + + [testenv] + basepython = + py26: python2.6 + py27: python2.7 + deps = + pytest + django15: Django>=1.5,<1.6 + django16: Django>=1.6,<1.7 + !py27: unittest2 + commands = py.test + +Let's go through this step by step. + + +Generating environments ++++++++++++++++++++++++ + +:: + + envlist = {py26,py27}-django{15,16} + +This is bash-style syntax and will create ``2*2=4`` environment names +like this:: + + py26-django15 + py26-django16 + py27-django15 + py27-django16 + +You can still list explicit environments along with generated ones:: + + envlist = {py26,py27}-django{15,16}, docs, flake + + +Factors ++++++++ + +A parts of environment names delimited by hyphens are called factors and could +be used to alter values of ``[testenv]`` settings:: + + basepython = + py26: python2.6 + py27: python2.7 + +This conditional setting will lead to either ``python2.6`` or +``python2.7`` used as base python, e.g. ``python2.6`` is selected if current +environment contains ``py26`` factor. + +In list settings such as ``deps`` or ``commands`` you can freely intermix +optional lines with unconditional ones:: + + deps = + pytest + django15: Django>=1.5,<1.6 + django16: Django>=1.6,<1.7 + !py27: unittest2 + +A last line here uses negation of a factor, this means ``unittest2`` will be +in ``deps`` for all pythons except python2.7. The whole effect of this setting +definition could be described with a table: + +=============== ================================== +environment deps +=============== ================================== +py26-django15 pytest, Django>=1.5,<1.6, unitest2 +py26-django16 pytest, Django>=1.6,<1.7, unitest2 +py27-django15 pytest, Django>=1.5,<1.6 +py27-django16 pytest, Django>=1.6,<1.7 +=============== ================================== + +And this table can significantly grow as you have more dependencies and other +factors such as platform, python version and/or database. + +.. note:: + + Tox provides good defaults for basepython setting, so the above ini-file can be + further reduced by omitting it. + + +Showing all expanded sections ++++++++++++++++++++++++++++++ + +To help with understanding how the variants will produce section values, +you can ask tox to show their expansion with a new option:: + + $ tox -l + py26-django15 + py26-django16 + py27-django15 + py27-django16 + docs + flake + Other Rules and notes ===================== https://bitbucket.org/hpk42/tox/commits/34e8cf7abd61/ Changeset: 34e8cf7abd61 User: suor Date: 2014-07-17 10:27:47 Summary: Reimplement defaultenvs as default factors Affected #: 2 files diff -r 7130bc7405879fa2254cfcb618d07ff7aec9a7d5 -r 34e8cf7abd61ea9b7c6cee4d4a02918a03880c09 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -850,6 +850,20 @@ assert [dep.name for dep in configs['b'].deps] == \ ["dep-all", "dep-b", "dep-not-a"] + def test_default_factors(self, newconfig): + inisource=""" + [tox] + envlist = py{26,27,33,34}-dep + + [testenv] + deps= + dep: dep + """ + conf = newconfig([], inisource) + configs = conf.envconfigs + for name, config in configs.items(): + assert config.basepython == 'python%s.%s' % (name[2], name[3]) + class TestGlobalOptions: def test_notest(self, newconfig): config = newconfig([], "") diff -r 7130bc7405879fa2254cfcb618d07ff7aec9a7d5 -r 34e8cf7abd61ea9b7c6cee4d4a02918a03880c09 tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -16,13 +16,9 @@ iswin32 = sys.platform == "win32" -defaultenvs = {'jython': 'jython', 'pypy': 'pypy'} -for _name in "py,py24,py25,py26,py27,py30,py31,py32,py33,py34".split(","): - if _name == "py": - basepython = sys.executable - else: - basepython = "python" + ".".join(_name[2:4]) - defaultenvs[_name] = basepython +default_factors = {'jython': 'jython', 'pypy': 'pypy', 'py': sys.executable} +for version in '24,25,26,27,30,31,32,33,34'.split(','): + default_factors['py' + version] = 'python%s.%s' % tuple(version) def parseconfig(args=None, pkg=None): if args is None: @@ -286,7 +282,7 @@ # configure testenvs known_factors = self._list_section_factors("testenv") - known_factors.update(defaultenvs) + known_factors.update(default_factors) known_factors.add("python") for name in all_envs: section = testenvprefix + name @@ -311,8 +307,9 @@ def _makeenvconfig(self, name, section, subs, config): vc = VenvConfig(envname=name) vc.config = config + factors = set(name.split('-')) reader = IniReader(self._cfg, fallbacksections=["testenv"], - factors=name.split('-')) + factors=factors) reader.addsubstitutions(**subs) vc.develop = not config.option.installpkg and \ reader.getbool(section, "usedevelop", config.option.develop) @@ -321,10 +318,8 @@ if reader.getdefault(section, "python", None): raise tox.exception.ConfigError( "'python=' key was renamed to 'basepython='") - if name in defaultenvs: - bp = defaultenvs[name] - else: - bp = sys.executable + bp = next((default_factors[f] for f in factors if f in default_factors), + sys.executable) vc.basepython = reader.getdefault(section, "basepython", bp) vc._basepython_info = config.interpreters.get_info(vc.basepython) reader.addsubstitutions(envdir=vc.envdir, envname=vc.envname, https://bitbucket.org/hpk42/tox/commits/ffec51fcde95/ Changeset: ffec51fcde95 User: hpk42 Date: 2014-07-20 11:27:59 Summary: merge Alexander's "multi-dimensional" PR. Affected #: 5 files diff -r 27b38ca7904a514f5b9e51e3570fac218b522737 -r ffec51fcde950f4f662b4d8528570f17e047ed8d CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +1.8.0.dev1 +----------- + +- new multi-dimensional configuration support. Many thanks to + Alexander Schepanovski for the complete PR with docs. + + 1.7.2 ----------- diff -r 27b38ca7904a514f5b9e51e3570fac218b522737 -r ffec51fcde950f4f662b4d8528570f17e047ed8d CONTRIBUTORS --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3,6 +3,7 @@ Krisztian Fekete Marc Abramowitz +Aleaxner Schepanovski Sridhar Ratnakumar Barry Warsaw Chris Rose diff -r 27b38ca7904a514f5b9e51e3570fac218b522737 -r ffec51fcde950f4f662b4d8528570f17e047ed8d doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -382,6 +382,115 @@ {[base]deps} +Generating environments and selecting factors +--------------------------------------------- + +.. versionadded:: 1.8 + +Suppose you want to test your package against python2.6, python2.7 and against +several versions of a dependency, say Django 1.5 and Django 1.6. You can +accomplish that by writing down 2*2 = 4 ``[testenv:*]`` sections and then +listing all of them in ``envlist``. + +However, a better approach would be generating ``envlist`` and then selecting +dependencies this way:: + + [tox] + envlist = {py26,py27}-django{15,16} + + [testenv] + basepython = + py26: python2.6 + py27: python2.7 + deps = + pytest + django15: Django>=1.5,<1.6 + django16: Django>=1.6,<1.7 + !py27: unittest2 + commands = py.test + +Let's go through this step by step. + + +Generating environments ++++++++++++++++++++++++ + +:: + + envlist = {py26,py27}-django{15,16} + +This is bash-style syntax and will create ``2*2=4`` environment names +like this:: + + py26-django15 + py26-django16 + py27-django15 + py27-django16 + +You can still list explicit environments along with generated ones:: + + envlist = {py26,py27}-django{15,16}, docs, flake + + +Factors ++++++++ + +A parts of environment names delimited by hyphens are called factors and could +be used to alter values of ``[testenv]`` settings:: + + basepython = + py26: python2.6 + py27: python2.7 + +This conditional setting will lead to either ``python2.6`` or +``python2.7`` used as base python, e.g. ``python2.6`` is selected if current +environment contains ``py26`` factor. + +In list settings such as ``deps`` or ``commands`` you can freely intermix +optional lines with unconditional ones:: + + deps = + pytest + django15: Django>=1.5,<1.6 + django16: Django>=1.6,<1.7 + !py27: unittest2 + +A last line here uses negation of a factor, this means ``unittest2`` will be +in ``deps`` for all pythons except python2.7. The whole effect of this setting +definition could be described with a table: + +=============== ================================== +environment deps +=============== ================================== +py26-django15 pytest, Django>=1.5,<1.6, unitest2 +py26-django16 pytest, Django>=1.6,<1.7, unitest2 +py27-django15 pytest, Django>=1.5,<1.6 +py27-django16 pytest, Django>=1.6,<1.7 +=============== ================================== + +And this table can significantly grow as you have more dependencies and other +factors such as platform, python version and/or database. + +.. note:: + + Tox provides good defaults for basepython setting, so the above ini-file can be + further reduced by omitting it. + + +Showing all expanded sections ++++++++++++++++++++++++++++++ + +To help with understanding how the variants will produce section values, +you can ask tox to show their expansion with a new option:: + + $ tox -l + py26-django15 + py26-django16 + py27-django15 + py27-django16 + docs + flake + Other Rules and notes ===================== diff -r 27b38ca7904a514f5b9e51e3570fac218b522737 -r ffec51fcde950f4f662b4d8528570f17e047ed8d tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -832,6 +832,38 @@ assert conf.changedir.basename == 'testing' assert conf.changedir.dirpath().realpath() == tmpdir.realpath() + def test_factors(self, newconfig): + inisource=""" + [tox] + envlist = a,b + + [testenv] + deps= + dep-all + a: dep-a + b: dep-b + !a: dep-not-a + """ + conf = newconfig([], inisource) + configs = conf.envconfigs + assert [dep.name for dep in configs['a'].deps] == ["dep-all", "dep-a"] + assert [dep.name for dep in configs['b'].deps] == \ + ["dep-all", "dep-b", "dep-not-a"] + + def test_default_factors(self, newconfig): + inisource=""" + [tox] + envlist = py{26,27,33,34}-dep + + [testenv] + deps= + dep: dep + """ + conf = newconfig([], inisource) + configs = conf.envconfigs + for name, config in configs.items(): + assert config.basepython == 'python%s.%s' % (name[2], name[3]) + class TestGlobalOptions: def test_notest(self, newconfig): config = newconfig([], "") @@ -935,6 +967,23 @@ bp = "python%s.%s" %(name[2], name[3]) assert env.basepython == bp + def test_envlist_expansion(self, newconfig): + inisource = """ + [tox] + envlist = py{26,27},docs + """ + config = newconfig([], inisource) + assert config.envlist == ["py26", "py27", "docs"] + + def test_envlist_cross_product(self, newconfig): + inisource = """ + [tox] + envlist = py{26,27}-dep{1,2} + """ + config = newconfig([], inisource) + assert config.envlist == \ + ["py26-dep1", "py26-dep2", "py27-dep1", "py27-dep2"] + def test_minversion(self, tmpdir, newconfig, monkeypatch): inisource = """ [tox] diff -r 27b38ca7904a514f5b9e51e3570fac218b522737 -r ffec51fcde950f4f662b4d8528570f17e047ed8d tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -6,6 +6,7 @@ import shlex import string import pkg_resources +import itertools from tox.interpreters import Interpreters @@ -15,13 +16,10 @@ iswin32 = sys.platform == "win32" -defaultenvs = {'jython': 'jython', 'pypy': 'pypy', 'pypy3': 'pypy3'} -for _name in "py,py24,py25,py26,py27,py30,py31,py32,py33,py34".split(","): - if _name == "py": - basepython = sys.executable - else: - basepython = "python" + ".".join(_name[2:4]) - defaultenvs[_name] = basepython +default_factors = {'jython': 'jython', 'pypy': 'pypy', 'pypy3': 'pypy3', + 'py': sys.executable} +for version in '24,25,26,27,30,31,32,33,34'.split(','): + default_factors['py' + version] = 'python%s.%s' % tuple(version) def parseconfig(args=None, pkg=None): if args is None: @@ -280,22 +278,19 @@ config.sdistsrc = reader.getpath(toxsection, "sdistsrc", None) config.setupdir = reader.getpath(toxsection, "setupdir", "{toxinidir}") config.logdir = config.toxworkdir.join("log") - for sectionwrapper in self._cfg: - section = sectionwrapper.name - if section.startswith(testenvprefix): - name = section[len(testenvprefix):] - envconfig = self._makeenvconfig(name, section, reader._subs, - config) - config.envconfigs[name] = envconfig - if not config.envconfigs: - config.envconfigs['python'] = \ - self._makeenvconfig("python", "_xz_9", reader._subs, config) - config.envlist = self._getenvlist(reader, toxsection) - for name in config.envlist: - if name not in config.envconfigs: - if name in defaultenvs: - config.envconfigs[name] = \ - self._makeenvconfig(name, "_xz_9", reader._subs, config) + + config.envlist, all_envs = self._getenvdata(reader, toxsection) + + # configure testenvs + known_factors = self._list_section_factors("testenv") + known_factors.update(default_factors) + known_factors.add("python") + for name in all_envs: + section = testenvprefix + name + factors = set(name.split('-')) + if section in self._cfg or factors <= known_factors: + config.envconfigs[name] = \ + self._makeenvconfig(name, section, reader._subs, config) all_develop = all(name in config.envconfigs and config.envconfigs[name].develop @@ -303,10 +298,19 @@ config.skipsdist = reader.getbool(toxsection, "skipsdist", all_develop) + def _list_section_factors(self, section): + factors = set() + if section in self._cfg: + for _, value in self._cfg[section].items(): + factors.update(re.findall(r'^!?(\w+)\:\s+', value, re.M)) + return factors + def _makeenvconfig(self, name, section, subs, config): vc = VenvConfig(envname=name) vc.config = config - reader = IniReader(self._cfg, fallbacksections=["testenv"]) + factors = set(name.split('-')) + reader = IniReader(self._cfg, fallbacksections=["testenv"], + factors=factors) reader.addsubstitutions(**subs) vc.develop = not config.option.installpkg and \ reader.getbool(section, "usedevelop", config.option.develop) @@ -315,10 +319,8 @@ if reader.getdefault(section, "python", None): raise tox.exception.ConfigError( "'python=' key was renamed to 'basepython='") - if name in defaultenvs: - bp = defaultenvs[name] - else: - bp = sys.executable + bp = next((default_factors[f] for f in factors if f in default_factors), + sys.executable) vc.basepython = reader.getdefault(section, "basepython", bp) vc._basepython_info = config.interpreters.get_info(vc.basepython) reader.addsubstitutions(envdir=vc.envdir, envname=vc.envname, @@ -386,20 +388,25 @@ "'install_command' must contain '{packages}' substitution") return vc - def _getenvlist(self, reader, toxsection): - env = self.config.option.env - if not env: - env = os.environ.get("TOXENV", None) - if not env: - envlist = reader.getlist(toxsection, "envlist", sep=",") - if not envlist: - envlist = self.config.envconfigs.keys() - return envlist - envlist = _split_env(env) - if "ALL" in envlist: - envlist = list(self.config.envconfigs) - envlist.sort() - return envlist + def _getenvdata(self, reader, toxsection): + envstr = self.config.option.env \ + or os.environ.get("TOXENV") \ + or reader.getdefault(toxsection, "envlist", replace=False) \ + or [] + envlist = _split_env(envstr) + + # collect section envs + all_envs = set(envlist) - set(["ALL"]) + for section in self._cfg: + if section.name.startswith(testenvprefix): + all_envs.add(section.name[len(testenvprefix):]) + if not all_envs: + all_envs.add("python") + + if not envlist or "ALL" in envlist: + envlist = sorted(all_envs) + + return envlist, all_envs def _replace_forced_dep(self, name, config): """ @@ -429,15 +436,25 @@ def _split_env(env): """if handed a list, action="append" was used for -e """ - envlist = [] if not isinstance(env, list): env = [env] - for to_split in env: - for single_env in to_split.split(","): - # "remove True or", if not allowing multiple same runs, update tests - if True or single_env not in envlist: - envlist.append(single_env) - return envlist + return mapcat(_expand_envstr, env) + +def _expand_envstr(envstr): + # split by commas not in groups + tokens = re.split(r'(\{[^}]+\})|,', envstr) + envlist = [''.join(g).strip() + for k, g in itertools.groupby(tokens, key=bool) if k] + + def expand(env): + tokens = re.split(r'\{([^}]+)\}', env) + parts = [token.split(',') for token in tokens] + return [''.join(variant) for variant in itertools.product(*parts)] + + return mapcat(expand, envlist) + +def mapcat(f, seq): + return list(itertools.chain.from_iterable(map(f, seq))) class DepConfig: def __init__(self, name, indexserver=None): @@ -468,9 +485,10 @@ class IniReader: - def __init__(self, cfgparser, fallbacksections=None): + def __init__(self, cfgparser, fallbacksections=None, factors=()): self._cfg = cfgparser self.fallbacksections = fallbacksections or [] + self.factors = factors self._subs = {} self._subststack = [] @@ -586,18 +604,19 @@ return s def getdefault(self, section, name, default=None, replace=True): - try: - x = self._cfg[section][name] - except KeyError: - for fallbacksection in self.fallbacksections: - try: - x = self._cfg[fallbacksection][name] - except KeyError: - pass - else: - break - else: - x = default + x = None + for s in [section] + self.fallbacksections: + try: + x = self._cfg[s][name] + break + except KeyError: + continue + + if x is None: + x = default + else: + x = self._apply_factors(x) + if replace and x and hasattr(x, 'replace'): self._subststack.append((section, name)) try: @@ -607,6 +626,19 @@ #print "getdefault", section, name, "returned", repr(x) return x + def _apply_factors(self, s): + def factor_line(line): + m = re.search(r'^(!)?(\w+)\:\s+(.+)', line) + if not m: + return line + + negate, factor, line = m.groups() + if bool(negate) ^ (factor in self.factors): + return line + + lines = s.strip().splitlines() + return '\n'.join(filter(None, map(factor_line, lines))) + def _replace_env(self, match): match_value = match.group('substitution_value') if not match_value: https://bitbucket.org/hpk42/tox/commits/30fcc8529698/ Changeset: 30fcc8529698 User: hpk42 Date: 2014-07-20 17:36:10 Summary: some streamlining of the docs Affected #: 1 file diff -r ffec51fcde950f4f662b4d8528570f17e047ed8d -r 30fcc85296981a9fc3f5b8782c91817d5a569357 doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -382,7 +382,7 @@ {[base]deps} -Generating environments and selecting factors +Generating environments, conditional settings --------------------------------------------- .. versionadded:: 1.8 @@ -392,8 +392,7 @@ accomplish that by writing down 2*2 = 4 ``[testenv:*]`` sections and then listing all of them in ``envlist``. -However, a better approach would be generating ``envlist`` and then selecting -dependencies this way:: +However, a better approach looks like this:: [tox] envlist = {py26,py27}-django{15,16} @@ -409,10 +408,16 @@ !py27: unittest2 commands = py.test +This uses two new facilities of tox-1.8: + +- generative envlist declarations where each envname + consists of environment parts or "factors" + +- "factor" specific settings + Let's go through this step by step. - -Generating environments +Generative envlist +++++++++++++++++++++++ :: @@ -427,16 +432,29 @@ py27-django15 py27-django16 -You can still list explicit environments along with generated ones:: +You can still list environments explicitely along with generated ones:: envlist = {py26,py27}-django{15,16}, docs, flake +.. note:: -Factors -+++++++ + To help with understanding how the variants will produce section values, + you can ask tox to show their expansion with a new option:: -A parts of environment names delimited by hyphens are called factors and could -be used to alter values of ``[testenv]`` settings:: + $ tox -l + py26-django15 + py26-django16 + py27-django15 + py27-django16 + docs + flake + + +Factors and factor-conditional settings +++++++++++++++++++++++++++++++++++++++++ + +Parts of an environment name delimited by hyphens are called factors and can +be used to set values conditionally:: basepython = py26: python2.6 @@ -455,7 +473,7 @@ django16: Django>=1.6,<1.7 !py27: unittest2 -A last line here uses negation of a factor, this means ``unittest2`` will be +The last line here uses negation of a factor, this means ``unittest2`` will be in ``deps`` for all pythons except python2.7. The whole effect of this setting definition could be described with a table: @@ -473,23 +491,9 @@ .. note:: - Tox provides good defaults for basepython setting, so the above ini-file can be - further reduced by omitting it. - - -Showing all expanded sections -+++++++++++++++++++++++++++++ - -To help with understanding how the variants will produce section values, -you can ask tox to show their expansion with a new option:: - - $ tox -l - py26-django15 - py26-django16 - py27-django15 - py27-django16 - docs - flake + Tox provides good defaults for basepython setting, so the above + ini-file can be further reduced by omitting the ``basepython`` + setting. Other Rules and notes 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 Tue Jul 29 15:00:55 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 29 Jul 2014 13:00:55 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: add flub and pelme talks at EuroPython2014, remove one past training note Message-ID: <20140729130055.7277.65947@app12.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/92dba42a205b/ Changeset: 92dba42a205b User: hpk42 Date: 2014-07-29 15:00:45 Summary: add flub and pelme talks at EuroPython2014, remove one past training note Affected #: 2 files diff -r cb8998b708a6ee9645a7dbc4255d7f6395623ff3 -r 92dba42a205bd4ffb93e024ba87181b676685555 doc/en/index.txt --- a/doc/en/index.txt +++ b/doc/en/index.txt @@ -3,9 +3,7 @@ .. note:: - `improving your automated testing with pytest `_, July 25th 2014, Berlin, Germany - - `professional testing with pytest and tox `_, 24-26th November 2014, Freiburg, Germany + next training: `professional testing with pytest and tox `_, 24-26th November 2014, Freiburg, Germany pytest: helps you write better programs diff -r cb8998b708a6ee9645a7dbc4255d7f6395623ff3 -r 92dba42a205bd4ffb93e024ba87181b676685555 doc/en/talks.txt --- a/doc/en/talks.txt +++ b/doc/en/talks.txt @@ -4,8 +4,6 @@ .. sidebar:: Next Open Trainings - `improving your automated testing with pytest `_, July 25th 2014, Berlin, Germany - `professional testing with pytest and tox `_, 24-26th November 2014, Freiburg, Germany .. _`funcargs`: funcargs.html @@ -18,6 +16,12 @@ Basic usage and fixtures: +- `Introduction to pytest by Andreas Pelme EuroPython 2014 + `_. + +- `Advanced Uses of py.test Fixtures by Floris Bruynooghe EuroPython + 2014 `_. + - `pytest feature and release highlights (GERMAN, October 2013) `_ 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 Jul 29 15:15:16 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 29 Jul 2014 13:15:16 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: reorder talks, more talks from pelme and others Message-ID: <20140729131516.8323.18798@app03.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/040c46f25733/ Changeset: 040c46f25733 User: hpk42 Date: 2014-07-29 15:06:37 Summary: reorder talks, more talks from pelme and others Affected #: 1 file diff -r 92dba42a205bd4ffb93e024ba87181b676685555 -r 040c46f257331f1c4546246683a808668969c011 doc/en/talks.txt --- a/doc/en/talks.txt +++ b/doc/en/talks.txt @@ -8,38 +8,44 @@ .. _`funcargs`: funcargs.html -Tutorial examples and blog postings +Talks and blog postings --------------------------------------------- .. _`tutorial1 repository`: http://bitbucket.org/hpk42/pytest-tutorial1/ .. _`pycon 2010 tutorial PDF`: http://bitbucket.org/hpk42/pytest-tutorial1/raw/tip/pytest-basic.pdf -Basic usage and fixtures: - -- `Introduction to pytest by Andreas Pelme EuroPython 2014 +- `Introduction to pytest, Andreas Pelme, EuroPython 2014 `_. -- `Advanced Uses of py.test Fixtures by Floris Bruynooghe EuroPython +- `Advanced Uses of py.test Fixtures, Floris Bruynooghe, EuroPython 2014 `_. -- `pytest feature and release highlights (GERMAN, October 2013) +- `Why i use py.test and maybe you should too, Andy Todd, Pycon AU 2013 + `_ + +- `3-part blog series about pytest from @pydanny alias Daniel Greenfeld (January + 2014) `_ + +- `pytest: helps you write better Django apps, Andreas Pelme, DjangoCon + Europe 2014 `_. + +- :ref:`fixtures` + +- `Testing Django Applications with pytest, Andreas Pelme, EuroPython + 2013 `_. + +- `Testes pythonics com py.test, Vinicius Belchior Assef Neto, Plone + Conf 2013, Brazil `_. + +- `Introduction to py.test fixtures, FOSDEM 2013, Floris Bruynooghe + `_. + +- `pytest feature and release highlights, Holger Krekel (GERMAN, October 2013) `_ - `pytest introduction from Brian Okken (January 2013) `_ -- `3-part blog series about pytest from Daniel Greenfeld (January - 2014) `_ - -- `pycon australia 2012 pytest talk from Brianna Laugher - `_ (`video `_, `slides `_, `code `_) -- `pycon 2012 US talk video from Holger Krekel `_ -- `pycon 2010 tutorial PDF`_ and `tutorial1 repository`_ - - -Fixtures and Function arguments: - -- :ref:`fixtures` - `monkey patching done right`_ (blog post, consult `monkeypatch plugin`_ for up-to-date API) @@ -79,6 +85,11 @@ Older conference talks and tutorials ---------------------------------------- +- `pycon australia 2012 pytest talk from Brianna Laugher + `_ (`video `_, `slides `_, `code `_) +- `pycon 2012 US talk video from Holger Krekel `_ +- `pycon 2010 tutorial PDF`_ and `tutorial1 repository`_ + - `ep2009-rapidtesting.pdf`_ tutorial slides (July 2009): - testing terminology 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 Tue Jul 29 15:35:37 2014 From: issues-reply at bitbucket.org (Daniel Hahler) Date: Tue, 29 Jul 2014 13:35:37 -0000 Subject: [Pytest-commit] Issue #550: Strip docstring output with `--fixtures` (hpk42/pytest) Message-ID: <20140729133537.12966.65233@app12.ash-private.bitbucket.org> New issue 550: Strip docstring output with `--fixtures` https://bitbucket.org/hpk42/pytest/issue/550/strip-docstring-output-with-fixtures Daniel Hahler: I have noticed that `py.test --fixtures` uses the docstring as-is. I think it would be nicer to trim any leading and/or trailing whitespace (usually newlines) with them. Please let me know, if this is sensible and I will provide a pull request for it. From issues-reply at bitbucket.org Wed Jul 30 04:18:00 2014 From: issues-reply at bitbucket.org (Dustin Farris) Date: Wed, 30 Jul 2014 02:18:00 -0000 Subject: [Pytest-commit] Issue #551: looponfail is slow to react (hpk42/pytest) Message-ID: <20140730021800.10289.65172@app02.ash-private.bitbucket.org> New issue 551: looponfail is slow to react https://bitbucket.org/hpk42/pytest/issue/551/looponfail-is-slow-to-react Dustin Farris: On changes, sometimes looponfail reacts near instantly, but more often than not, it can take up to 15 seconds before looponfail recognizes a file change (on a very small project). From issues-reply at bitbucket.org Thu Jul 31 00:51:17 2014 From: issues-reply at bitbucket.org (Tom V) Date: Wed, 30 Jul 2014 22:51:17 -0000 Subject: [Pytest-commit] Issue #552: Can't mark.xfail a callable test param (hpk42/pytest) Message-ID: <20140730225117.31401.86130@app04.ash-private.bitbucket.org> New issue 552: Can't mark.xfail a callable test param https://bitbucket.org/hpk42/pytest/issue/552/cant-markxfail-a-callable-test-param Tom V: Within a `pytest.mark.parametrize` decorator, marking xfail on a (non-lambda) callable like `pytest.mark.xfail(func)` doesn't work. These first 3 examples contain marked xfails for the 2nd param, but still show as failed tests when run: # xfail applied, but error still shown def func1(): return 1 def func2(): return 2 @pytest.mark.parametrize('func_param', [func1, pytest.mark.xfail(func2)]) def test_xfail_param_func(func_param): assert func_param() == 1 class cls1: val = 1 class cls2: val = 2 @pytest.mark.parametrize('cls_param', [cls1, pytest.mark.xfail(cls2)]) def test_xfail_param_cls(cls_param): assert cls_param.val == 1 type_cls1 = type('cls1', (), {'val':1}) type_cls2 = type('cls2', (), {'val':2}) @pytest.mark.parametrize('type_cls_param', [type_cls1, pytest.mark.xfail(type_cls2)]) def test_xfail_param_type(type_cls_param): assert type_cls_param.val == 1 Output: $ py.test test_xfail.py ===================================================================== test session starts ===================================================================== platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 6 items test_xfail.py .F.F.F ========================================================================== FAILURES =========================================================================== ________________________________________________________________ test_xfail_param_func[func1] _________________________________________________________________ func = @pytest.mark.parametrize('func', [func1, pytest.mark.xfail(func2)]) def test_xfail_param_func(func): > assert func() == 1 E assert 2 == 1 E + where 2 = () test_xfail.py:12: AssertionError ______________________________________________________________ test_xfail_param_cls[cls_param1] _______________________________________________________________ cls_param = @pytest.mark.parametrize('cls_param', [cls1, pytest.mark.xfail(cls2)]) def test_xfail_param_cls(cls_param): > assert cls_param.val == 1 E assert 2 == 1 E + where 2 = .val test_xfail.py:21: AssertionError ___________________________________________________________ test_xfail_param_type[type_cls_param1] ____________________________________________________________ type_cls_param = @pytest.mark.parametrize('type_cls_param', [type_cls1, pytest.mark.xfail(type_cls2)]) def test_xfail_param_type(type_cls_param): > assert type_cls_param.val == 1 E assert 2 == 1 E + where 2 = .val test_xfail.py:29: AssertionError ============================================================= 3 failed, 3 passed in 0.02 seconds ============================================================== And some examples where it behaves as expected, with non-callables (and lambdas): # xfail applied, as expected, no error shown lambda_func1 = lambda :1 lambda_func2 = lambda :2 @pytest.mark.parametrize('lambda_param', [lambda_func1, pytest.mark.xfail(lambda_func2)]) def test_xfail_param_lambda(lambda_param): assert lambda_param() == 1 func_dict = { 'func1': func1, 'func2': func2, } @pytest.mark.parametrize('str_param', ['func1', pytest.mark.xfail('func2')]) def test_xfail_param_str(str_param): func = func_dict[str_param] assert func() == 1 @pytest.mark.parametrize('int_param', [1, pytest.mark.xfail(2)]) def test_xfail_param_int(int_param): assert int_param == 1 dict1 = {'key': 1} dict2 = {'key': 2} @pytest.mark.parametrize('dict_param', [dict1, pytest.mark.xfail(dict2)]) def test_xfail_param_dict(dict_param): assert dict_param['key'] == 1 And the output, which is what I expect regardless of the type of the params: $ py.test test_xfail.py ===================================================================== test session starts ===================================================================== platform linux2 -- Python 2.7.6 -- py-1.4.22 -- pytest-2.6.0 collected 6 items test_xfail.py .x.x.x ============================================================= 3 passed, 3 xfailed in 0.04 seconds =============================================================