From commits-noreply at bitbucket.org Fri Mar 1 10:49:07 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Fri, 01 Mar 2013 09:49:07 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20130301094907.16415.17539@bitbucket15.managed.contegix.com> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/5e30bf1ee82c/ changeset: 5e30bf1ee82c user: hpk42 date: 2013-03-01 10:48:26 summary: Added tag 1.4.3 for changeset f5177c612fba affected #: 1 file diff -r f5177c612fbadb8552c58693fa7249388c1c1bd3 -r 5e30bf1ee82c2568b96891bce2adebf06a4a198e .hgtags --- a/.hgtags +++ b/.hgtags @@ -11,3 +11,4 @@ d5dbb01fc0eb73f7eca74842d1ce02554552b0a3 1.4 3a68408fa3a210c2a2e52189e16f5ae6dfed287d 1.4.1 668f66e4781b0beae509db8125dc02218f6efe4e 1.4.2 +f5177c612fbadb8552c58693fa7249388c1c1bd3 1.4.3 https://bitbucket.org/hpk42/tox/commits/f97a5361fe58/ changeset: f97a5361fe58 user: hpk42 date: 2013-03-01 10:48:53 summary: bump version for doc upload affected #: 1 file diff -r 5e30bf1ee82c2568b96891bce2adebf06a4a198e -r f97a5361fe58de5c6c24affcec8abbf50b81b6a0 doc/conf.py --- a/doc/conf.py +++ b/doc/conf.py @@ -48,7 +48,7 @@ # built documents. # # The short X.Y version. -release = version = "1.4.2-1" +release = version = "1.4.3" # The full version, including alpha/beta/rc tags. # The language for content autogenerated by Sphinx. Refer to documentation 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 issues-reply at bitbucket.org Fri Mar 1 11:35:56 2013 From: issues-reply at bitbucket.org (Hynek Schlawack) Date: Fri, 01 Mar 2013 10:35:56 -0000 Subject: [Pytest-commit] [hpk42/tox] tox requires a file system with support for hard links to work (issue #86) Message-ID: --- you can reply above this line --- New issue 86: tox requires a file system with support for hard links to work https://bitbucket.org/hpk42/tox/issue/86/tox-requires-a-file-system-with-support Hynek Schlawack: Since tox runs sdist, it requires hard links to work. That?s a problem if you work in a VM with a guess file system like e.g. VirtualBox which don?t. Thus at the moment, it?s impossible to use tox in such a ? thanks to vagrant increasingly common ? setup. There?s a related question on [StackOverflow](http://stackoverflow.com/questions/7719380/python-setup-py-sdist-error-operation-not-permitted). The only ad-hoc solution I can come up with is detecting that situation and monkey patch?`os.link()`. :) -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Fri Mar 1 13:44:46 2013 From: issues-reply at bitbucket.org (Mathieu Agopian) Date: Fri, 01 Mar 2013 12:44:46 -0000 Subject: [Pytest-commit] [hpk42/tox] Tox obeys the VIRTUALENV_PYTHON environment variable if set (issue #87) Message-ID: --- you can reply above this line --- New issue 87: Tox obeys the VIRTUALENV_PYTHON environment variable if set https://bitbucket.org/hpk42/tox/issue/87/tox-obeys-the-virtualenv_python Mathieu Agopian: This means that if somebody is settings this variable in his .bashrc file for example, in order to have his own manually created virtualenvs use a specific version of python by default (say python2.7), tox will create all venvs with the same python interpreter, whatever the envlist. I can see three solutions to this: * don't do anything: maybe add a FAQ entry or note somewhere in the doc or in a troubleshooting session explaining this behaviour * unset the environment variable before creating the virtualenvs * create virtualenvs using the --python option and pass it the env (this way the VIRTUALENV_PYTHON isn't used) I'd go for the third option, thoughts? -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From commits-noreply at bitbucket.org Fri Mar 8 16:45:23 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Fri, 08 Mar 2013 15:45:23 -0000 Subject: [Pytest-commit] commit/pytest: gutworth: in the default Python 2 case, manually check the source is ASCII (fixes #269) Message-ID: <20130308154523.23696.58651@bitbucket23.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/62e3666c1cec/ changeset: 62e3666c1cec user: gutworth date: 2013-03-08 16:44:41 summary: in the default Python 2 case, manually check the source is ASCII (fixes #269) affected #: 3 files diff -r a4ad4a06149f957d921d1f9a4e33ed88ddf7cf07 -r 62e3666c1cec8bdd6767dd207a153cb23f2a9ef3 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ Changes between 2.3.4 and 2.3.5dev ----------------------------------- +- issue 259 - when assertion rewriting, be consistent with the default + source encoding of ASCII on Python 2 + - issue 251 - report a skip instead of ignoring classes with init - issue250 unicode/str mixes in parametrization names and values now works diff -r a4ad4a06149f957d921d1f9a4e33ed88ddf7cf07 -r 62e3666c1cec8bdd6767dd207a153cb23f2a9ef3 _pytest/assertion/rewrite.py --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -6,6 +6,7 @@ import imp import marshal import os +import re import struct import sys import types @@ -38,6 +39,7 @@ PYC_TAIL = "." + PYTEST_TAG + PYC_EXT REWRITE_NEWLINES = sys.version_info[:2] != (2, 7) and sys.version_info < (3, 2) +ASCII_IS_DEFAULT_ENCODING = sys.version_info[0] < 3 class AssertionRewritingHook(object): """PEP302 Import hook which rewrites asserts.""" @@ -187,12 +189,37 @@ RN = "\r\n".encode("utf-8") N = "\n".encode("utf-8") +cookie_re = re.compile("coding[:=]\s*[-\w.]+") +BOM_UTF8 = '\xef\xbb\xbf' + def _rewrite_test(state, fn): """Try to read and rewrite *fn* and return the code object.""" try: source = fn.read("rb") except EnvironmentError: return None + if ASCII_IS_DEFAULT_ENCODING: + # ASCII is the default encoding in Python 2. Without a coding + # declaration, Python 2 will complain about any bytes in the file + # outside the ASCII range. Sadly, this behavior does not extend to + # compile() or ast.parse(), which prefer to interpret the bytes as + # latin-1. (At least they properly handle explicit coding cookies.) To + # preserve this error behavior, we could force ast.parse() to use ASCII + # as the encoding by inserting a coding cookie. Unfortunately, that + # messes up line numbers. Thus, we have to check ourselves if anything + # is outside the ASCII range in the case no encoding is explicitly + # declared. For more context, see issue #269. Yay for Python 3 which + # gets this right. + end1 = source.find("\n") + end2 = source.find("\n", end1 + 1) + if (not source.startswith(BOM_UTF8) and + (not cookie_re.match(source[0:end1]) or + not cookie_re.match(source[end1:end2]))): + try: + source.decode("ascii") + except UnicodeDecodeError: + # Let it fail in real import. + return None # On Python versions which are not 2.7 and less than or equal to 3.1, the # parser expects *nix newlines. if REWRITE_NEWLINES: diff -r a4ad4a06149f957d921d1f9a4e33ed88ddf7cf07 -r 62e3666c1cec8bdd6767dd207a153cb23f2a9ef3 testing/test_assertrewrite.py --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -394,3 +394,11 @@ b = content.encode("utf-8") testdir.tmpdir.join("test_newlines.py").write(b, "wb") assert testdir.runpytest().ret == 0 + + @pytest.mark.skipif("sys.version_info[0] >= 3") + def test_assume_ascii(self, testdir): + content = "u'\xe2\x99\xa5'" + testdir.tmpdir.join("test_encoding.py").write(content, "wb") + res = testdir.runpytest() + assert res.ret != 0 + assert "SyntaxError: Non-ASCII character" in res.stdout.str() 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 Mar 10 10:00:39 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 10 Mar 2013 09:00:39 -0000 Subject: [Pytest-commit] commit/pytest: tkf: Add texinfo build target to doc/*/Makefile Message-ID: <20130310090039.4540.17876@bitbucket16.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/1944bf94e464/ changeset: 1944bf94e464 user: tkf date: 2013-03-10 07:25:14 summary: Add texinfo build target to doc/*/Makefile affected #: 4 files diff -r 62e3666c1cec8bdd6767dd207a153cb23f2a9ef3 -r 1944bf94e4648184bddcb5bbbbe8c02bcecd2184 doc/en/Makefile --- a/doc/en/Makefile +++ b/doc/en/Makefile @@ -31,6 +31,8 @@ @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @@ -142,3 +144,18 @@ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." + +texinfo: + mkdir -p $(BUILDDIR)/texinfo + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + mkdir -p $(BUILDDIR)/texinfo + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." diff -r 62e3666c1cec8bdd6767dd207a153cb23f2a9ef3 -r 1944bf94e4648184bddcb5bbbbe8c02bcecd2184 doc/en/conf.py --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -273,6 +273,19 @@ #epub_tocdup = True +# -- Options for texinfo output ------------------------------------------------ + +texinfo_documents = [ + (master_doc, 'pytest', 'pytest Documentation', + ('Holger Krekel@*Benjamin Peterson@*Ronny Pfannschmidt@*' + 'Floris Bruynooghe@*others'), + 'pytest', + 'simple powerful testing with Pytho', + 'Programming', + 1), +] + + # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'python': ('http://docs.python.org/', None), # 'lib': ("http://docs.python.org/2.7library/", None), diff -r 62e3666c1cec8bdd6767dd207a153cb23f2a9ef3 -r 1944bf94e4648184bddcb5bbbbe8c02bcecd2184 doc/ja/Makefile --- a/doc/ja/Makefile +++ b/doc/ja/Makefile @@ -29,6 +29,8 @@ @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @@ -140,3 +142,18 @@ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." + +texinfo: + mkdir -p $(BUILDDIR)/texinfo + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + mkdir -p $(BUILDDIR)/texinfo + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." diff -r 62e3666c1cec8bdd6767dd207a153cb23f2a9ef3 -r 1944bf94e4648184bddcb5bbbbe8c02bcecd2184 doc/ja/conf.py --- a/doc/ja/conf.py +++ b/doc/ja/conf.py @@ -261,6 +261,19 @@ #epub_tocdup = True +# -- Options for texinfo output ------------------------------------------------ + +texinfo_documents = [ + (master_doc, 'pytest', 'pytest Documentation', + ('Holger Krekel@*Benjamin Peterson@*Ronny Pfannschmidt@*' + 'Floris Bruynooghe@*others'), + 'pytest', + 'simple powerful testing with Pytho', + 'Programming', + 1), +] + + # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {} # 'http://docs.python.org/': None} def setup(app): 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 Mar 10 15:08:11 2013 From: issues-reply at bitbucket.org (idella5) Date: Sun, 10 Mar 2013 14:08:11 -0000 Subject: [Pytest-commit] [hpk42/tox] pypy and its install of virtualenv too much for testsuite (issue #88) Message-ID: --- you can reply above this line --- New issue 88: pypy and its install of virtualenv too much for testsuite https://bitbucket.org/hpk42/tox/issue/88/pypy-and-its-install-of-virtualenv-too idella5: See attachment for what happens when I added pypy suuport to tox and let it loose on the tox testsuite. culminating in File "/usr/lib64/pypy1.9/site-packages/virtualenv.py", line 1629, in fix_lib64 "Unexpected python lib dir: %r" % lib_dir) AssertionError: Unexpected python lib dir: 'python' ERROR: InvocationError: /usr/lib64/pypy1.9/pypy-c /usr/lib64/pypy1.9/site-packages/virtualenv.py --distribute python Is this a tox test suite invoked trip, or is it something to handball to virtualenv? I am taking a punt at the way pypy installs its libdir is a bit much when it has dev-python/tox $ ls /usr/lib64/pypy1.9/ include lib_pypy lib-python pypy-c restkit share site-packages socketpool Hmm, which one to choose???? lib-python or lib_pypy???? eeeeer? Responsible: hpk42 -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Sat Mar 9 01:29:27 2013 From: issues-reply at bitbucket.org (jenisys) Date: Sat, 09 Mar 2013 00:29:27 -0000 Subject: [Pytest-commit] [hpk42/pytest] HINT: How to provide coloring in demo with failing tests in docs (issue #270) Message-ID: --- you can reply above this line --- New issue 270: HINT: How to provide coloring in demo with failing tests in docs https://bitbucket.org/hpk42/pytest/issue/270/hint-how-to-provide-coloring-in-demo-with jenisys: **CONTEXT:** docs On page [reportingdemo](http://pytest.org/latest/example/reportingdemo.html#tbreportdemo) you write that you are working on the issue of providing coloring information. I had a similar problem with sphinx and solved it by using: * sphinxcontrib-programoutput * sphinxcontrib-ansi I basically run the command (with ANSI mode enabled) while generating the docs. This will capture the ANSI coloring escape sequences and convert it into HTML colors while generated HTML docs. **DOCUMENTATION EXAMPLE** (of colored output): [tutorial01.html#run-the-feature-test](http://jenisys.github.com/behave.example/tutorials/tutorial01.html#run-the-feature-test) Look at my [github project](https://github.com/jenisys/behave.example) for the details (if this solution would be of interest for you). -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Tue Mar 12 11:51:12 2013 From: issues-reply at bitbucket.org (Ronny Pfannschmidt) Date: Tue, 12 Mar 2013 10:51:12 -0000 Subject: [Pytest-commit] [hpk42/tox] support for pip 1.3 networkless install/cache (issue #89) Message-ID: --- you can reply above this line --- New issue 89: support for pip 1.3 networkless install/cache https://bitbucket.org/hpk42/tox/issue/89/support-for-pip-13-networkless-install Ronny Pfannschmidt: -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Sat Mar 9 23:04:51 2013 From: issues-reply at bitbucket.org (reuben fletcher-costin) Date: Sat, 09 Mar 2013 22:04:51 -0000 Subject: [Pytest-commit] [hpk42/pytest] IOError when writing --junitxml report when run via xdist, sometimes (issue #271) Message-ID: --- you can reply above this line --- New issue 271: IOError when writing --junitxml report when run via xdist, sometimes https://bitbucket.org/hpk42/pytest/issue/271/ioerror-when-writing-junitxml-report-when reuben fletcher-costin: Hi, py.test crashed 3 out of 10 times when using py.test -n8 --junitxml report.xml to run the following trivial test: ``` #!python def test_foo(): assert True ``` When it crashes, the output looks like this (although sometimes more than 1 node may crash per run): ``` #!text C:\test_pytest>py.test -n8 --junitxml report.xml ===================================================================== test session starts ==================== platform win32 -- Python 2.7.3 -- pytest-2.3.4 plugins: cov, xdist gw0 [0] / gw1 [0] / gw2 [0] / gw3 [0] / gw4 [0] / gw5 [0] / gw6 [0] / gw7 [0] scheduling tests via LoadScheduling [gw5] node down: Traceback (most recent call last): File "C:\Python27\lib\site-packages\execnet\gateway_base.py", line 800, in executetask do_exec(co, loc) File "", line 1, in do_exec File "", line 139, in File "C:\Python27\lib\site-packages\_pytest\core.py", line 422, in __call__ return self._docall(methods, kwargs) File "C:\Python27\lib\site-packages\_pytest\core.py", line 433, in _docall res = mc.execute() File "C:\Python27\lib\site-packages\_pytest\core.py", line 351, in execute res = method(**kwargs) File "C:\Python27\lib\site-packages\_pytest\main.py", line 107, in pytest_cmdline_main return wrap_session(config, _main) File "C:\Python27\lib\site-packages\_pytest\main.py", line 99, in wrap_session exitstatus=session.exitstatus or (session._testsfailed and 1)) File "C:\Python27\lib\site-packages\_pytest\core.py", line 422, in __call__ return self._docall(methods, kwargs) File "C:\Python27\lib\site-packages\_pytest\core.py", line 433, in _docall res = mc.execute() File "C:\Python27\lib\site-packages\_pytest\core.py", line 351, in execute res = method(**kwargs) File "C:\Python27\lib\site-packages\_pytest\junitxml.py", line 202, in pytest_sessionfinish logfile = py.std.codecs.open(self.logfile, 'w', encoding='utf-8') File "C:\Python27\lib\codecs.py", line 881, in open file = __builtin__.open(filename, mode, buffering) IOError: [Errno 22] invalid mode ('wb') or filename: 'C:\\test_pytest\\report.xml' -------------------------------------------------------- generated xml file: C:\test_pytest\report.xml ------- ====================================================================== in 1.47 seconds ====================== ``` These results are from windows 7 professional with python 2.7.3, running on a machine with four cores: ``` #!text py.test --version This is py.test version 2.3.4, imported from C:\Python27\lib\site-packages\pytest.pyc setuptools registered plugins: pytest-cov-1.6 at C:\Python27\lib\site-packages\pytest_cov.pyc pytest-xdist-1.8 at C:\Python27\lib\site-packages\xdist\plugin.pyc python --version Python 2.7.3 >>> import execnet >>> execnet.__version__ '1.1' ``` My guess: perhaps each node is writing its own copy of the xml report to the same filename. -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Wed Mar 13 10:57:09 2013 From: issues-reply at bitbucket.org (Ronny Pfannschmidt) Date: Wed, 13 Mar 2013 09:57:09 -0000 Subject: [Pytest-commit] [hpk42/pytest] flush c buffers for fdcapture after each test (issue #272) Message-ID: --- you can reply above this line --- New issue 272: flush c buffers for fdcapture after each test https://bitbucket.org/hpk42/pytest/issue/272/flush-c-buffers-for-fdcapture-after-each Ronny Pfannschmidt: we should at least have an option for that else we get the c buffers flushed in other tests or at the end of the process -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Wed Mar 13 16:21:05 2013 From: issues-reply at bitbucket.org (Ronny Pfannschmidt) Date: Wed, 13 Mar 2013 15:21:05 -0000 Subject: [Pytest-commit] [hpk42/pytest] plugins entrypoint for plugins that should run before conftest (issue #273) Message-ID: --- you can reply above this line --- New issue 273: plugins entrypoint for plugins that should run before conftest https://bitbucket.org/hpk42/pytest/issue/273/plugins-entrypoint-for-plugins-that-should Ronny Pfannschmidt: this would help with import coverage and with plugins that cause c module rebuild for example -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Wed Mar 13 22:14:23 2013 From: issues-reply at bitbucket.org (Takafumi Arakaki) Date: Wed, 13 Mar 2013 21:14:23 -0000 Subject: [Pytest-commit] [hpk42/pytest] INTERNALERROR when running doctest (issue #274) Message-ID: --- you can reply above this line --- New issue 274: INTERNALERROR when running doctest https://bitbucket.org/hpk42/pytest/issue/274/internalerror-when-running-doctest Takafumi Arakaki: Clone my pytest-doctest-error branch of Jedi (https://github.com/tkf/jedi/tree/pytest-doctest-error) and run `py.test --doctest-modules jedi/api_classes.py`. I have this error: ``` #!tb ============================= test session starts ============================== platform linux2 -- Python 2.7.2 -- pytest-2.3.4 plugins: xdist, ipdb collected 1 items jedi/api_classes.py INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/main.py", line 81, in wrap_session INTERNALERROR> doit(config, session) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/main.py", line 113, in _main INTERNALERROR> config.hook.pytest_runtestloop(session=session) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/core.py", line 422, in __call__ INTERNALERROR> return self._docall(methods, kwargs) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/core.py", line 433, in _docall INTERNALERROR> res = mc.execute() INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/core.py", line 351, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/main.py", line 133, in pytest_runtestloop INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/core.py", line 422, in __call__ INTERNALERROR> return self._docall(methods, kwargs) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/core.py", line 433, in _docall INTERNALERROR> res = mc.execute() INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/core.py", line 351, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/runner.py", line 62, in pytest_runtest_protocol INTERNALERROR> runtestprotocol(item, nextitem=nextitem) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/runner.py", line 69, in runtestprotocol INTERNALERROR> reports.append(call_and_report(item, "call", log)) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/runner.py", line 100, in call_and_report INTERNALERROR> report = hook.pytest_runtest_makereport(item=item, call=call) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/main.py", line 157, in call_matching_hooks INTERNALERROR> return hookmethod.pcall(plugins, **kwargs) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/core.py", line 426, in pcall INTERNALERROR> return self._docall(methods, kwargs) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/core.py", line 433, in _docall INTERNALERROR> res = mc.execute() INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/core.py", line 351, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/capture.py", line 171, in pytest_runtest_makereport INTERNALERROR> rep = __multicall__.execute() INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/core.py", line 351, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/runner.py", line 191, in pytest_runtest_makereport INTERNALERROR> longrepr = item.repr_failure(excinfo) INTERNALERROR> File "/.../local/lib/python2.7/site-packages/_pytest/doctest.py", line 44, in repr_failure INTERNALERROR> lineno = test.lineno + example.lineno + 1 INTERNALERROR> TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' =============================== in 0.86 seconds =============================== ``` Note that `nosetests --with-doctest jedi/api_classes.py` works. It reports: ``` Ran 4 tests in 1.509s FAILED (failures=1) ``` -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Thu Mar 14 18:45:07 2013 From: issues-reply at bitbucket.org (Takafumi Arakaki) Date: Thu, 14 Mar 2013 17:45:07 -0000 Subject: [Pytest-commit] [hpk42/pytest] doctest does not consider usefixtures in pytest.ini (issue #275) Message-ID: --- you can reply above this line --- New issue 275: doctest does not consider usefixtures in pytest.ini https://bitbucket.org/hpk42/pytest/issue/275/doctest-does-not-consider-usefixtures-in Takafumi Arakaki: Running `py.test` with the following files fail: `pytest.ini`: ``` #!ini [pytest] addopts = --doctest-modules usefixtures = myfixture ``` `conftest.py`: ``` #!python import pytest @pytest.fixture() def myfixture(monkeypatch): monkeypatch.setenv('MYENV', 'value') ``` `test_env.py`: ``` #!python """ >>> os.environ['MYENV'] == 'value' True """ import os def test(): assert os.environ['MYENV'] == 'value' ``` Normal test passes but doctest fails: ``` ============================== test session starts =============================== platform linux2 -- Python 2.7.2 -- pytest-2.3.4 plugins: xdist, ipdb collected 3 items conftest.py . test_env.py F. ==================================== FAILURES ==================================== ___________________________________ [doctest] ____________________________________ 001 """ 002 >>> os.environ['MYENV'] == 'value' UNEXPECTED EXCEPTION: KeyError('MYENV',) Traceback (most recent call last): File "/usr/lib/python2.7/doctest.py", line 1254, in __run compileflags, 1) in test.globs File "", line 1, in File "/.../lib/python2.7/UserDict.py", line 23, in __getitem__ raise KeyError(key) KeyError: 'MYENV' /.../test_env.py:2: UnexpectedException ======================= 1 failed, 2 passed in 0.02 seconds ==================== ``` -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Fri Mar 15 04:42:45 2013 From: issues-reply at bitbucket.org (jindou.io) Date: Fri, 15 Mar 2013 03:42:45 -0000 Subject: [Pytest-commit] [hpk42/pytest] Issue #217 did not resolved!! (issue #276) Message-ID: --- you can reply above this line --- New issue 276: Issue #217 did not resolved!! https://bitbucket.org/hpk42/pytest/issue/276/issue-217-did-not-resolved jindou.io: This testcase will failed. ``` class T(unittest.TestCase): @mock.patch("os.path.abspath") def test_hello(self, abspath, tmpdir): os.path.abspath("hello") abspath.assert_any_call("hello") ``` Next will working: ``` @mock.patch("os.path.abspath") @mock.patch("os.path.normpath") def test_someting(normpath, abspath, tmpdir, capsys): abspath.return_value = "this" os.path.normpath(os.path.abspath("hello")) normpath.assert_any_call("this") ``` Responsible: hpk42 -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Sun Mar 17 01:55:00 2013 From: issues-reply at bitbucket.org (Alexander Steinert) Date: Sun, 17 Mar 2013 00:55:00 -0000 Subject: [Pytest-commit] [hpk42/pytest] Markers as functions (issue #277) Message-ID: --- you can reply above this line --- New issue 277: Markers as functions https://bitbucket.org/hpk42/pytest/issue/277/markers-as-functions Alexander Steinert: Scattering a custom marker registration/defintion/usage to different hook functions -- like done in http://pytest.org/latest/example/markers.html#custom-marker-and-command-line-option-to-control-test-runs -- does not scale well to multiple markers. I would prefer to define a custom marker as a function that gets called at collection time for each marked test. Example: ``` #!python import re import pytest @pytest.marker def verifies(requirement): """mark test as verifying a requirement""" assert re.search(r"^http://myjira/browse/PROJ-\d+$", requirement) @pytest.mark.verifies("http://myjira/browse/PROJ-42") def test_42(): ??? assert 6 * 8 != 42 ``` With the decorator pytest.marker we could avoid calling config.addinivalue_line("markers", ...) and be able to check marker arguments. The arguments should be available in hooks, e.g. ``` #!python item.keywords["verifies"].getarg("requirement"). ``` Holger has an unfinished patch which allows roughly the above. His decorator is called pytest.markdefinition. I would prefer pytest.marker but thats just a matter of taste. -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From commits-noreply at bitbucket.org Sun Mar 17 04:11:11 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 17 Mar 2013 03:11:11 -0000 Subject: [Pytest-commit] commit/pytest: gutworth: python 2.4 compatibility Message-ID: <20130317031111.18496.64332@bitbucket01.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/8838ca6ac79e/ changeset: 8838ca6ac79e user: gutworth date: 2013-03-17 04:08:01 summary: python 2.4 compatibility affected #: 1 file diff -r 1944bf94e4648184bddcb5bbbbe8c02bcecd2184 -r 8838ca6ac79e51b133e8a64ec209909ea37cc4c5 _pytest/runner.py --- a/_pytest/runner.py +++ b/_pytest/runner.py @@ -364,7 +364,7 @@ contain info about test and collection outcomes. """ def __init__(self, msg=None, pytrace=True): - super(OutcomeException, self).__init__(msg) + Exception.__init__(self, msg) self.msg = msg self.pytrace = pytrace 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 Mar 17 18:08:51 2013 From: issues-reply at bitbucket.org (g2p) Date: Sun, 17 Mar 2013 17:08:51 -0000 Subject: [Pytest-commit] [hpk42/tox] [PATCH] Fix lazy-loading (issue #90) Message-ID: --- you can reply above this line --- New issue 90: [PATCH] Fix lazy-loading https://bitbucket.org/hpk42/tox/issue/90/patch-fix-lazy-loading g2p: See #75 and #72 for context. The envsitepackagesdir test was broken, the attached patch fixes that and a problem with lazy-loading properties (which also needs to be done on the getargvlist ? _processcommand code path). -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Sun Mar 17 18:50:12 2013 From: issues-reply at bitbucket.org (Chris Adams) Date: Sun, 17 Mar 2013 17:50:12 -0000 Subject: [Pytest-commit] [hpk42/tox] Python 2.5 support (issue #91) Message-ID: --- you can reply above this line --- New issue 91: Python 2.5 support https://bitbucket.org/hpk42/tox/issue/91/python-25-support Chris Adams: tox currently lists Python 2.5 as the earliest supported version. Unfortunately, it no longer works because PyPI changed to require SSL, which breaks on Python 2.5 unless you have installed the ssl backport (see http://www.pip-installer.org/en/latest/logic.html#ssl-backport). At first, I thought I could do this within my commands stanza but ran into two problems: * Due to #2, you cannot simply use curl to fetch the package ("test command found but not installed in testenv") * Even if that worked, #38 would mean that you'd be forced to copy and paste around the inability to do something like this: ``` #!ini deps = # Do nothing because pip is broken on Python 2.5 # http://www.pip-installer.org/en/latest/logic.html#ssl-backport commands = curl -s -o {envtmpdir}/ssl-1.15.tar.gz https://pypi.python.org/packages/source/s/ssl/ssl-1.15.tar.gz pip install {envtmpdir}/ssl-1.15.tar.gz pip install -r {toxinidir}/tests/requirements_25.txt pip install django==1.3 {[testenv]commands} ``` I think it'd either make sense to have an automatic hook to install ssl on Python 2.5 or simply drop support for it as it's rather old and backport RPMs are available for legacy Red Hat users. -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Tue Mar 19 20:26:02 2013 From: issues-reply at bitbucket.org (mears) Date: Tue, 19 Mar 2013 19:26:02 -0000 Subject: [Pytest-commit] [hpk42/pytest] Reduced functionality for setup methods (issue #278) Message-ID: --- you can reply above this line --- New issue 278: Reduced functionality for setup methods https://bitbucket.org/hpk42/pytest/issue/278/reduced-functionality-for-setup-methods mears: Consider a setup method that needs to receive funcargs. 1. py.test does not dependency inject arguments into xUnit style setup methods. I believe it should 2. In earlier 2.3 builds there was a decorator @pytest.mark.setup that could be used to designate a setup method that could use funcargs. This no longer works in 2.3.4. 3. Regarding #2, you might say, well use use a standard fixture with autouse=True. The problem here is that when using autouse, you **cannot** combine a different scope. This is fine if you want a setup method with function scope, but not if you want a setup to run at the module level. @pytest.mark.setup should be fixed or dependency injection should be added for setup/teardown. -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Wed Mar 20 01:39:38 2013 From: issues-reply at bitbucket.org (Brianna Laugher) Date: Wed, 20 Mar 2013 00:39:38 -0000 Subject: [Pytest-commit] [hpk42/pytest] Output on assertion failure of object comparisons could be better (issue #279) Message-ID: --- you can reply above this line --- New issue 279: Output on assertion failure of object comparisons could be better https://bitbucket.org/hpk42/pytest/issue/279/output-on-assertion-failure-of-object Brianna Laugher: I [mentioned](http://mail.python.org/pipermail/pytest-dev/2013-March/002208.html) on pytest-dev that the output when tests fail from assertions around objects, especially lists/dicts/sets of objects, could be improved. In particular, comparisons appear with diff text which has ... "Skipping x identical leading characters in diff" (ie truncated) but there is no way to get the "full diff" - the truncated diff is usually fine when comparing strings directly but you need the full string to understand it properly when comparing, say, dicts. [testfixtures.compare](http://mail.python.org/pipermail/pytest-dev/2013-March/002208.html) is more verbose, could be a useful starting point. Here is an example that might be useful. ``` #!python from collections import namedtuple import datetime from testfixtures import compare TR = namedtuple('TR', 'start end') def test_Foo(): todayStart = datetime.datetime.today() todayEnd = todayStart + datetime.timedelta(hours=24) todayEndLater = todayEnd + datetime.timedelta(seconds=5) a = {frozenset('abc'): TR(todayStart, todayEndLater), frozenset('efg'): TR(todayStart, todayEnd)} b = {frozenset('abc'): TR(todayStart, todayEnd), frozenset('efg'): TR(todayStart, todayEnd)} compare(a, b) # assert a == b ``` Native pytest output: ``` #! > assert a == b E assert {frozenset(['... 19, 456379))} == {frozenset(['a... 19, 456379))} E Skipping 121 identical leading characters in diff E Skipping 147 identical trailing characters in diff E - 1, 8, 35, 24, 456379) E ? ^^ E + 1, 8, 35, 19, 456379) E ? ^^ ``` testfixtures.compare output: ``` #! > compare(a, b) ../GFESuite-Builds/Release/release/lib/python2.7/site-packages/testfixtures/comparison.py:268: in compare > raise AssertionError(message) E AssertionError: dict not as expected: E E same: E [frozenset(['e', 'g', 'f'])] E E values differ: E frozenset(['a', 'c', 'b']): TR(start=datetime.datetime(2013, 3, 20, 8, 35, 36, 430903), end=datetime.datetime(2013, 3, 21, 8, 35, 41, 430903)) != TR(start=datetime.datetime(2013, 3, 20, 8, 35, 36, 430903), end=datetime.datetime(2013, 3, 21, 8, 35, 36, 430903)) ``` At least with the latter I have a clue about which key/value is causing the problem. This is with pytest-2.2.3 but I don't think it's improved in 2.3. -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Wed Mar 20 17:03:02 2013 From: issues-reply at bitbucket.org (tlynn) Date: Wed, 20 Mar 2013 16:03:02 -0000 Subject: [Pytest-commit] [hpk42/pytest] Assertion rewriting failure for call with keyword on Py 2.6.0 (issue #280) Message-ID: --- you can reply above this line --- New issue 280: Assertion rewriting failure for call with keyword on Py 2.6.0 https://bitbucket.org/hpk42/pytest/issue/280/assertion-rewriting-failure-for-call-with tlynn: "assert f(x=True)" upsets the assertion rewriter in Python 2.6.0 (minor version seems to matter). The 'keyword' ast node for 'x' in 'f(x=True)' lacks an '_attributes' attribute in Python 2.6.0. This breaks the set_location function at _pytest/assertion/rewrite.py:316. The node does have a .value attribute with '_attributes' though, so you could fall back to using that. This looks related to http://bugs.python.org/issue4067. -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From issues-reply at bitbucket.org Thu Mar 21 08:48:10 2013 From: issues-reply at bitbucket.org (Jason Lee) Date: Thu, 21 Mar 2013 07:48:10 -0000 Subject: [Pytest-commit] [hpk42/pytest] pytest object has no attribute 'main' (issue #281) Message-ID: --- you can reply above this line --- New issue 281: pytest object has no attribute 'main' https://bitbucket.org/hpk42/pytest/issue/281/pytest-object-has-no-attribute-main Jason Lee: I copied the code in pytest usage.html#pytest-main-usage as followed: import pytest class MyPlugin: def pytest_sessionfinish(self): print("*** test run reporting finishing") pytest.main("-qq", plugins=[MyPlugin()]) into a file named mytest_1.py and then execute "python mytest_1.py" I got the result: **Traceback (most recent call last): File "mytest_1.py", line 7, in pytest.main("-qq", plugins=[MyPlugin()]) AttributeError: 'module' object has no attribute 'main'** and the expected is: *** test run reporting finishing py.test information :py.test version 2.3.4, imported from /usr/local/lib/python2.7/site-packages/pytest.pyc python information:Python 2.7.3 system information:Linux 2.6.32.16-141.1.x86_64 #1 SMP Wed Jul 14 22:04:02 CST 2010 x86_64 x86_64 x86_64 GNU/Linux Responsible: hpk42 -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From commits-noreply at bitbucket.org Thu Mar 21 12:33:50 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 21 Mar 2013 11:33:50 -0000 Subject: [Pytest-commit] commit/pytest: 8 new changesets Message-ID: <20130321113350.1453.77770@bitbucket23.managed.contegix.com> 8 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/8fe255a64587/ changeset: 8fe255a64587 branch: doctest-fixtures user: witsch date: 2013-01-30 17:32:37 summary: pass fixture request object (and convenience shortcut to get fixtures) into doctest files affected #: 1 file diff -r 4c071ec6f091658d94aed3a8c6b647c9a97159b8 -r 8fe255a6458719115c6f3a3b08afda16b8cd7e37 _pytest/doctest.py --- a/_pytest/doctest.py +++ b/_pytest/doctest.py @@ -1,6 +1,7 @@ """ discover and run doctests in modules and test files.""" import pytest, py +from _pytest.python import FixtureRequest, FuncFixtureInfo from py._code.code import TerminalRepr, ReprFileLocation def pytest_addoption(parser): @@ -70,9 +71,15 @@ class DoctestTextfile(DoctestItem, pytest.File): def runtest(self): doctest = py.std.doctest + # satisfy `FixtureRequest` constructor... + self.funcargs = {} + self._fixtureinfo = FuncFixtureInfo((), [], {}) + fixture_request = FixtureRequest(self) failed, tot = doctest.testfile( str(self.fspath), module_relative=False, optionflags=doctest.ELLIPSIS, + extraglobs=dict(fixture_request=fixture_request, + get_fixture=fixture_request.getfuncargvalue), raise_on_error=True, verbose=0) class DoctestModule(DoctestItem, pytest.File): https://bitbucket.org/hpk42/pytest/commits/845b874d0279/ changeset: 845b874d0279 branch: doctest-fixtures user: witsch date: 2013-03-20 16:36:48 summary: don't expose the `FixtureRequest` object itself in doctests. in most cases `get_fixture` is sufficient, and you can always call `get_fixture('request')` anyway affected #: 1 file diff -r 8fe255a6458719115c6f3a3b08afda16b8cd7e37 -r 845b874d0279066996b0003ecca98c628aafa962 _pytest/doctest.py --- a/_pytest/doctest.py +++ b/_pytest/doctest.py @@ -78,8 +78,7 @@ failed, tot = doctest.testfile( str(self.fspath), module_relative=False, optionflags=doctest.ELLIPSIS, - extraglobs=dict(fixture_request=fixture_request, - get_fixture=fixture_request.getfuncargvalue), + extraglobs=dict(get_fixture=fixture_request.getfuncargvalue), raise_on_error=True, verbose=0) class DoctestModule(DoctestItem, pytest.File): https://bitbucket.org/hpk42/pytest/commits/42e91cdf91ed/ changeset: 42e91cdf91ed branch: doctest-fixtures user: witsch date: 2013-03-20 17:14:28 summary: test `get_fixture` helper for doctests affected #: 1 file diff -r 845b874d0279066996b0003ecca98c628aafa962 -r 42e91cdf91ed8aa448d6a4c4f995d620985e2b11 testing/test_doctest.py --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -124,3 +124,12 @@ " 1", "*test_txtfile_failing.txt:2: DocTestFailure" ]) + + def test_txtfile_with_fixtures(self, testdir, tmpdir): + p = testdir.maketxtfile(""" + >>> dir = get_fixture('tmpdir') + >>> type(dir).__name__ + 'LocalPath' + """) + reprec = testdir.inline_run(p, ) + reprec.assertoutcome(passed=1) https://bitbucket.org/hpk42/pytest/commits/aef8c6257507/ changeset: aef8c6257507 branch: doctest-fixtures user: witsch date: 2013-03-20 17:32:48 summary: also provide `get_fixture` helper for module level doctests affected #: 2 files diff -r 42e91cdf91ed8aa448d6a4c4f995d620985e2b11 -r aef8c6257507b79fe5843562889b2d6ac8017455 _pytest/doctest.py --- a/_pytest/doctest.py +++ b/_pytest/doctest.py @@ -88,6 +88,11 @@ module = self.config._conftest.importconftest(self.fspath) else: module = self.fspath.pyimport() + # satisfy `FixtureRequest` constructor... + self.funcargs = {} + self._fixtureinfo = FuncFixtureInfo((), [], {}) + fixture_request = FixtureRequest(self) failed, tot = doctest.testmod( module, raise_on_error=True, verbose=0, + extraglobs=dict(get_fixture=fixture_request.getfuncargvalue), optionflags=doctest.ELLIPSIS) diff -r 42e91cdf91ed8aa448d6a4c4f995d620985e2b11 -r aef8c6257507b79fe5843562889b2d6ac8017455 testing/test_doctest.py --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -133,3 +133,14 @@ """) reprec = testdir.inline_run(p, ) reprec.assertoutcome(passed=1) + + def test_doctestmodule_with_fixtures(self, testdir, tmpdir): + p = testdir.makepyfile(""" + ''' + >>> dir = get_fixture('tmpdir') + >>> type(dir).__name__ + 'LocalPath' + ''' + """) + reprec = testdir.inline_run(p, "--doctest-modules") + reprec.assertoutcome(passed=1) https://bitbucket.org/hpk42/pytest/commits/08b5b1589954/ changeset: 08b5b1589954 branch: doctest-fixtures user: witsch date: 2013-03-20 17:54:38 summary: update the documentation regarding the `get_fixture` helper please note that the japanese translation was done using "google translate" and should probably be checked again... :) affected #: 2 files Diff not available. https://bitbucket.org/hpk42/pytest/commits/7c165e6e429a/ changeset: 7c165e6e429a branch: doctest-fixtures user: witsch date: 2013-03-21 01:03:59 summary: remove debugging left-overs affected #: 1 file Diff not available. https://bitbucket.org/hpk42/pytest/commits/91495671c0d1/ changeset: 91495671c0d1 branch: doctest-fixtures user: witsch date: 2013-03-21 12:04:14 summary: rename `get_fixture` to `getfixture` to better match the current API style affected #: 4 files Diff not available. https://bitbucket.org/hpk42/pytest/commits/56fb27ee91c7/ changeset: 56fb27ee91c7 user: hpk42 date: 2013-03-21 12:33:43 summary: Merged in witsch/pytest/doctest-fixtures (pull request #25) fixture support in doctests affected #: 4 files Diff not available. 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 Mar 21 12:41:51 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 21 Mar 2013 11:41:51 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: added changelog entry for getfixture() for doctests Message-ID: <20130321114151.22963.17871@bitbucket21.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/b4fbc67f6e9f/ changeset: b4fbc67f6e9f user: hpk42 date: 2013-03-21 12:41:39 summary: added changelog entry for getfixture() for doctests affected #: 2 files diff -r 56fb27ee91c704d1c06832adb730b4a0a113b6fc -r b4fbc67f6e9f5f5f20e15eb0d6f5f12f16991001 AUTHORS --- a/AUTHORS +++ b/AUTHORS @@ -24,3 +24,4 @@ Christian Tismer Daniel Nuri Graham Horler +Andreas Zeidler diff -r 56fb27ee91c704d1c06832adb730b4a0a113b6fc -r b4fbc67f6e9f5f5f20e15eb0d6f5f12f16991001 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ Changes between 2.3.4 and 2.3.5dev ----------------------------------- + +- inject "getfixture()" helper to retrieve fixtures from doctests, + thanks Andreas Zeidler + - issue 259 - when assertion rewriting, be consistent with the default source encoding of ASCII on Python 2 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 Mar 21 18:19:13 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 21 Mar 2013 17:19:13 -0000 Subject: [Pytest-commit] commit/pytest: gutworth: disable assertion rewriting on CPython 2.6.0 because of bugs (fixes #280) Message-ID: <20130321171913.24348.17618@bitbucket20.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/3bd27c424613/ changeset: 3bd27c424613 user: gutworth date: 2013-03-21 18:19:01 summary: disable assertion rewriting on CPython 2.6.0 because of bugs (fixes #280) affected #: 2 files diff -r b4fbc67f6e9f5f5f20e15eb0d6f5f12f16991001 -r 3bd27c424613a79e529359063c90fd36309b331c CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ Changes between 2.3.4 and 2.3.5dev ----------------------------------- +- issue 280 - disable assertion rewriting on buggy CPython 2.6.0 + - inject "getfixture()" helper to retrieve fixtures from doctests, thanks Andreas Zeidler diff -r b4fbc67f6e9f5f5f20e15eb0d6f5f12f16991001 -r 3bd27c424613a79e529359063c90fd36309b331c _pytest/assertion/__init__.py --- a/_pytest/assertion/__init__.py +++ b/_pytest/assertion/__init__.py @@ -39,7 +39,10 @@ except ImportError: mode = "reinterp" else: - if sys.platform.startswith('java'): + # Both Jython and CPython 2.6.0 have AST bugs that make the + # assertion rewriting hook malfunction. + if (sys.platform.startswith('java') or + sys.version_info[:3] == (2, 6, 0)): mode = "reinterp" if mode != "plain": _load_modules(mode) 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 Mar 22 20:13:55 2013 From: issues-reply at bitbucket.org (Ronny Pfannschmidt) Date: Fri, 22 Mar 2013 19:13:55 -0000 Subject: [Pytest-commit] [hpk42/pytest] allow disabling setuptools plugin discovery (issue #282) Message-ID: <20130322191355.23677.6144@bitbucket05.managed.contegix.com> New issue 282: allow disabling setuptools plugin discovery https://bitbucket.org/hpk42/pytest/issue/282/allow-disabling-setuptools-plugin Ronny Pfannschmidt: in order to avoid unintented failures due to new plugins that find things that will fail -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From commits-noreply at bitbucket.org Sun Mar 24 20:05:56 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 24 Mar 2013 19:05:56 -0000 Subject: [Pytest-commit] commit/pytest: RonnyPfannschmidt: fix Issue 274 - dont fail when doctest does not know the example location Message-ID: <20130324190556.31212.80006@bitbucket03.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/8908cc8650ff/ Changeset: 8908cc8650ff User: RonnyPfannschmidt Date: 2013-03-24 20:05:29 Summary: fix Issue 274 - dont fail when doctest does not know the example location instead only the last test is shown, this could use some further enhancement Affected #: 3 files diff -r 3bd27c424613a79e529359063c90fd36309b331c -r 8908cc8650ff538acbfa175a5d5e07effa140c23 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,9 @@ Changes between 2.3.4 and 2.3.5dev ----------------------------------- +- Issue 274 - dont try to show full doctest example + when doctest does not know the example location + - issue 280 - disable assertion rewriting on buggy CPython 2.6.0 - inject "getfixture()" helper to retrieve fixtures from doctests, diff -r 3bd27c424613a79e529359063c90fd36309b331c -r 8908cc8650ff538acbfa175a5d5e07effa140c23 _pytest/doctest.py --- a/_pytest/doctest.py +++ b/_pytest/doctest.py @@ -42,17 +42,27 @@ example = doctestfailure.example test = doctestfailure.test filename = test.filename - lineno = test.lineno + example.lineno + 1 + if test.lineno is None: + lineno = None + else: + lineno = test.lineno + example.lineno + 1 message = excinfo.type.__name__ reprlocation = ReprFileLocation(filename, lineno, message) checker = py.std.doctest.OutputChecker() REPORT_UDIFF = py.std.doctest.REPORT_UDIFF filelines = py.path.local(filename).readlines(cr=0) - i = max(test.lineno, max(0, lineno - 10)) # XXX? lines = [] - for line in filelines[i:lineno]: - lines.append("%03d %s" % (i+1, line)) - i += 1 + if lineno is not None: + i = max(test.lineno, max(0, lineno - 10)) # XXX? + for line in filelines[i:lineno]: + lines.append("%03d %s" % (i+1, line)) + i += 1 + else: + lines.append('EXAMPLE LOCATION UNKNOWN, not showing all tests of that example') + indent = '>>>' + for line in example.source.splitlines(): + lines.append('??? %s %s' % (indent, line)) + indent = '...' if excinfo.errisinstance(doctest.DocTestFailure): lines += checker.output_difference(example, doctestfailure.got, REPORT_UDIFF).split("\n") diff -r 3bd27c424613a79e529359063c90fd36309b331c -r 8908cc8650ff538acbfa175a5d5e07effa140c23 testing/test_doctest.py --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -59,6 +59,26 @@ "*UNEXPECTED*ZeroDivision*", ]) + def test_doctest_linedata_missing(self, testdir): + testdir.tmpdir.join('hello.py').write(py.code.Source(""" + class Fun(object): + @property + def test(self): + ''' + >>> a = 1 + >>> 1/0 + ''' + """)) + result = testdir.runpytest("--doctest-modules") + result.stdout.fnmatch_lines([ + "*hello*", + "*EXAMPLE LOCATION UNKNOWN, not showing all tests of that example*", + "*1/0*", + "*UNEXPECTED*ZeroDivision*", + "*1 failed*", + ]) + + def test_doctest_unex_importerror(self, testdir): testdir.tmpdir.join("hello.py").write(py.code.Source(""" import asdalsdkjaslkdjasd 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 Mar 24 20:43:54 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 24 Mar 2013 19:43:54 -0000 Subject: [Pytest-commit] commit/pytest: RonnyPfannschmidt: fix issue 271 - dont write junitxml on slave nodes Message-ID: <20130324194354.14582.81607@bitbucket24.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/14df4b5c4e82/ Changeset: 14df4b5c4e82 User: RonnyPfannschmidt Date: 2013-03-24 20:43:25 Summary: fix issue 271 - dont write junitxml on slave nodes Affected #: 3 files diff -r 8908cc8650ff538acbfa175a5d5e07effa140c23 -r 14df4b5c4e82c3ac9f9f1189fa13e89907317d48 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ Changes between 2.3.4 and 2.3.5dev ----------------------------------- +- issue 271 - dont write junitxml on slave nodes + - Issue 274 - dont try to show full doctest example when doctest does not know the example location diff -r 8908cc8650ff538acbfa175a5d5e07effa140c23 -r 14df4b5c4e82c3ac9f9f1189fa13e89907317d48 _pytest/junitxml.py --- a/_pytest/junitxml.py +++ b/_pytest/junitxml.py @@ -70,7 +70,8 @@ def pytest_configure(config): xmlpath = config.option.xmlpath - if xmlpath: + # prevent opening xmllog on slave nodes (xdist) + if xmlpath and not hasattr(config, 'slaveinput'): config._xml = LogXML(xmlpath, config.option.junitprefix) config.pluginmanager.register(config._xml) diff -r 8908cc8650ff538acbfa175a5d5e07effa140c23 -r 14df4b5c4e82c3ac9f9f1189fa13e89907317d48 testing/test_junitxml.py --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -289,6 +289,25 @@ assert newnames == ["a.pything", "Class", "method"] +def test_dont_configure_on_slaves(tmpdir): + gotten = [] + class FakeConfig: + def __init__(self): + self.pluginmanager = self + self.option = self + junitprefix = None + #XXX: shouldnt need tmpdir ? + xmlpath = str(tmpdir.join('junix.xml')) + register = gotten.append + fake_config = FakeConfig() + from _pytest import junitxml + junitxml.pytest_configure(fake_config) + assert len(gotten) == 1 + FakeConfig.slaveinput = None + junitxml.pytest_configure(fake_config) + assert len(gotten) == 1 + + class TestNonPython: def test_summing_simple(self, testdir): testdir.makeconftest(""" 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 Mar 25 08:53:21 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 25 Mar 2013 07:53:21 -0000 Subject: [Pytest-commit] commit/pytest: RonnyPfannschmidt: add a test for issue 14 that will xfail on python < 2.7 Message-ID: <20130325075321.10559.75235@bitbucket16.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/aed3e1770a96/ Changeset: aed3e1770a96 User: RonnyPfannschmidt Date: 2013-03-25 08:53:08 Summary: add a test for issue 14 that will xfail on python < 2.7 Affected #: 1 file diff -r 14df4b5c4e82c3ac9f9f1189fa13e89907317d48 -r aed3e1770a969fc8cd43e8d5a4a1a90e9bb2058a testing/test_capture.py --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -437,6 +437,18 @@ ]) assert result.ret == 2 + @pytest.mark.xfail("sys.version_info < (2,7)") + @pytest.mark.issue14 + def test_capture_and_logging(self, testdir): + p = testdir.makepyfile(""" + import logging + def test_log(capsys): + logging.error('x') + """) + result = testdir.runpytest(p) + assert 'closed' not in result.stderr.str() + + def test_setup_failure_does_not_kill_capturing(testdir): sub1 = testdir.mkpydir("sub1") sub1.join("conftest.py").write(py.code.Source(""" 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 Mar 25 10:52:16 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 25 Mar 2013 09:52:16 -0000 Subject: [Pytest-commit] commit/pytest: RonnyPfannschmidt: fix Issue 265 - integrate nose setup/teardown with setupstate Message-ID: <20130325095216.19160.54367@bitbucket23.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/05c01a1dd99d/ Changeset: 05c01a1dd99d User: RonnyPfannschmidt Date: 2013-03-25 10:52:02 Summary: fix Issue 265 - integrate nose setup/teardown with setupstate as sideeffect teardown is only called if setup doesnt fail Affected #: 3 files diff -r aed3e1770a969fc8cd43e8d5a4a1a90e9bb2058a -r 05c01a1dd99d958629c15cc579f273bd738045c3 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,9 @@ Changes between 2.3.4 and 2.3.5dev ----------------------------------- +- Issue 265 - integrate nose setup/teardown with setupstate + so it doesnt try to teardown if it did not setup + - issue 271 - dont write junitxml on slave nodes - Issue 274 - dont try to show full doctest example diff -r aed3e1770a969fc8cd43e8d5a4a1a90e9bb2058a -r 05c01a1dd99d958629c15cc579f273bd738045c3 _pytest/nose.py --- a/_pytest/nose.py +++ b/_pytest/nose.py @@ -28,8 +28,10 @@ if not call_optional(item.obj, 'setup'): # call module level setup if there is no object level one call_optional(item.parent.obj, 'setup') + #XXX this implies we only call teardown when setup worked + item.session._setupstate.addfinalizer((lambda: teardown_nose(item)), item) -def pytest_runtest_teardown(item): +def teardown_nose(item): if is_potential_nosetest(item): if not call_optional(item.obj, 'teardown'): call_optional(item.parent.obj, 'teardown') diff -r aed3e1770a969fc8cd43e8d5a4a1a90e9bb2058a -r 05c01a1dd99d958629c15cc579f273bd738045c3 testing/test_nose.py --- a/testing/test_nose.py +++ b/testing/test_nose.py @@ -304,4 +304,27 @@ result = testdir.runpytest() result.stdout.fnmatch_lines("*1 passed*") +def test_setup_teardown_linking_issue265(testdir): + # we accidnetially didnt integrate nose setupstate with normal setupstate + # this test ensures that won't happen again + testdir.makepyfile(''' + import pytest + class TestGeneric(object): + def test_nothing(self): + """Tests the API of the implementation (for generic and specialized).""" + + @pytest.mark.skipif("True", reason="Skip tests to check if teardown is skipped as well.") + class TestSkipTeardown(TestGeneric): + + def setup(self): + """Sets up my specialized implementation for $COOL_PLATFORM.""" + raise Exception("should not call setup for skipped tests") + + def teardown(self): + """Undoes the setup.""" + raise Exception("should not call teardown for skipped tests") + ''') + + result = testdir.runpytest() + result.stdout.fnmatch_lines("*1 skipped*") 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 Mar 26 07:36:01 2013 From: issues-reply at bitbucket.org (Ronny Pfannschmidt) Date: Tue, 26 Mar 2013 06:36:01 -0000 Subject: [Pytest-commit] [hpk42/pytest] traceback filtering hook (issue #283) Message-ID: <20130326063601.1206.92468@bitbucket15.managed.contegix.com> New issue 283: traceback filtering hook https://bitbucket.org/hpk42/pytest/issue/283/traceback-filtering-hook Ronny Pfannschmidt: we need a way to filter the bits of a traceback that are framework code since in normal development they seem to distract from the real problem i propose a hook+ soma pis to be able to replace sets of traceback entries by synthetic frames that will just output as note that framework frames have been skipped and of course, the --fulltrace option would opt out of it -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. From commits-noreply at bitbucket.org Wed Mar 27 10:30:36 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Wed, 27 Mar 2013 09:30:36 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20130327093036.31575.39141@bitbucket20.managed.contegix.com> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/bcab2f65482f/ Changeset: bcab2f65482f User: hpk42 Date: 2013-03-19 12:44:50 Summary: use --setuptools or --distribute option for virtualenv creation depending on config variable Affected #: 5 files diff -r f97a5361fe58de5c6c24affcec8abbf50b81b6a0 -r bcab2f65482ff082f5a1f04233ec9d463c9b53fc CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,11 @@ +1.5.0.dev +----------------- + +- depend on virtualenv-1.9.1 + +- use either --distribute or --setuptools depending + on "distribute" env config + 1.4.3 ----------------- diff -r f97a5361fe58de5c6c24affcec8abbf50b81b6a0 -r bcab2f65482ff082f5a1f04233ec9d463c9b53fc setup.py --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ def main(): version = sys.version_info[:2] - install_requires = ['virtualenv>=1.8.4', 'py>=1.4.12', ] + install_requires = ['virtualenv>=1.9.1', 'py>=1.4.13', ] if version < (2, 7) or (3, 0) <= version <= (3, 1): install_requires += ['argparse'] setup( @@ -49,7 +49,7 @@ description='virtualenv-based automation of test activities', long_description=long_description, url='http://tox.testrun.org/', - version='1.4.3', + version='1.5.0.dev1', license='GPLv2 or later', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel', diff -r f97a5361fe58de5c6c24affcec8abbf50b81b6a0 -r bcab2f65482ff082f5a1f04233ec9d463c9b53fc tests/test_venv.py --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -116,6 +116,7 @@ assert len(l) >= 1 args = l[0].args assert "--distribute" not in map(str, args) + assert "--setuptools" in map(str, args) def test_create_sitepackages(monkeypatch, mocksession, newconfig): config = newconfig([], """ diff -r f97a5361fe58de5c6c24affcec8abbf50b81b6a0 -r bcab2f65482ff082f5a1f04233ec9d463c9b53fc tox/__init__.py --- a/tox/__init__.py +++ b/tox/__init__.py @@ -1,5 +1,5 @@ # -__version__ = '1.4.3' +__version__ = '1.5.0.dev1' class exception: class Error(Exception): diff -r f97a5361fe58de5c6c24affcec8abbf50b81b6a0 -r bcab2f65482ff082f5a1f04233ec9d463c9b53fc tox/_venv.py --- a/tox/_venv.py +++ b/tox/_venv.py @@ -162,8 +162,10 @@ venvscript = path.rstrip("co") #venvscript = py.path.local(tox.__file__).dirpath("virtualenv.py") args = [config_interpreter, venvscript] - if not self._ispython3() and self.envconfig.distribute: - args.append('--distribute') + if self.envconfig.distribute: + args.append("--distribute") + else: + args.append("--setuptools") if self.envconfig.sitepackages: args.append('--system-site-packages') #if sys.platform == "win32": https://bitbucket.org/hpk42/tox/commits/251c2898360a/ Changeset: 251c2898360a User: hpk42 Date: 2013-03-27 10:30:15 Summary: tentative re-licensing of tox to MIT license Affected #: 6 files diff -r bcab2f65482ff082f5a1f04233ec9d463c9b53fc -r 251c2898360aa903bf6126dbcc364063e2a9d6b5 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ 1.5.0.dev ----------------- +- re-license tox to MIT license + - depend on virtualenv-1.9.1 - use either --distribute or --setuptools depending diff -r bcab2f65482ff082f5a1f04233ec9d463c9b53fc -r 251c2898360aa903bf6126dbcc364063e2a9d6b5 CONTRIBUTORS --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1,5 +1,5 @@ -contributions (under the MIT license): +contributions: Marc Abramowitz Sridhar Ratnakumar diff -r bcab2f65482ff082f5a1f04233ec9d463c9b53fc -r 251c2898360aa903bf6126dbcc364063e2a9d6b5 LICENSE --- a/LICENSE +++ b/LICENSE @@ -1,10 +1,20 @@ -The tox package is released under the provisions of the GNU General -Public License (GPL), version 2 or later. -See http://www.fsf.org/licensing/licenses/ for more information. +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. -If you have questions and/or want to use parts of -the code under a different license than the GPL -please contact me. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -holger krekel, May 2011, holger at merlinux eu diff -r bcab2f65482ff082f5a1f04233ec9d463c9b53fc -r 251c2898360aa903bf6126dbcc364063e2a9d6b5 setup.py --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ long_description=long_description, url='http://tox.testrun.org/', version='1.5.0.dev1', - license='GPLv2 or later', + license='http://opensource.org/licenses/MIT', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel', author_email='holger at merlinux.eu', @@ -65,15 +65,15 @@ classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', - 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Operating System :: POSIX', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: MacOS :: MacOS X', - 'Topic :: Software Development :: Testing', - 'Topic :: Software Development :: Libraries', - 'Topic :: Utilities', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3'], + 'License :: OSI Approved :: MIT License', + 'Operating System :: POSIX', + 'Operating System :: Microsoft :: Windows', + 'Operating System :: MacOS :: MacOS X', + 'Topic :: Software Development :: Testing', + 'Topic :: Software Development :: Libraries', + 'Topic :: Utilities', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3'], ) if __name__ == '__main__': diff -r bcab2f65482ff082f5a1f04233ec9d463c9b53fc -r 251c2898360aa903bf6126dbcc364063e2a9d6b5 tests/test_z_cmdline.py --- a/tests/test_z_cmdline.py +++ b/tests/test_z_cmdline.py @@ -276,7 +276,7 @@ name='pkg123', description='pkg123 project', version='0.7', - license='GPLv2 or later', + license='MIT', platforms=['unix', 'win32'], packages=['pkg123',], install_requires=['qweqwe123'], diff -r bcab2f65482ff082f5a1f04233ec9d463c9b53fc -r 251c2898360aa903bf6126dbcc364063e2a9d6b5 tox/_pytestplugin.py --- a/tox/_pytestplugin.py +++ b/tox/_pytestplugin.py @@ -262,7 +262,7 @@ name='%(name)s', description='%(name)s project', version='%(version)s', - license='GPLv2 or later', + license='MIT', platforms=['unix', 'win32'], packages=['%(name)s', ], ) Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Thu Mar 28 02:39:13 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 28 Mar 2013 01:39:13 -0000 Subject: [Pytest-commit] commit/pytest: flub: Attempt to improve detailed failure reporting Message-ID: <20130328013913.12928.21560@bitbucket21.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/10c697d004b0/ Changeset: 10c697d004b0 User: flub Date: 2013-03-28 02:39:01 Summary: Attempt to improve detailed failure reporting * If --verbose is used do not truncate. * Add a special dict comparison instead of diffing pprint output. Affected #: 3 files diff -r 05c01a1dd99d958629c15cc579f273bd738045c3 -r 10c697d004b0543b80a6b74f2ccc001bd04031f9 _pytest/assertion/util.py --- a/_pytest/assertion/util.py +++ b/_pytest/assertion/util.py @@ -83,8 +83,8 @@ basestring = str -def assertrepr_compare(op, left, right): - """return specialised explanations for some operators/operands""" +def assertrepr_compare(config, op, left, right): + """Return specialised explanations for some operators/operands""" width = 80 - 15 - len(op) - 2 # 15 chars indentation, 1 space around op left_repr = py.io.saferepr(left, maxsize=int(width/2)) right_repr = py.io.saferepr(right, maxsize=width-len(left_repr)) @@ -95,21 +95,21 @@ isdict = lambda x: isinstance(x, dict) isset = lambda x: isinstance(x, set) + verbose = config.getoption('verbose') explanation = None try: if op == '==': if istext(left) and istext(right): - explanation = _diff_text(left, right) + explanation = _diff_text(left, right, verbose) elif issequence(left) and issequence(right): - explanation = _compare_eq_sequence(left, right) + explanation = _compare_eq_sequence(left, right, verbose) elif isset(left) and isset(right): - explanation = _compare_eq_set(left, right) + explanation = _compare_eq_set(left, right, verbose) elif isdict(left) and isdict(right): - explanation = _diff_text(py.std.pprint.pformat(left), - py.std.pprint.pformat(right)) + explanation = _compare_eq_dict(left, right, verbose) elif op == 'not in': if istext(left) and istext(right): - explanation = _notin_text(left, right) + explanation = _notin_text(left, right, verbose) except py.builtin._sysex: raise except: @@ -121,44 +121,44 @@ if not explanation: return None - return [summary] + explanation -def _diff_text(left, right): +def _diff_text(left, right, verbose=False): """Return the explanation for the diff between text - This will skip leading and trailing characters which are - identical to keep the diff minimal. + Unless --verbose is used this will skip leading and trailing + characters which are identical to keep the diff minimal. """ explanation = [] - i = 0 # just in case left or right has zero length - for i in range(min(len(left), len(right))): - if left[i] != right[i]: - break - if i > 42: - i -= 10 # Provide some context - explanation = ['Skipping %s identical ' - 'leading characters in diff' % i] - left = left[i:] - right = right[i:] - if len(left) == len(right): - for i in range(len(left)): - if left[-i] != right[-i]: + if not verbose: + i = 0 # just in case left or right has zero length + for i in range(min(len(left), len(right))): + if left[i] != right[i]: break if i > 42: - i -= 10 # Provide some context - explanation += ['Skipping %s identical ' - 'trailing characters in diff' % i] - left = left[:-i] - right = right[:-i] + i -= 10 # Provide some context + explanation = ['Skipping %s identical leading ' + 'characters in diff, use -v to show' % i] + left = left[i:] + right = right[i:] + if len(left) == len(right): + for i in range(len(left)): + if left[-i] != right[-i]: + break + if i > 42: + i -= 10 # Provide some context + explanation += ['Skipping %s identical trailing ' + 'characters in diff, use -v to show' % i] + left = left[:-i] + right = right[:-i] explanation += [line.strip('\n') for line in py.std.difflib.ndiff(left.splitlines(), right.splitlines())] return explanation -def _compare_eq_sequence(left, right): +def _compare_eq_sequence(left, right, verbose=False): explanation = [] for i in range(min(len(left), len(right))): if left[i] != right[i]: @@ -175,7 +175,7 @@ # py.std.pprint.pformat(right)) -def _compare_eq_set(left, right): +def _compare_eq_set(left, right, verbose=False): explanation = [] diff_left = left - right diff_right = right - left @@ -190,12 +190,41 @@ return explanation -def _notin_text(term, text): +def _compare_eq_dict(left, right, verbose=False): + explanation = [] + common = set(left).intersection(set(right)) + same = dict((k, left[k]) for k in common if left[k] == right[k]) + if same and not verbose: + explanation += ['Hiding %s identical items, use -v to show' % + len(same)] + elif same: + explanation += ['Common items:'] + explanation += py.std.pprint.pformat(same).splitlines() + diff = set(k for k in common if left[k] != right[k]) + if diff: + explanation += ['Differing items:'] + for k in diff: + explanation += [py.io.saferepr({k: left[k]}) + ' != ' + + py.io.saferepr({k: right[k]})] + extra_left = set(left) - set(right) + if extra_left: + explanation.append('Left contains more items:') + explanation.extend(py.std.pprint.pformat( + dict((k, left[k]) for k in extra_left)).splitlines()) + extra_right = set(right) - set(left) + if extra_right: + explanation.append('Right contains more items:') + explanation.extend(py.std.pprint.pformat( + dict((k, right[k]) for k in extra_right)).splitlines()) + return explanation + + +def _notin_text(term, text, verbose=False): index = text.find(term) head = text[:index] tail = text[index+len(term):] correct_text = head + tail - diff = _diff_text(correct_text, text) + diff = _diff_text(correct_text, text, verbose) newdiff = ['%s is contained here:' % py.io.saferepr(term, maxsize=42)] for line in diff: if line.startswith('Skipping'): diff -r 05c01a1dd99d958629c15cc579f273bd738045c3 -r 10c697d004b0543b80a6b74f2ccc001bd04031f9 doc/en/example/assertion/failure_demo.py --- a/doc/en/example/assertion/failure_demo.py +++ b/doc/en/example/assertion/failure_demo.py @@ -66,7 +66,7 @@ assert a == b def test_eq_dict(self): - assert {'a': 0, 'b': 1} == {'a': 0, 'b': 2} + assert {'a': 0, 'b': 1, 'c': 0} == {'a': 0, 'b': 2, 'd': 0} def test_eq_set(self): assert set([0, 10, 11, 12]) == set([0, 20, 21]) diff -r 05c01a1dd99d958629c15cc579f273bd738045c3 -r 10c697d004b0543b80a6b74f2ccc001bd04031f9 testing/test_assertion.py --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -6,6 +6,18 @@ needsnewassert = pytest.mark.skipif("sys.version_info < (2,6)") + + at pytest.fixture +def mock_config(): + class Config(object): + verbose = False + def getoption(self, name): + if name == 'verbose': + return self.verbose + raise KeyError('Not mocked out: %s' % name) + return Config() + + def interpret(expr): return reinterpret.reinterpret(expr, py.code.Frame(sys._getframe(1))) @@ -32,8 +44,11 @@ "*test_check*PASS*", ]) -def callequal(left, right): - return plugin.pytest_assertrepr_compare('==', left, right) +def callequal(left, right, verbose=False): + config = mock_config() + config.verbose = verbose + return plugin.pytest_assertrepr_compare(config, '==', left, right) + class TestAssert_reprcompare: def test_different_types(self): @@ -48,6 +63,17 @@ assert '- spam' in diff assert '+ eggs' in diff + def test_text_skipping(self): + lines = callequal('a'*50 + 'spam', 'a'*50 + 'eggs') + assert 'Skipping' in lines[1] + for line in lines: + assert 'a'*50 not in line + + def test_text_skipping_verbose(self): + lines = callequal('a'*50 + 'spam', 'a'*50 + 'eggs', verbose=True) + assert '- ' + 'a'*50 + 'spam' in lines + assert '+ ' + 'a'*50 + 'eggs' in lines + def test_multiline_text_diff(self): left = 'foo\nspam\nbar' right = 'foo\neggs\nbar' @@ -124,8 +150,9 @@ """) assert testdir.runpytest().ret == 0 -def test_reprcompare_notin(): - detail = plugin.pytest_assertrepr_compare('not in', 'foo', 'aaafoobbb')[1:] +def test_reprcompare_notin(mock_config): + detail = plugin.pytest_assertrepr_compare( + mock_config, 'not in', 'foo', 'aaafoobbb')[1:] assert detail == ["'foo' is contained here:", ' aaafoobbb', '? +++'] @needsnewassert 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 Mar 28 10:21:44 2013 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 28 Mar 2013 09:21:44 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: - add release announce Message-ID: <20130328092144.28332.20259@bitbucket22.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/7697ae2f476d/ Changeset: 7697ae2f476d User: hpk42 Date: 2013-03-28 10:21:03 Summary: - add release announce Affected #: 5 files diff -r 10c697d004b0543b80a6b74f2ccc001bd04031f9 -r 7697ae2f476df2bbc3bf65006abb1ff9f11d1664 _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.3.5dev6' +__version__ = '2.3.5.dev8' diff -r 10c697d004b0543b80a6b74f2ccc001bd04031f9 -r 7697ae2f476df2bbc3bf65006abb1ff9f11d1664 doc/en/announce/release-2.3.5.txt --- /dev/null +++ b/doc/en/announce/release-2.3.5.txt @@ -0,0 +1,59 @@ +pytest-2.3.5: bug fixes +=========================================================================== + +pytest-2.3.5 is a bug fix release for the pytest testing tool. +See the changelog below for details. And + + http://pytest.org/ + +for general information. To install or upgrade pytest: + + pip install -U pytest # or + easy_install -U pytest + +best, +holger krekel + + +Changes between 2.3.4 and 2.3.5 +----------------------------------- + +- issue 259 - when assertion rewriting, be consistent with the default + source encoding of ASCII on Python 2 + +- issue 251 - report a skip instead of ignoring classes with init + +- issue250 unicode/str mixes in parametrization names and values now works + +- issue257, assertion-triggered compilation of source ending in a + comment line doesn't blow up in python2.5 (fixed through py>=1.4.13) + +- fix --genscript option to generate standalone scripts that also + work with python3.3 (importer ordering) + +- issue171 - in assertion rewriting, show the repr of some + global variables + +- fix option help for "-k" + +- move long description of distribution into README.rst + +- improve docstring for metafunc.parametrize() + +- fix bug where using capsys with pytest.set_trace() in a test + function would break when looking at capsys.readouterr() + +- allow to specify prefixes starting with "_" when + customizing python_functions test discovery. (thanks Graham Horler) + +- improve PYTEST_DEBUG tracing output by puting + extra data on a new lines with additional indent + +- ensure OutcomeExceptions like skip/fail have initialized exception attributes + +- issue 260 - don't use nose special setup on plain unittest cases + +- fix issue134 - print the collect errors that prevent running specified test items + +- fix issue266 - accept unicode in MarkEvaluator expressions + diff -r 10c697d004b0543b80a6b74f2ccc001bd04031f9 -r 7697ae2f476df2bbc3bf65006abb1ff9f11d1664 setup.py --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.3.5.dev7', + version='2.3.5.dev8', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff -r 10c697d004b0543b80a6b74f2ccc001bd04031f9 -r 7697ae2f476df2bbc3bf65006abb1ff9f11d1664 testing/acceptance_test.py --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -505,6 +505,8 @@ source = """ import time frag = 0.02 + def test_something(): + pass def test_2(): time.sleep(frag*5) def test_1(): diff -r 10c697d004b0543b80a6b74f2ccc001bd04031f9 -r 7697ae2f476df2bbc3bf65006abb1ff9f11d1664 tox.ini --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ distshare={homedir}/.tox/distshare envlist=py25,py26,py27,py27-nobyte,py32,py33,py27-xdist,trial indexserver= - pypi = http://pypi.python.org/simple + pypi = https://pypi.python.org/simple testrun = http://pypi.testrun.org default = http://pypi.testrun.org @@ -39,7 +39,6 @@ [testenv:trial] changedir=. -basepython=python2.6 deps=:pypi:twisted :pypi:pexpect commands= 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 Mar 31 23:13:10 2013 From: issues-reply at bitbucket.org (Gabor Lenard) Date: Sun, 31 Mar 2013 21:13:10 -0000 Subject: [Pytest-commit] [hpk42/pytest] `python_classes` and `python_functions` configuration options are ignored in pytest.ini (issue #284) Message-ID: <20130331211310.8607.36160@bitbucket01.managed.contegix.com> New issue 284: `python_classes` and `python_functions` configuration options are ignored in pytest.ini https://bitbucket.org/hpk42/pytest/issue/284/python_classes-and-python_functions Gabor Lenard: I have a `pytest.ini` file in my project folder with a proper [pytest] section in it: ``` #!python [pytest] python_files=*.py python_classes=Check python_functions=check ``` I have a `example_test.py` file: ``` #!python #!/usr/bin/env python # encoding: utf-8 import unittest class Example(unittest.TestCase): def test_do(self): pass def should_do(self): pass def check_do(self): pass ``` When I enter `py.test` in the command line I expect that none of the methods are invoked (or maybe only `check_do()`). However, this is what I see: ``` #!python py.test ====================== test session starts ======================= platform darwin -- Python 2.7.2 -- pytest-2.3.4 -- /usr/bin/python collected 1 items example_test.py:5: Example.test_do PASSED ==================== 1 passed in 0.02 seconds ==================== ``` The `python_files` seems to be detected correctly: if I change it to `check*.py` then 0 tests are invoked. Renaming the file to `tox.ini` or `setup.cfg` makes no difference. I don't have any other configuration file lying around. I installed pytest today in order to start doing TDD and wanted to start all my test methods with `should_`. -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue.