From commits-noreply at bitbucket.org Sun Jun 1 10:41:14 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 01 Jun 2014 08:41:14 -0000 Subject: [Pytest-commit] commit/tox: limeburst: we now support py34 Message-ID: <20140601084114.8464.62312@app02.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/cf69f64f76de/ Changeset: cf69f64f76de User: limeburst Date: 2014-05-30 08:15:30 Summary: we now support py34 Affected #: 2 files diff -r 8b4012b098d62830708944185a53aaf855915bd1 -r cf69f64f76de4146dec09a12dddac4455d4690c6 doc/config-v2.txt --- a/doc/config-v2.txt +++ b/doc/config-v2.txt @@ -195,7 +195,7 @@ tox comes with predefined settings for certain variants, namely: * ``{easy,pip}`` use easy_install or pip respectively -* ``{py24,py25,py26,py27,py31,py32,py33,pypy19]`` use the respective +* ``{py24,py25,py26,py27,py31,py32,py33,py34,pypy19]`` use the respective pythonNN or PyPy interpreter * ``{win32,linux,darwin}`` defines the according ``platform``. diff -r 8b4012b098d62830708944185a53aaf855915bd1 -r cf69f64f76de4146dec09a12dddac4455d4690c6 doc/example/basic.txt --- a/doc/example/basic.txt +++ b/doc/example/basic.txt @@ -37,6 +37,7 @@ py31 py32 py33 + py34 jython pypy @@ -236,4 +237,4 @@ python setup.py test -a "-epy27" -is equivalent to running ``tox -epy27``. \ No newline at end of file +is equivalent to running ``tox -epy27``. Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Sun Jun 1 10:52:32 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 01 Jun 2014 08:52:32 -0000 Subject: [Pytest-commit] commit/tox: hpk42: Merged in evvers/tox/evvers/add-deps-to-basictxt-example-without-dep-1400352654797 (pull request #108) Message-ID: <20140601085232.15653.73877@app13.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/ecb9ea7c250f/ Changeset: ecb9ea7c250f User: hpk42 Date: 2014-06-01 10:52:29 Summary: Merged in evvers/tox/evvers/add-deps-to-basictxt-example-without-dep-1400352654797 (pull request #108) Add deps to basic.txt example. Affected #: 1 file diff -r cf69f64f76de4146dec09a12dddac4455d4690c6 -r ecb9ea7c250f48456dafde8f98216b699d77133d doc/example/basic.txt --- a/doc/example/basic.txt +++ b/doc/example/basic.txt @@ -12,6 +12,7 @@ [tox] envlist = py26,py27 [testenv] + deps=pytest # or 'nose' or ... commands=py.test # or 'nosetests' or ... To sdist-package, install and test your project, you can Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Sun Jun 1 10:52:32 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 01 Jun 2014 08:52:32 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20140601085232.30894.38742@app04.ash-private.bitbucket.org> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/89688ce8652e/ Changeset: 89688ce8652e Branch: evvers/add-deps-to-basictxt-example-without-dep-1400352654797 User: evvers Date: 2014-05-17 20:50:58 Summary: Add deps to basic.txt example. Without deps command doesn't work. Affected #: 1 file diff -r acb4f0db1d405a772c17217b28d87859fc12084e -r 89688ce8652e3f99607e385d4c0ca9eb8aaf1d41 doc/example/basic.txt --- a/doc/example/basic.txt +++ b/doc/example/basic.txt @@ -1,4 +1,3 @@ - Basic usage ============================================= @@ -13,6 +12,7 @@ [tox] envlist = py26,py27 [testenv] + deps=pytest # or 'nose' or ... commands=py.test # or 'nosetests' or ... To sdist-package, install and test your project, you can https://bitbucket.org/hpk42/tox/commits/ecb9ea7c250f/ Changeset: ecb9ea7c250f User: hpk42 Date: 2014-06-01 10:52:29 Summary: Merged in evvers/tox/evvers/add-deps-to-basictxt-example-without-dep-1400352654797 (pull request #108) Add deps to basic.txt example. Affected #: 1 file diff -r cf69f64f76de4146dec09a12dddac4455d4690c6 -r ecb9ea7c250f48456dafde8f98216b699d77133d doc/example/basic.txt --- a/doc/example/basic.txt +++ b/doc/example/basic.txt @@ -12,6 +12,7 @@ [tox] envlist = py26,py27 [testenv] + deps=pytest # or 'nose' or ... commands=py.test # or 'nosetests' or ... To sdist-package, install and test your project, you can Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Sun Jun 1 12:08:40 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 01 Jun 2014 10:08:40 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: incorporate the new pytest logo Message-ID: <20140601100840.21773.26517@app13.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/1726cd09adc4/ Changeset: 1726cd09adc4 User: hpk42 Date: 2014-06-01 12:01:40 Summary: incorporate the new pytest logo Affected #: 2 files diff -r 76c9e65c1687a58a194ca230871d9b3b28e4421b -r 1726cd09adc4a09a120957131dd2b6c14402b78a doc/en/conf.py --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -131,7 +131,7 @@ # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +html_logo = "img/pytest1.png" # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 diff -r 76c9e65c1687a58a194ca230871d9b3b28e4421b -r 1726cd09adc4a09a120957131dd2b6c14402b78a doc/en/img/pytest1.png Binary file doc/en/img/pytest1.png has changed Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Sun Jun 1 12:36:48 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 01 Jun 2014 10:36:48 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: also add favicon Message-ID: <20140601103648.14642.84174@app15.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/4684e23973c0/ Changeset: 4684e23973c0 User: hpk42 Date: 2014-06-01 12:36:31 Summary: also add favicon Affected #: 2 files diff -r 1726cd09adc4a09a120957131dd2b6c14402b78a -r 4684e23973c00960ef73a57537c54a4ecb8c6c5e doc/en/conf.py --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -136,7 +136,7 @@ # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -#html_favicon = None +html_favicon = "img/pytest1favi.ico" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff -r 1726cd09adc4a09a120957131dd2b6c14402b78a -r 4684e23973c00960ef73a57537c54a4ecb8c6c5e doc/en/img/pytest1favi.ico Binary file doc/en/img/pytest1favi.ico has changed Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Mon Jun 2 11:36:58 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 02 Jun 2014 09:36:58 -0000 Subject: [Pytest-commit] commit/py: 2 new changesets Message-ID: <20140602093658.11603.1150@app15.ash-private.bitbucket.org> 2 new commits in py: https://bitbucket.org/hpk42/py/commits/13e8b433f53c/ Changeset: 13e8b433f53c Branch: schlamar/dont-skip-exit-handlers-in-forkedfunc-t-1401701628841 User: schlamar Date: 2014-06-02 11:34:08 Summary: Don't skip exit handlers in ForkedFunc. This is achieved by using sys.exit instead of os._exit in the child process. Additionally, it fixes a race condition where the temporary directory could have been cleaned up in the child before the parent has read its content. Affected #: 1 file diff -r f7c2b8011d273c2f69872b662c6b5765356827a5 -r 13e8b433f53cd689743557c3d3513683a89d3944 py/_process/forkedfunc.py --- a/py/_process/forkedfunc.py +++ b/py/_process/forkedfunc.py @@ -3,8 +3,6 @@ ForkedFunc provides a way to run a function in a forked process and get at its return value, stdout and stderr output as well as signals and exitstatusus. - - XXX see if tempdir handling is sane """ import py @@ -12,8 +10,10 @@ import sys import marshal + class ForkedFunc(object): EXITSTATUS_EXCEPTION = 3 + def __init__(self, fun, args=None, kwargs=None, nice_level=0): if args is None: args = [] @@ -28,9 +28,10 @@ self.STDERR = tempdir.ensure('stderr') pid = os.fork() - if pid: # in parent process + if pid: # in parent process self.pid = pid - else: # in child process + else: # in child process + self.pid = None self._child(nice_level) def _child(self, nice_level): @@ -62,7 +63,7 @@ retvalf.close() os.close(1) os.close(2) - os._exit(EXITSTATUS) + sys.exit(EXITSTATUS) def waitfinish(self, waiter=os.waitpid): pid, systemstatus = waiter(self.pid, 0) @@ -71,8 +72,6 @@ exitstatus = os.WTERMSIG(systemstatus) + 128 else: exitstatus = os.WEXITSTATUS(systemstatus) - #raise ExecutionFailed(status, systemstatus, cmd, - # ''.join(out), ''.join(err)) else: exitstatus = 0 signal = systemstatus & 0x7f @@ -95,7 +94,9 @@ self.tempdir.remove() def __del__(self): - self._removetemp() + if self.pid is not None: # only clean up in main process + self._removetemp() + class Result(object): def __init__(self, exitstatus, signal, retval, stdout, stderr): https://bitbucket.org/hpk42/py/commits/5d8aaac89ffc/ Changeset: 5d8aaac89ffc User: hpk42 Date: 2014-06-02 11:36:55 Summary: Merged in schlamar/py/schlamar/dont-skip-exit-handlers-in-forkedfunc-t-1401701628841 (pull request #14) Don't skip exit handlers in ForkedFunc. Affected #: 1 file diff -r f7c2b8011d273c2f69872b662c6b5765356827a5 -r 5d8aaac89ffc8d5077e612b8d067332c18753b2c py/_process/forkedfunc.py --- a/py/_process/forkedfunc.py +++ b/py/_process/forkedfunc.py @@ -3,8 +3,6 @@ ForkedFunc provides a way to run a function in a forked process and get at its return value, stdout and stderr output as well as signals and exitstatusus. - - XXX see if tempdir handling is sane """ import py @@ -12,8 +10,10 @@ import sys import marshal + class ForkedFunc(object): EXITSTATUS_EXCEPTION = 3 + def __init__(self, fun, args=None, kwargs=None, nice_level=0): if args is None: args = [] @@ -28,9 +28,10 @@ self.STDERR = tempdir.ensure('stderr') pid = os.fork() - if pid: # in parent process + if pid: # in parent process self.pid = pid - else: # in child process + else: # in child process + self.pid = None self._child(nice_level) def _child(self, nice_level): @@ -62,7 +63,7 @@ retvalf.close() os.close(1) os.close(2) - os._exit(EXITSTATUS) + sys.exit(EXITSTATUS) def waitfinish(self, waiter=os.waitpid): pid, systemstatus = waiter(self.pid, 0) @@ -71,8 +72,6 @@ exitstatus = os.WTERMSIG(systemstatus) + 128 else: exitstatus = os.WEXITSTATUS(systemstatus) - #raise ExecutionFailed(status, systemstatus, cmd, - # ''.join(out), ''.join(err)) else: exitstatus = 0 signal = systemstatus & 0x7f @@ -95,7 +94,9 @@ self.tempdir.remove() def __del__(self): - self._removetemp() + if self.pid is not None: # only clean up in main process + self._removetemp() + class Result(object): def __init__(self, exitstatus, signal, retval, stdout, stderr): 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 Jun 2 11:37:27 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 02 Jun 2014 09:37:27 -0000 Subject: [Pytest-commit] commit/py: hpk42: Merged in schlamar/py/schlamar/dont-skip-exit-handlers-in-forkedfunc-t-1401701628841 (pull request #14) Message-ID: <20140602093727.4679.10179@app07.ash-private.bitbucket.org> 1 new commit in py: https://bitbucket.org/hpk42/py/commits/5d8aaac89ffc/ Changeset: 5d8aaac89ffc User: hpk42 Date: 2014-06-02 11:36:55 Summary: Merged in schlamar/py/schlamar/dont-skip-exit-handlers-in-forkedfunc-t-1401701628841 (pull request #14) Don't skip exit handlers in ForkedFunc. Affected #: 1 file diff -r f7c2b8011d273c2f69872b662c6b5765356827a5 -r 5d8aaac89ffc8d5077e612b8d067332c18753b2c py/_process/forkedfunc.py --- a/py/_process/forkedfunc.py +++ b/py/_process/forkedfunc.py @@ -3,8 +3,6 @@ ForkedFunc provides a way to run a function in a forked process and get at its return value, stdout and stderr output as well as signals and exitstatusus. - - XXX see if tempdir handling is sane """ import py @@ -12,8 +10,10 @@ import sys import marshal + class ForkedFunc(object): EXITSTATUS_EXCEPTION = 3 + def __init__(self, fun, args=None, kwargs=None, nice_level=0): if args is None: args = [] @@ -28,9 +28,10 @@ self.STDERR = tempdir.ensure('stderr') pid = os.fork() - if pid: # in parent process + if pid: # in parent process self.pid = pid - else: # in child process + else: # in child process + self.pid = None self._child(nice_level) def _child(self, nice_level): @@ -62,7 +63,7 @@ retvalf.close() os.close(1) os.close(2) - os._exit(EXITSTATUS) + sys.exit(EXITSTATUS) def waitfinish(self, waiter=os.waitpid): pid, systemstatus = waiter(self.pid, 0) @@ -71,8 +72,6 @@ exitstatus = os.WTERMSIG(systemstatus) + 128 else: exitstatus = os.WEXITSTATUS(systemstatus) - #raise ExecutionFailed(status, systemstatus, cmd, - # ''.join(out), ''.join(err)) else: exitstatus = 0 signal = systemstatus & 0x7f @@ -95,7 +94,9 @@ self.tempdir.remove() def __del__(self): - self._removetemp() + if self.pid is not None: # only clean up in main process + self._removetemp() + class Result(object): def __init__(self, exitstatus, signal, retval, stdout, stderr): 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 Jun 2 11:57:19 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 02 Jun 2014 09:57:19 -0000 Subject: [Pytest-commit] commit/py: hpk42: backout change from @schlamar because it breaks the tests Message-ID: <20140602095719.27307.56870@app06.ash-private.bitbucket.org> 1 new commit in py: https://bitbucket.org/hpk42/py/commits/dda77653de9d/ Changeset: dda77653de9d User: hpk42 Date: 2014-06-02 11:57:12 Summary: backout change from @schlamar because it breaks the tests and this should not be the case on default. Affected #: 1 file diff -r 5d8aaac89ffc8d5077e612b8d067332c18753b2c -r dda77653de9d9aa84bfb9ca0e1a59498863563d1 py/_process/forkedfunc.py --- a/py/_process/forkedfunc.py +++ b/py/_process/forkedfunc.py @@ -63,7 +63,7 @@ retvalf.close() os.close(1) os.close(2) - sys.exit(EXITSTATUS) + os._exit(EXITSTATUS) def waitfinish(self, waiter=os.waitpid): pid, systemstatus = waiter(self.pid, 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 Mon Jun 2 15:23:42 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 02 Jun 2014 13:23:42 -0000 Subject: [Pytest-commit] commit/tox: hpk42: backout change b0afb96 from @schlamar Message-ID: <20140602132342.18817.15005@app08.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/7ca156d4acfd/ Changeset: 7ca156d4acfd User: hpk42 Date: 2014-06-02 15:23:35 Summary: backout change b0afb96 from @schlamar Affected #: 1 file diff -r ecb9ea7c250f48456dafde8f98216b699d77133d -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -201,7 +201,7 @@ def make_hashseed(): max_seed = 4294967295 - if sys.platform == 'win32' and sys.version_info < (3, 4): + if sys.platform == 'win32': max_seed = 1024 return str(random.randint(1, max_seed)) 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 Jun 3 07:21:10 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 03 Jun 2014 05:21:10 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: fix typo, thanks @dcramer Message-ID: <20140603052110.13778.50381@app10.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/846781b9ebcd/ Changeset: 846781b9ebcd User: hpk42 Date: 2014-06-03 07:21:02 Summary: fix typo, thanks @dcramer Affected #: 1 file diff -r 4684e23973c00960ef73a57537c54a4ecb8c6c5e -r 846781b9ebcddf074c5340115c26d74a75594e92 _pytest/hookspec.py --- a/_pytest/hookspec.py +++ b/_pytest/hookspec.py @@ -152,7 +152,7 @@ :arg item: test item for which the runtest protocol is performed. - :arg nexitem: the scheduled-to-be-next test item (or None if this + :arg nextitem: the scheduled-to-be-next test item (or None if this is the end my friend). This argument is passed on to :py:func:`pytest_runtest_teardown`. 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 Jun 3 09:49:07 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 03 Jun 2014 07:49:07 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Merged in zyegfryed/pytest/zyegfryed/fixed-typo-noticed-by-dcramer-httpstwitt-1401780587159 (pull request #172) Message-ID: <20140603074907.5726.6314@app07.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/177f44412427/ Changeset: 177f44412427 User: hpk42 Date: 2014-06-03 09:49:02 Summary: Merged in zyegfryed/pytest/zyegfryed/fixed-typo-noticed-by-dcramer-httpstwitt-1401780587159 (pull request #172) Fixed typo noticed by @zeeg (https://twitter.com/zeeg/status/473676721128886272) Affected #: 1 file diff -r 846781b9ebcddf074c5340115c26d74a75594e92 -r 177f44412427b5060724fafe0263b35bddd91183 _pytest/hookspec.py --- a/_pytest/hookspec.py +++ b/_pytest/hookspec.py @@ -153,8 +153,8 @@ :arg item: test item for which the runtest protocol is performed. :arg nextitem: the scheduled-to-be-next test item (or None if this - is the end my friend). This argument is passed on to - :py:func:`pytest_runtest_teardown`. + is the end my friend). This argument is passed on to + :py:func:`pytest_runtest_teardown`. :return boolean: True if no further hook implementations should be invoked. """ @@ -172,10 +172,10 @@ def pytest_runtest_teardown(item, nextitem): """ called after ``pytest_runtest_call``. - :arg nexitem: the scheduled-to-be-next test item (None if no further - test item is scheduled). This argument can be used to - perform exact teardowns, i.e. calling just enough finalizers - so that nextitem only needs to call setup-functions. + :arg nextitem: the scheduled-to-be-next test item (None if no further + test item is scheduled). This argument can be used to + perform exact teardowns, i.e. calling just enough finalizers + so that nextitem only needs to call setup-functions. """ def pytest_runtest_makereport(item, call): Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Tue Jun 3 09:49:07 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 03 Jun 2014 07:49:07 -0000 Subject: [Pytest-commit] commit/pytest: 2 new changesets Message-ID: <20140603074907.10132.84675@app03.ash-private.bitbucket.org> 2 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/a33c12accb81/ Changeset: a33c12accb81 Branch: zyegfryed/fixed-typo-noticed-by-dcramer-httpstwitt-1401780587159 User: zyegfryed Date: 2014-06-03 09:30:14 Summary: Fixed typo noticed by @dcramer (https://twitter.com/zeeg/status/473676721128886272) Affected #: 1 file diff -r 846781b9ebcddf074c5340115c26d74a75594e92 -r a33c12accb81251448ffd9fa23d55bcea9d80486 _pytest/hookspec.py --- a/_pytest/hookspec.py +++ b/_pytest/hookspec.py @@ -153,8 +153,8 @@ :arg item: test item for which the runtest protocol is performed. :arg nextitem: the scheduled-to-be-next test item (or None if this - is the end my friend). This argument is passed on to - :py:func:`pytest_runtest_teardown`. + is the end my friend). This argument is passed on to + :py:func:`pytest_runtest_teardown`. :return boolean: True if no further hook implementations should be invoked. """ @@ -172,10 +172,10 @@ def pytest_runtest_teardown(item, nextitem): """ called after ``pytest_runtest_call``. - :arg nexitem: the scheduled-to-be-next test item (None if no further - test item is scheduled). This argument can be used to - perform exact teardowns, i.e. calling just enough finalizers - so that nextitem only needs to call setup-functions. + :arg nextitem: the scheduled-to-be-next test item (None if no further + test item is scheduled). This argument can be used to + perform exact teardowns, i.e. calling just enough finalizers + so that nextitem only needs to call setup-functions. """ def pytest_runtest_makereport(item, call): https://bitbucket.org/hpk42/pytest/commits/177f44412427/ Changeset: 177f44412427 User: hpk42 Date: 2014-06-03 09:49:02 Summary: Merged in zyegfryed/pytest/zyegfryed/fixed-typo-noticed-by-dcramer-httpstwitt-1401780587159 (pull request #172) Fixed typo noticed by @zeeg (https://twitter.com/zeeg/status/473676721128886272) Affected #: 1 file diff -r 846781b9ebcddf074c5340115c26d74a75594e92 -r 177f44412427b5060724fafe0263b35bddd91183 _pytest/hookspec.py --- a/_pytest/hookspec.py +++ b/_pytest/hookspec.py @@ -153,8 +153,8 @@ :arg item: test item for which the runtest protocol is performed. :arg nextitem: the scheduled-to-be-next test item (or None if this - is the end my friend). This argument is passed on to - :py:func:`pytest_runtest_teardown`. + is the end my friend). This argument is passed on to + :py:func:`pytest_runtest_teardown`. :return boolean: True if no further hook implementations should be invoked. """ @@ -172,10 +172,10 @@ def pytest_runtest_teardown(item, nextitem): """ called after ``pytest_runtest_call``. - :arg nexitem: the scheduled-to-be-next test item (None if no further - test item is scheduled). This argument can be used to - perform exact teardowns, i.e. calling just enough finalizers - so that nextitem only needs to call setup-functions. + :arg nextitem: the scheduled-to-be-next test item (None if no further + test item is scheduled). This argument can be used to + perform exact teardowns, i.e. calling just enough finalizers + so that nextitem only needs to call setup-functions. """ def pytest_runtest_makereport(item, call): Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From issues-reply at bitbucket.org Wed Jun 4 10:00:35 2014 From: issues-reply at bitbucket.org (=?utf-8?q?Thomas_G=C3=BCttler?=) Date: Wed, 04 Jun 2014 08:00:35 -0000 Subject: [Pytest-commit] Issue #522: Highlight my code vs framework code in tracebacks (hpk42/pytest) Message-ID: <20140604080035.2267.20271@app15.ash-private.bitbucket.org> New issue 522: Highlight my code vs framework code in tracebacks https://bitbucket.org/hpk42/pytest/issue/522/highlight-my-code-vs-framework-code-in Thomas G?ttler: it would be very cool if pytest could highlight my code in tracebacks. This would make it much easier for the developers eyes to find the buggy code line. In 98% percent of all tracebacks I get, the bug is in my code, not in one of the many external libraries. Of course it needs some kind of heuristic to decide if a traceback line is from my code or from a library/framework. Some time ago this was implemented in django, and I liked it very much: You find the important code lines much faster. Since we changed your development style to test driven development, we don't see django tracebacks any more. We use pytest now. See https://code.djangoproject.com/ticket/11834 This is a feature request. My pytest knowledge is not very good. I think someone else would be much faster. Which steps should be done to implement this? From issues-reply at bitbucket.org Thu Jun 5 04:38:58 2014 From: issues-reply at bitbucket.org (James Mills) Date: Thu, 05 Jun 2014 02:38:58 -0000 Subject: [Pytest-commit] Issue #523: ValueError: duplicate arg (hpk42/pytest) Message-ID: <20140605023858.4873.85536@app12.ash-private.bitbucket.org> New issue 523: ValueError: duplicate arg https://bitbucket.org/hpk42/pytest/issue/523/valueerror-duplicate-arg James Mills: **test_foo.py**: ``` #!python def pytest_generate_tests(metafunc): for level in ("level_{0:d}".format(level) for level in [1, 2, 3]): argvalues = [ ["1", "2"], ["1", "2"], ] ids = [ "{0:s}_test1".format(level), "{0:s}_test2".format(level), ] metafunc.parametrize(["a", "b"], argvalues, ids=ids) def test(a, b): assert a < b ``` **Output:** ``` #!bash $ py.test -x -s -v tests/test_foo.py ============================= test session starts ============================== platform darwin -- Python 2.7.6 -- py-1.4.20 -- pytest-2.6.0.dev1 -- /Users/s2092651/.virtualenvs/jsonselect/bin/python plugins: cov collected 0 items / 1 errors ==================================== ERRORS ==================================== ______________________ ERROR collecting tests/test_foo.py ______________________ tests/test_foo.py:13: in pytest_generate_tests > metafunc.parametrize(["a", "b"], argvalues, ids=ids) ../../.virtualenvs/jsonselect/lib/python2.7/site-packages/_pytest/python.py:828: in parametrize > param_index) ../../.virtualenvs/jsonselect/lib/python2.7/site-packages/_pytest/python.py:709: in setmulti > self._checkargnotcontained(arg) ../../.virtualenvs/jsonselect/lib/python2.7/site-packages/_pytest/python.py:692: in _checkargnotcontained > raise ValueError("duplicate %r" %(arg,)) E ValueError: duplicate 'a' =========================== 1 error in 0.03 seconds ============================ ``` From issues-reply at bitbucket.org Thu Jun 5 16:37:03 2014 From: issues-reply at bitbucket.org (Michael Howitz) Date: Thu, 05 Jun 2014 14:37:03 -0000 Subject: [Pytest-commit] Issue #524: xdist: --looponfail does not respect --tx (hpk42/pytest) Message-ID: <20140605143703.24697.50648@app05.ash-private.bitbucket.org> New issue 524: xdist: --looponfail does not respect --tx https://bitbucket.org/hpk42/pytest/issue/524/xdist-looponfail-does-not-respect-tx Michael Howitz: When specifying --looponfail and --tx the latter gets ignored. I was trying to get --looponfail running for a buildout based project. With the help of #289 I'm able to run test processes in parallel using --tx='2*popen//python=bin/py' --dist=load. But running with --looponfail I get "ImportError: No module named py" and the same like running without --tx. From issues-reply at bitbucket.org Thu Jun 5 19:55:32 2014 From: issues-reply at bitbucket.org (Mikhail Korobov) Date: Thu, 05 Jun 2014 17:55:32 -0000 Subject: [Pytest-commit] Issue #176: tox doesn't install the package being tested (hpk42/tox) Message-ID: <20140605175532.20659.4842@app18.ash-private.bitbucket.org> New issue 176: tox doesn't install the package being tested https://bitbucket.org/hpk42/tox/issue/176/tox-doesnt-install-the-package-being Mikhail Korobov: Hi, Tox doesn't install the package being tested for me, seemingly because it thinks it is already installed. The workaround is to add `python setup.py install` to commands, but this is suboptimal (dependencies can be processed twice, wheels are not installed, and this is not how tox used to work). I'm using tox 1.7.1, virtualenv 1.11.6, pip 1.5.6 and setuptools 4.0.1. The OS is Mac OS X 10.9.3; the issue is reproducable with both Python 2.7.5 and python 3.4.1 virtualenvs (Pythons are installed using homebrew). I tried to downgrade to virtualenv 1.11.2 and run tox -r -e py27, but it didn't help. Downgrading to tox 1.6.1 also didn't help. After running tox own tests, `.tox/py27/log/py27-2.log` looks suspicious: ``` actionid=py27 msg=installpkg cmdargs=[local('/Users/kmike/svn/tox/.tox/py27/bin/pip'), 'install', '--pre', '/Users/kmike/svn/tox/.tox/dist/tox-1.7.2.dev1.zip'] env={'PYTHONIOENCODING': 'utf_8', 'PROJECT_HOME': '/Users/kmike/dev', 'VCPROMPT_FORMAT': '[%b%m%u]', 'TERM_PROGRAM_VERSION': '326', 'TMPDIR': '/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/', 'LOGNAME': 'kmike', 'USER': 'kmike', 'HOME': '/Users/kmike', 'PATH': '/Users/kmike/svn/tox/.tox/py27/bin:/Users/kmike/envs/scraping/bin:/Users/kmike/.pythonbrew/bin:/Users/kmike/.pythonbrew/bin:/usr/local/bin:/usr/local/share/python:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin', 'PS1': '(scraping)\\[$grey\\]\\u \\[$reset\\]\\w \\[$green\\]$(vcprompt)\\[$reset\\]> ', 'DISPLAY': '/tmp/launch-AUcqwK/org.macosforge.xquartz:0', 'TERM_PROGRAM': 'Apple_Terminal', 'LANG': 'en_US.UTF-8', 'TERM': 'xterm-256color', 'SHELL': '/bin/bash', 'SHLVL': '1', 'SECURITYSESSIONID': '186a4', 'TEAMLOCAL_DEBUG': '1', 'SHIFTGIG_DEBUG': '1', 'PYTHONHASHSEED': '4220916990', 'EDITOR': 'nano', 'PYTHONPATH': '', 'WORKON_HOME': '/Users/kmike/envs', 'TERM_SESSION_ID': '19E5 3C2B-013A-429B-8867-A9E0A35EE1E7', 'CC': 'clang', 'FFLAGS': '-ff2c', 'SSH_AUTH_SOCK': '/tmp/launch-Jsdoay/Listeners', 'FAB_COMPLETION_CACHE_TASKS': 'true', 'Apple_PubSub_Socket_Render': '/tmp/launch-r2J2kt/Render', '_': '/Users/kmike/envs/scraping/bin/tox', 'VIRTUALENVWRAPPER_PROJECT_FILENAME': '.project', 'VIRTUAL_ENV': '/Users/kmike/envs/scraping', 'VIRTUALENVWRAPPER_HOOK_DIR': '/Users/kmike/envs', 'CXX': 'clang++', 'OLDPWD': '/Users/kmike/svn', 'FAB_COMPLETION_CACHED_TASKS_FILENAME': '.fab_tasks~', '__CF_USER_TEXT_ENCODING': '0x1F7:0:0', 'PWD': '/Users/kmike/svn/tox', 'PIP_DOWNLOAD_CACHE': '/Users/kmike/.pip/download', '__CHECKFIX1436934': '1'} Unpacking ./.tox/dist/tox-1.7.2.dev1.zip Running setup.py (path:/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pip-RHLGrc-build/setup.py) egg_info for package from file:///Users/kmike/svn/tox/.tox/dist/tox-1.7.2.dev1.zip Requirement already satisfied (use --upgrade to upgrade): tox==1.7.2.dev1 from file:///Users/kmike/svn/tox/.tox/dist/tox-1.7.2.dev1.zip in /Users/kmike/svn/tox Downloading/unpacking virtualenv>=1.11.2 (from tox==1.7.2.dev1) Using download cache from /Users/kmike/.pip/download/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fpy2.py3%2Fv%2Fvirtualenv%2Fvirtualenv-1.11.6-py2.py3-none-any.whl Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./.tox/py27/lib/python2.7/site-packages (from tox==1.7.2.dev1) Installing collected packages: virtualenv Successfully installed virtualenv Cleaning up... ``` and the tests fail: ``` > tox -e py27 GLOB sdist-make: /Users/kmike/svn/tox/setup.py py27 recreate: /Users/kmike/svn/tox/.tox/py27 py27 installdeps: pytest>=2.3.5 py27 inst: /Users/kmike/svn/tox/.tox/dist/tox-1.7.2.dev1.zip py27 runtests: PYTHONHASHSEED='4220916990' py27 runtests: commands[0] | py.test --junitxml=/Users/kmike/svn/tox/.tox/py27/log/junit-py27.xml ===================================================================================================================== test session starts ===================================================================================================================== platform darwin -- Python 2.7.5 -- py-1.4.20 -- pytest-2.5.2 tox comes from: '/Users/kmike/svn/tox/tox/__init__.pyc' collected 208 items tests/test_config.py .........................................................................................F................s tests/test_interpreters.py s........ tests/test_quickstart.py ............. tests/test_result.py ... tests/test_venv.py .................s.................... tests/test_z_cmdline.py .........F..F..........F.............. ========================================================================================================================== FAILURES =========================================================================================================================== _______________________________________________________________________________________________________________ TestCmdInvocation.test_version ________________________________________________________________________________________________________________ self = , cmd = def test_version(self, cmd): result = cmd.run("tox", "--version") assert not result.ret stdout = result.stdout.str() > assert tox.__version__ in stdout E assert '1.7.2.dev1' in '1.7.1 imported from /Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/__init__.pyc' E + where '1.7.2.dev1' = tox.__version__ /Users/kmike/svn/tox/tests/test_config.py:1159: AssertionError ----------------------------------------------------------------------------------------------------------------------- Captured stdout ----------------------------------------------------------------------------------------------------------------------- /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_defaults_changed_dir0/abc$ tox --version 1.7.1 imported from /Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/__init__.pyc ____________________________________________________________________________________________________________ test_run_custom_install_command_error ____________________________________________________________________________________________________________ cmd = , initproj = def test_run_custom_install_command_error(cmd, initproj): initproj("interp123-0.5", filedefs={ 'tox.ini': ''' [testenv] install_command=./tox.ini {opts} {packages} ''' }) result = cmd.run("tox") result.stdout.fnmatch_lines([ > "ERROR: invocation failed, args: ['*/tox.ini*", ]) E assert "ERROR: invoc... ['*/tox.ini*" == 'python inst: ...rp123-0.5.zip' E - ERROR: invocation failed, args: ['*/tox.ini* E + python inst: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_run_custom_install_comman1/interp123/.tox/dist/interp123-0.5.zip /Users/kmike/svn/tox/tests/test_z_cmdline.py:203: AssertionError ----------------------------------------------------------------------------------------------------------------------- Captured stdout ----------------------------------------------------------------------------------------------------------------------- created project in /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_run_custom_install_comman1/interp123 /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_run_custom_install_comman1/interp123$ tox GLOB sdist-make: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_run_custom_install_comman1/interp123/setup.py python create: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_run_custom_install_comman1/interp123/.tox/python python inst: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_run_custom_install_comman1/interp123/.tox/dist/interp123-0.5.zip nomatch: "ERROR: invocation failed, args: ['*/tox.ini*" and: u'GLOB sdist-make: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_run_custom_install_comman1/interp123/setup.py' and: u'python create: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_run_custom_install_comman1/interp123/.tox/python' and: u'python inst: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_run_custom_install_comman1/interp123/.tox/dist/interp123-0.5.zip' ----------------------------------------------------------------------------------------------------------------------- Captured stderr ----------------------------------------------------------------------------------------------------------------------- Traceback (most recent call last): File "/Users/kmike/envs/scraping/bin/tox", line 9, in load_entry_point('tox==1.7.1', 'console_scripts', 'tox')() File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/_cmdline.py", line 26, in main retcode = Session(config).runcommand() File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/_cmdline.py", line 303, in runcommand return self.subcommand_test() File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/_cmdline.py", line 446, in subcommand_test self.installpkg(venv, sdist_path) File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/_cmdline.py", line 394, in installpkg venv.installpkg(sdist_path, action) File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/_venv.py", line 245, in installpkg self._install([sdistpath], extraopts=extraopts, action=action) File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/_venv.py", line 318, in _install action=action, extraenv=extraenv) File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/_venv.py", line 285, in run_install_command extraenv=env, action=action) File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/_venv.py", line 367, in _pcall return action.popen(args, cwd=cwd, env=env, redirect=redirect) File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/_cmdline.py", line 97, in popen stdout=f, stderr=STDOUT) File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tox/_cmdline.py", line 155, in _popen stdout=stdout, stderr=stderr, env=env) File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__ errread, errwrite) File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child raise child_exception OSError: [Errno 13] Permission denied ________________________________________________________________________________________________________________ test_skip_unknown_interpreter ________________________________________________________________________________________________________________ cmd = , initproj = def test_skip_unknown_interpreter(cmd, initproj): initproj("interp123-0.5", filedefs={ 'tests': {'test_hello.py': "def test_hello(): pass"}, 'tox.ini': ''' [testenv:python] basepython=xyz_unknown_interpreter [testenv] changedir=tests ''' }) result = cmd.run("tox", "--skip-missing-interpreters") > assert not result.ret E assert not 2 E + where 2 = .ret /Users/kmike/svn/tox/tests/test_z_cmdline.py:256: AssertionError ----------------------------------------------------------------------------------------------------------------------- Captured stdout ----------------------------------------------------------------------------------------------------------------------- created project in /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_skip_unknown_interpreter0/interp123 /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_skip_unknown_interpreter0/interp123$ tox --skip-missing-interpreters ----------------------------------------------------------------------------------------------------------------------- Captured stderr ----------------------------------------------------------------------------------------------------------------------- usage: tox [-h] [--version] [-v] [--showconfig] [-l] [-c CONFIGFILE] [-e envlist] [--notest] [--sdistonly] [--installpkg PATH] [--develop] [--set-home] [-i URL] [-r] [--result-json PATH] [--hashseed SEED] [--force-dep REQ] [--sitepackages] [args [args ...]] tox: error: unrecognized arguments: --skip-missing-interpreters ____________________________________________________________________________________________________________________ TestToxRun.test_json _____________________________________________________________________________________________________________________ self = , cmd = , example123 = None def test_json(self, cmd, example123): # see that tests can also fail and retcode is correct testfile = py.path.local("tests").join("test_hello.py") assert testfile.check() testfile.write("def test_fail(): assert 0") jsonpath = cmd.tmpdir.join("res.json") result = cmd.run("tox", "--result-json", jsonpath) assert result.ret == 1 data = json.load(jsonpath.open("r")) > verify_json_report_format(data) /Users/kmike/svn/tox/tests/test_z_cmdline.py:445: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = {'host': 'imac.local', 'installpkg': {'basename': 'example123-0.5.zip', 'md5': 'b9c178528f5fd913a0a71b8cac044fbc', 'sh...: 'a48f1c0019c59af0e15abc28ce267a071f1cc1b5b2b28ec420724fe1370c38e3'}, 'platform': 'darwin', 'reportversion': '1', ...} testenvs = True def verify_json_report_format(data, testenvs=True): assert data["reportversion"] == "1" > assert data["toxversion"] == tox.__version__ E assert '1.7.1' == '1.7.2.dev1' E - 1.7.1 E + 1.7.2.dev1 /Users/kmike/svn/tox/tests/test_z_cmdline.py:672: AssertionError ----------------------------------------------------------------------------------------------------------------------- Captured stdout ----------------------------------------------------------------------------------------------------------------------- created project in /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123 /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123$ tox --result-json /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/res.json GLOB sdist-make: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/setup.py python create: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/.tox/python python installdeps: pytest python inst: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/.tox/dist/example123-0.5.zip python runtests: PYTHONHASHSEED='322203576' python runtests: commands[0] | py.test --basetemp=/private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/.tox/python/tmp --junitxml=junit-python.xml ERROR: invocation failed, logfile: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/.tox/python/log/python-3.log ERROR: actionid=python msg=runtests cmdargs=[local('/private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/.tox/python/bin/py.test'), '--basetemp=/private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/.tox/python/tmp', '--junitxml=junit-python.xml'] env={'DISPLAY': '/tmp/launch-AUcqwK/org.macosforge.xquartz:0', 'SHLVL': '1', 'TEAMLOCAL_DEBUG': '1', 'CC': 'clang', 'TERM_PROGRAM_VERSION': '326', 'PS1': '(scraping)\\[$grey\\]\\u \\[$reset\\]\\w \\[$green\\]$(vcprompt)\\[$reset\\]> ', 'VIRTUALENVWRAPPER_HOOK_DIR': '/Users/kmike/envs', '__CF_USER_TEXT_ENCODING': '0x1F7:0:0', 'CXX': 'clang++', 'LOGNAME': 'kmike', 'PYTHONHASHSEED': '322203576', 'TERM': 'xterm-256color', 'EDITOR': 'nano', 'TMPDIR': '/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/', 'VIRTUALENVWRAPPER_PROJECT_FILENAME': '.project', 'VIRTUAL_ENV': '/Users/kmike/envs/scraping', 'HOME': '/Users/kmike', 'PYTHONPATH': '/private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123', 'FFLAGS': '-ff2c', 'TERM_PROGRAM': 'Apple_Terminal', 'SECURITYSESSIONID': '186a4', 'LANG': 'en_US.UTF-8', '__CHECKFIX1436934': '1', 'OLDPWD': '/Users/kmike/svn', 'Apple_PubSub_Socket_Render': '/tmp/launch-r2J2kt/Render', 'PIP_DOWNLOAD_CACHE': '/Users/kmike/.pip /download', 'FAB_COMPLETION_CACHED_TASKS_FILENAME': '.fab_tasks~', 'PATH': '/private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/.tox/python/bin:/Users/kmike/svn/tox/.tox/py27/bin:/Users/kmike/envs/scraping/bin:/Users/kmike/.pythonbrew/bin:/Users/kmike/.pythonbrew/bin:/usr/local/bin:/usr/local/share/python:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin', 'FAB_COMPLETION_CACHE_TASKS': 'true', 'PROJECT_HOME': '/Users/kmike/dev', 'PWD': '/Users/kmike/svn/tox', 'SHELL': '/bin/bash', 'USER': 'kmike', 'TERM_SESSION_ID': '19E53C2B-013A-429B-8867-A9E0A35EE1E7', 'WORKON_HOME': '/Users/kmike/envs', 'VCPROMPT_FORMAT': '[%b%m%u]', 'SHIFTGIG_DEBUG': '1', '_': '/Users/kmike/envs/scraping/bin/tox', 'SSH_AUTH_SOCK': '/tmp/launch-Jsdoay/Listeners'} ============================= test session starts ============================== platform darwin -- Python 2.7.5 -- py-1.4.20 -- pytest-2.5.2 collected 1 items test_hello.py F =================================== FAILURES =================================== __________________________________ test_fail ___________________________________ > def test_fail(): assert 0 E assert 0 test_hello.py:1: AssertionError generated xml file: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/tests/junit-python.xml =========================== 1 failed in 0.02 seconds =========================== ERROR: InvocationError: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/.tox/python/bin/py.test --basetemp=/private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/.tox/python/tmp --junitxml=junit-python.xml (see /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/example123/.tox/python/log/python-3.log) ___________________________________ summary ____________________________________ ERROR: python: commands failed wrote json report at: /private/var/folders/_5/cbsg50991szfp1r9nwxpx8580000gq/T/pytest-129/test_json0/res.json -------------------------------------------------------------------------------------------- generated xml file: /Users/kmike/svn/tox/.tox/py27/log/junit-py27.xml -------------------------------------------------------------------------------------------- =================================================================================================================== short test summary info =================================================================================================================== SKIP [2] /Users/kmike/svn/tox/.tox/py27/lib/python2.7/site-packages/_pytest/skipping.py:132: condition: sys.platform != 'win32' SKIP [1] /Users/kmike/svn/tox/.tox/py27/lib/python2.7/site-packages/_pytest/skipping.py:132: condition: not sys.platform.startswith('linux') FAIL tests/test_config.py::TestCmdInvocation::()::test_version FAIL tests/test_z_cmdline.py::test_run_custom_install_command_error FAIL tests/test_z_cmdline.py::test_skip_unknown_interpreter FAIL tests/test_z_cmdline.py::TestToxRun::()::test_json ====================================================================================================== 4 failed, 201 passed, 3 skipped in 78.50 seconds ======================================================================================================= ERROR: InvocationError: '/Users/kmike/svn/tox/.tox/py27/bin/py.test --junitxml=/Users/kmike/svn/tox/.tox/py27/log/junit-py27.xml' ___________________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________________ ERROR: py27: commands failed ``` From issues-reply at bitbucket.org Sat Jun 7 02:36:39 2014 From: issues-reply at bitbucket.org (Alexandre Conrad) Date: Sat, 07 Jun 2014 00:36:39 -0000 Subject: [Pytest-commit] Issue #177: Retain regular stdout with --result-json (hpk42/tox) Message-ID: <20140607003639.24707.2759@app03.ash-private.bitbucket.org> New issue 177: Retain regular stdout with --result-json https://bitbucket.org/hpk42/tox/issue/177/retain-regular-stdout-with-result-json Alexandre Conrad: The feature --result-json PATH "eats" the normal test results from stdout. I would be very useful if it could write to json AS WELL AS retaining the regular output for human consumption. From issues-reply at bitbucket.org Sun Jun 8 12:13:13 2014 From: issues-reply at bitbucket.org (federico) Date: Sun, 08 Jun 2014 10:13:13 -0000 Subject: [Pytest-commit] Issue #525: Single-page HTML documentation (hpk42/pytest) Message-ID: <20140608101313.12280.85144@app04.ash-private.bitbucket.org> New issue 525: Single-page HTML documentation https://bitbucket.org/hpk42/pytest/issue/525/single-page-html-documentation federico: Hello and thanks for developing py.test! Having all the documentation in one PDF file is quite handy - a single HTML document would be even faster to browse. Thanks! From issues-reply at bitbucket.org Mon Jun 9 16:28:30 2014 From: issues-reply at bitbucket.org (Martin Dengler) Date: Mon, 09 Jun 2014 14:28:30 -0000 Subject: [Pytest-commit] Issue #178: .tox dir cannot be a symlink to a dir (hpk42/tox) Message-ID: <20140609142830.9465.92552@app04.ash-private.bitbucket.org> New issue 178: .tox dir cannot be a symlink to a dir https://bitbucket.org/hpk42/tox/issue/178/tox-dir-cannot-be-a-symlink-to-a-dir Martin Dengler: A combination of tox/_cmdline.py's ``` #!python config.logdir.ensure(dir=1) ``` and py/_path/local.py's ``` #!python if kwargs.get('dir'), 0 ``` (LocalPath.ensure) logic means that if .tox is a symlink, "python -m tox" will fail with: ``` #!python Traceback (most recent call last): File "C:\python\lib\runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "C:\python\lib\runpy.py", line 72, in _run_code exec code in run_globals File "C:\python\lib\site-packages\tox\__main__.py", line 3, in main() File "C:\python\lib\site-packages\tox\_cmdline.py", line 26, in main retcode = Session(config).runcommand() File "C:\python\lib\site-packages\tox\_cmdline.py", line 254, in __init__ config.logdir.ensure(dir=1) File "C:\python\lib\site-packages\py\_path\local.py", line 481, in ensure return p._ensuredirs() File "C:\python\lib\site-packages\py\_path\local.py", line 463, in _ensuredirs parent._ensuredirs() File "C:\python\lib\site-packages\py\_path\local.py", line 466, in _ensuredirs self.mkdir() File "C:\python\lib\site-packages\py\_path\local.py", line 434, in mkdir py.error.checked_call(os.mkdir, getattr(p, "strpath", p)) File "C:\python\lib\site-packages\py\_error.py", line 84, in checked_call raise cls("%s%r" % (func.__name__, args)) py.error.EEXIST: [File exists]: mkdir('\\.tox',) ``` From commits-noreply at bitbucket.org Wed Jun 11 00:06:09 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 10 Jun 2014 22:06:09 -0000 Subject: [Pytest-commit] commit/pytest: nicoddemus: Updated plugins index Message-ID: <20140610220609.13641.53946@app07.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/67bfeba93fee/ Changeset: 67bfeba93fee User: nicoddemus Date: 2014-06-11 00:04:52 Summary: Updated plugins index Affected #: 1 file diff -r 177f44412427b5060724fafe0263b35bddd91183 -r 67bfeba93feec611cf75f96c43e41b20754dfe36 doc/en/plugins_index/index.txt --- a/doc/en/plugins_index/index.txt +++ b/doc/en/plugins_index/index.txt @@ -41,7 +41,7 @@ :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.18 `_ .. 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. + `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 @@ -63,6 +63,8 @@ :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) @@ -105,7 +107,7 @@ :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 `_ .. 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. + `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/ @@ -121,7 +123,7 @@ :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.2 `_ .. 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 + `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 @@ -140,4 +142,4 @@ ========================================================================================== ============================================================================================================ ============================================================================================================ ========================================================================= ============================================================================================================================================= -*(Updated on 2014-05-28)* +*(Updated on 2014-06-10)* 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 Jun 11 17:12:38 2014 From: issues-reply at bitbucket.org (Daniel Hahler) Date: Wed, 11 Jun 2014 15:12:38 -0000 Subject: [Pytest-commit] Issue #526: "ValueError: Plugin already registered" with symlinked copy (via `virtualenv .`) (hpk42/pytest) Message-ID: <20140611151238.24522.98845@app11.ash-private.bitbucket.org> New issue 526: "ValueError: Plugin already registered" with symlinked copy (via `virtualenv .`) https://bitbucket.org/hpk42/pytest/issue/526/valueerror-plugin-already-registered-with Daniel Hahler: I have been running into an issue where virtualenv's `fix_local_scheme` (https://github.com/pypa/virtualenv/blob/develop/virtualenv.py#L1532-1550) creates a `local` folder full of symlinks to all files in the current directory for `virtualenv .`. (`virtualenv .` is used by pytest_django, and I have seen it being used elsewhere already). While this is more a problem with virtualenv (reported at https://github.com/pypa/virtualenv/issues/617) and pytest_django (reported at https://github.com/pelme/pytest_django/issues/102), it would be nice if pytest could be more forgiving and only emit a warning, potentially pointing out that it is the same (symlinked) file? (`fix_local_scheme` only applies to a Python installation with `sysconfig._get_default_scheme() == 'posix_local'`, which is the case for Ubuntu. The default scheme for a custom installation of 3.4.0 is 'posix_prefix') From commits-noreply at bitbucket.org Wed Jun 11 21:23:30 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Wed, 11 Jun 2014 19:23:30 -0000 Subject: [Pytest-commit] commit/py: 2 new changesets Message-ID: <20140611192330.20595.9974@app05.ash-private.bitbucket.org> 2 new commits in py: https://bitbucket.org/hpk42/py/commits/7358b67ed02d/ Changeset: 7358b67ed02d User: schlamar Date: 2014-06-05 11:12:16 Summary: add start and exit hooks to ForkedFunc Affected #: 2 files diff -r dda77653de9d9aa84bfb9ca0e1a59498863563d1 -r 7358b67ed02d8f0be0a74531f4ef5fe961d091cc py/_process/forkedfunc.py --- a/py/_process/forkedfunc.py +++ b/py/_process/forkedfunc.py @@ -11,9 +11,34 @@ import marshal -class ForkedFunc(object): + +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) + + +class ForkedFunc(HookMixin): EXITSTATUS_EXCEPTION = 3 + def __init__(self, fun, args=None, kwargs=None, nice_level=0): if args is None: args = [] @@ -51,8 +76,10 @@ if nice_level: os.nice(nice_level) try: + self._run_on_start() retval = self.fun(*self.args, **self.kwargs) retvalf.write(marshal.dumps(retval)) + self._run_on_exit() except: excinfo = py.code.ExceptionInfo() stderr.write(excinfo.exconly()) @@ -98,6 +125,7 @@ self._removetemp() + class Result(object): def __init__(self, exitstatus, signal, retval, stdout, stderr): self.exitstatus = exitstatus diff -r dda77653de9d9aa84bfb9ca0e1a59498863563d1 -r 7358b67ed02d8f0be0a74531f4ef5fe961d091cc testing/process/test_forkedfunc.py --- a/testing/process/test_forkedfunc.py +++ b/testing/process/test_forkedfunc.py @@ -110,6 +110,25 @@ assert result.signal == 15 +def test_hooks(): + def _boxed(): + return 1 + + def _on_start(proc): + sys.stdout.write("some out\n") + + def _on_exit(proc): + sys.stderr.write("some err\n") + + py.process.ForkedFunc.register_on_start(_on_start) + py.process.ForkedFunc.register_on_exit(_on_exit) + result = py.process.ForkedFunc(_boxed).waitfinish() + assert result.out == "some out\n" + assert result.err == "some err\n" + assert result.exitstatus == 0 + assert result.signal == 0 + assert result.retval == 1 + # ====================================================================== # examples https://bitbucket.org/hpk42/py/commits/af768db52bd0/ Changeset: af768db52bd0 User: schlamar Date: 2014-06-05 11:39:27 Summary: fix unbuffered I/O on Python 3 Affected #: 1 file diff -r 7358b67ed02d8f0be0a74531f4ef5fe961d091cc -r af768db52bd077d1688f27794042cf353e21086a py/_process/forkedfunc.py --- a/py/_process/forkedfunc.py +++ b/py/_process/forkedfunc.py @@ -11,7 +11,6 @@ import marshal - class HookMixin(object): _on_start = list() _on_exit = list() @@ -62,11 +61,11 @@ 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", 0) + sys.stdout = stdout = open(str(self.STDOUT), "wb", 0) fdstdout = stdout.fileno() if fdstdout != 1: os.dup2(fdstdout, 1) - sys.stderr = stderr = open(str(self.STDERR), "w", 0) + sys.stderr = stderr = open(str(self.STDERR), "wb", 0) fdstderr = stderr.fileno() if fdstderr != 2: os.dup2(fdstderr, 2) @@ -125,7 +124,6 @@ self._removetemp() - class Result(object): def __init__(self, exitstatus, signal, retval, stdout, stderr): self.exitstatus = exitstatus Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Wed Jun 11 21:39:33 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Wed, 11 Jun 2014 19:39:33 -0000 Subject: [Pytest-commit] commit/py: hpk42: modified logic so hat it works on python3, also fixed the test Message-ID: <20140611193933.1333.65330@app02.ash-private.bitbucket.org> 1 new commit in py: https://bitbucket.org/hpk42/py/commits/efe89560c45d/ Changeset: efe89560c45d User: hpk42 Date: 2014-06-11 21:38:42 Summary: modified logic so hat it works on python3, also fixed the test and the changelog entry. Affected #: 3 files diff -r af768db52bd077d1688f27794042cf353e21086a -r efe89560c45df226b37fd2dd929f5d46b6f5421c CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,9 @@ 1.4.X ================================================== -- ForkedFunc now opens unbuffered stdout/stderr FDs - (helps to see output/err from a dying process) +- ForkedFunc now has class-level register_on_start/on_exit() + methods to allow adding information in the boxed process. + Thanks Marc Schlaich. 1.4.20 ================================================== diff -r af768db52bd077d1688f27794042cf353e21086a -r efe89560c45df226b37fd2dd929f5d46b6f5421c py/_process/forkedfunc.py --- a/py/_process/forkedfunc.py +++ b/py/_process/forkedfunc.py @@ -32,6 +32,8 @@ def _run_callbacks(self, callbacks): for callback in callbacks: callback(self) + sys.stdout.flush() + sys.stderr.flush() class ForkedFunc(HookMixin): @@ -61,11 +63,11 @@ 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), "wb", 0) + 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), "wb", 0) + sys.stderr = stderr = open(str(self.STDERR), "w") fdstderr = stderr.fileno() if fdstderr != 2: os.dup2(fdstderr, 2) @@ -81,7 +83,7 @@ self._run_on_exit() except: excinfo = py.code.ExceptionInfo() - stderr.write(excinfo.exconly()) + stderr.write(str(excinfo._getreprcrash())) EXITSTATUS = self.EXITSTATUS_EXCEPTION finally: stdout.close() diff -r af768db52bd077d1688f27794042cf353e21086a -r efe89560c45df226b37fd2dd929f5d46b6f5421c testing/process/test_forkedfunc.py --- a/testing/process/test_forkedfunc.py +++ b/testing/process/test_forkedfunc.py @@ -110,7 +110,9 @@ assert result.signal == 15 -def test_hooks(): +def test_hooks(monkeypatch): + monkeypatch.setattr(py.process.ForkedFunc, "_on_exit", []) + monkeypatch.setattr(py.process.ForkedFunc, "_on_start", []) def _boxed(): return 1 Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From issues-reply at bitbucket.org Wed Jun 11 22:46:41 2014 From: issues-reply at bitbucket.org (Daniel Hahler) Date: Wed, 11 Jun 2014 20:46:41 -0000 Subject: [Pytest-commit] Issue #527: Show reason for skips in verbose mode on the terminal (hpk42/pytest) Message-ID: <20140611204641.11645.84348@app09.ash-private.bitbucket.org> New issue 527: Show reason for skips in verbose mode on the terminal https://bitbucket.org/hpk42/pytest/issue/527/show-reason-for-skips-in-verbose-mode-on Daniel Hahler: I have seen py.test adding extra information to tests being skipped, but could not get it to work with a test which pytest_django runs via pytester.runpytest, and which is using `pytest.skip('Test skipped since no Django settings is present.')`. It looks like terminal.pytest_runtest_logreport has no support for printing the `longrepr` of the report?! What worked in the end was using `-r s` to have a report about the skip(s). I would have expected to get the reason for the skipping with `-vv` or `-vvv` already. venv/src/pytest_django/bin/python venv/src/pytest_django/lib/python2.7/site-packages/pytest.py --basetemp=/tmp/pytest-123/testdir/test_sqlite_in_memory_used0/runpytest-0 --tb=short -vv /tmp/pytest-123/testdir/test_sqlite_in_memory_used0 -s ========================================================================== test session starts =========================================================================== platform linux2 -- Python 2.7.6 -- py-1.4.20 -- pytest-2.5.2 -- venv/src/pytest_django/bin/python plugins: ipdb, xdist, django collected 1 items ../../../../../../tmp/pytest-123/testdir/test_sqlite_in_memory_used0/tpkg/test_the_test.py:5: test_a > venv/src/pytest_django/pytest_django/lazy_ django.py(14)skip_if_no_django() 13 import ipdb; ipdb.set_trace() ---> 14 pytest.skip('Test skipped since no Django settings is present.') 15 ipdb> c > venv/src/pytest_django/lib/python2.7/site-packages/_pytest/terminal.py(185)pytest_runtest_logreport() 184 import ipdb; ipdb.set_trace() --> 185 if self.verbosity <= 0: 186 if not hasattr(rep, 'node') and self.showfspath: ipdb> l 180 self._tests_ran = True 181 if not letter and not word: 182 # probably passed setup/teardown 183 return 184 import ipdb; ipdb.set_trace() --> 185 if self.verbosity <= 0: 186 if not hasattr(rep, 'node') and self.showfspath: 187 self.write_fspath_result(rep.fspath, letter) 188 else: 189 self._tw.write(letter) 190 else: btw: it might be useful to have an option to display a report for all cases, basically a shortcut for `-r fEsxXw`. From issues-reply at bitbucket.org Fri Jun 13 18:53:48 2014 From: issues-reply at bitbucket.org (timothy) Date: Fri, 13 Jun 2014 16:53:48 -0000 Subject: [Pytest-commit] Issue #528: Test causes segfault (hpk42/pytest) Message-ID: <20140613165348.6105.63766@app12.ash-private.bitbucket.org> New issue 528: Test causes segfault https://bitbucket.org/hpk42/pytest/issue/528/test-causes-segfault timothy: ``` #!python import unittest import functools def dec(f): @functools.wraps(f) def wrap(*a, **kw): assert f.__annotations__.get('a') == 'equal' return wrap class TestClass(object): @dec def __init__(self, a:'not'): self.a = a class TestSegfault(unittest.TestCase): def test_segfault(self): with self.assertRaises(IOError): TestClass() if __name__ == '__main__': unittest.main() ``` py.test -v ``` #! ============================= test session starts ============================== platform linux -- Python 3.4.1 -- py-1.4.20 -- pytest-2.5.2 -- /home/vagrant/py_ env/bin/python collected 1 items / 1 skipped test_segfault.py:18: TestSegfault.test_segfault Segmentation fault ``` python: ``` #! F ====================================================================== FAIL: test_segfault (__main__.TestSegfault) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_segfault.py", line 20, in test_segfault TestClass() File "test_segfault.py", line 8, in wrap assert f.__annotations__.get('a') == 'equal' AssertionError ---------------------------------------------------------------------- Ran 1 test in 0.001s FAILED (failures=1) ``` From commits-noreply at bitbucket.org Mon Jun 16 11:27:43 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 16 Jun 2014 09:27:43 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: fix flakes issues Message-ID: <20140616092743.20719.40048@app05.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/0457bfb8ce8f/ Changeset: 0457bfb8ce8f User: hpk42 Date: 2014-06-16 11:27:32 Summary: fix flakes issues Affected #: 3 files diff -r 67bfeba93feec611cf75f96c43e41b20754dfe36 -r 0457bfb8ce8f2cf0f8481142122fa634726dbdfc testing/test_assertion.py --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -4,7 +4,6 @@ import py, pytest import _pytest.assertion as plugin from _pytest.assertion import reinterpret -from _pytest.assertion import util needsnewassert = pytest.mark.skipif("sys.version_info < (2,6)") diff -r 67bfeba93feec611cf75f96c43e41b20754dfe36 -r 0457bfb8ce8f2cf0f8481142122fa634726dbdfc testing/test_capture.py --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -65,7 +65,7 @@ assert parser._groups[0].options[0].default == "sys" @needsosdup - @pytest.mark.parametrize("method", + @pytest.mark.parametrize("method", ['no', 'sys', pytest.mark.skipif('not hasattr(os, "dup")', 'fd')]) def test_capturing_basic_api(self, method): capouter = StdCaptureFD() @@ -750,7 +750,7 @@ finally: os.dup2(new_fd, fd) - + class TestStdCapture: captureclass = staticmethod(StdCapture) @@ -1011,20 +1011,3 @@ """) assert "atexit" not in result.stderr.str() -def test_close_and_capture_again(testdir): - testdir.makepyfile(""" - import os - def test_close(): - os.close(1) - def test_capture_again(): - os.write(1, b"hello\\n") - assert 0 - """) - result = testdir.runpytest() - result.stdout.fnmatch_lines(""" - *test_capture_again* - *assert 0* - *stdout* - *hello* - """) - diff -r 67bfeba93feec611cf75f96c43e41b20754dfe36 -r 0457bfb8ce8f2cf0f8481142122fa634726dbdfc testing/test_config.py --- a/testing/test_config.py +++ b/testing/test_config.py @@ -123,8 +123,8 @@ parser.addoption("--hello") """) config = testdir.parseconfig() - pytest.raises(pytest.skip.Exception, - "config.getvalueorskip('hello')") + with pytest.raises(pytest.skip.Exception): + config.getvalueorskip('hello') def test_getoption(self, testdir): config = testdir.parseconfig() Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Wed Jun 18 12:07:39 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Wed, 18 Jun 2014 10:07:39 -0000 Subject: [Pytest-commit] commit/tox: hpk42: Merged in yunake/tox/missing_interpreter_config_option (pull request #111) Message-ID: <20140618100739.26977.79045@app07.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/0c9bf47d235d/ Changeset: 0c9bf47d235d User: hpk42 Date: 2014-06-18 12:07:35 Summary: Merged in yunake/tox/missing_interpreter_config_option (pull request #111) Add support for setting skip_missing_interpreters as a config option and not just a command line flag Affected #: 5 files diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 0c9bf47d235dc5ff021b3355e85f94fcd5095d41 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -7,7 +7,8 @@ resulting in a more refined behaviour in the 1.8 series. And thanks to Clark Boylan for the PR. -- fix issue59: add option "--skip-missing-interpreters" which won't fail the +- fix issue59: add a config variable ``skip-missing-interpreters`` as well as + command line option ``--skip-missing-interpreters`` which won't fail the build if Python interpreters listed in tox.ini are missing. Thanks Alexandre Conrad for PR104. diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 0c9bf47d235dc5ff021b3355e85f94fcd5095d41 CONTRIBUTORS --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -27,3 +27,4 @@ Morgan Fainberg Marc Schlaich Clark Boylan +Eugene Yunak diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 0c9bf47d235dc5ff021b3355e85f94fcd5095d41 doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -32,6 +32,18 @@ ... # override [tox] settings for the jenkins context # note: for jenkins distshare defaults to ``{toxworkdir}/distshare``. +.. confval:: skip_missing_interpreters=BOOL + + .. versionadded:: 1.7.2 + + Setting this to ``True`` is equivalent of passing the + ``--skip-missing-interpreters`` command line option, and will force ``tox`` to + return success even if some of the specified environments were missing. This is + useful for some CI systems or running on a developer box, where you might only + have a subset of all your supported interpreters installed but don't want to + mark the build as failed because of it. As expected, the command line switch + always overrides this setting if passed on the invokation. + **Default:** ``False`` envlist setting +++++++++++++++ diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 0c9bf47d235dc5ff021b3355e85f94fcd5095d41 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -943,6 +943,22 @@ config = newconfig([], inisource) assert config.minversion == "3.0" + def test_skip_missing_interpreters_true(self, tmpdir, newconfig, monkeypatch): + inisource = """ + [tox] + skip_missing_interpreters = True + """ + config = newconfig([], inisource) + assert config.option.skip_missing_interpreters + + def test_skip_missing_interpreters_false(self, tmpdir, newconfig, monkeypatch): + inisource = """ + [tox] + skip_missing_interpreters = False + """ + config = newconfig([], inisource) + assert not config.option.skip_missing_interpreters + def test_defaultenv_commandline(self, tmpdir, newconfig, monkeypatch): config = newconfig(["-epy24"], "") env = config.envconfigs['py24'] diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 0c9bf47d235dc5ff021b3355e85f94fcd5095d41 tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -239,6 +239,10 @@ "{toxinidir}/.tox") config.minversion = reader.getdefault(toxsection, "minversion", None) + if not config.option.skip_missing_interpreters: + config.option.skip_missing_interpreters = \ + reader.getbool(toxsection, "skip_missing_interpreters", False) + # determine indexserver dictionary config.indexserver = {'default': IndexServerConfig('default')} prefix = "indexserver" 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 Wed Jun 18 12:07:39 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Wed, 18 Jun 2014 10:07:39 -0000 Subject: [Pytest-commit] commit/tox: hpk42: Close branch missing_interpreter_config_option Message-ID: <20140618100739.23384.29079@app10.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/d86438bad57c/ Changeset: d86438bad57c Branch: missing_interpreter_config_option User: hpk42 Date: 2014-06-18 12:07:35 Summary: Close branch missing_interpreter_config_option Affected #: 0 files 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 Wed Jun 18 12:07:39 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Wed, 18 Jun 2014 10:07:39 -0000 Subject: [Pytest-commit] commit/tox: 4 new changesets Message-ID: <20140618100739.29282.23200@app06.ash-private.bitbucket.org> 4 new commits in tox: https://bitbucket.org/hpk42/tox/commits/356a12bcd0d7/ Changeset: 356a12bcd0d7 Branch: missing_interpreter_config_option User: yunake Date: 2014-06-18 11:09:13 Summary: add support for setting skip_missing_interpreters as a config option and not just a command line flag Affected #: 5 files diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 356a12bcd0d79355bfb7f73146e7d193dac0ea5f CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -7,7 +7,8 @@ resulting in a more refined behaviour in the 1.8 series. And thanks to Clark Boylan for the PR. -- fix issue59: add option "--skip-missing-interpreters" which won't fail the +- fix issue59: add a config variable ``skip-missing-interpreters`` as well as + command line option ``--skip-missing-interpreters`` which won't fail the build if Python interpreters listed in tox.ini are missing. Thanks Alexandre Conrad for PR104. diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 356a12bcd0d79355bfb7f73146e7d193dac0ea5f CONTRIBUTORS --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -27,3 +27,4 @@ Morgan Fainberg Marc Schlaich Clark Boylan +Eugene Yunak diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 356a12bcd0d79355bfb7f73146e7d193dac0ea5f doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -22,6 +22,7 @@ distshare=path # defaults to {homedir}/.tox/distshare envlist=ENVLIST # defaults to the list of all environments skipsdist=BOOL # defaults to false + skip_missing_interpreters=BOOL # defaults to false ``tox`` autodetects if it is running in a Jenkins_ context @@ -32,6 +33,12 @@ ... # override [tox] settings for the jenkins context # note: for jenkins distshare defaults to ``{toxworkdir}/distshare``. +Setting ``skip_missing_interpreters`` to ``True`` is equivalent of passing the +``--skip-missing-interpreters`` command line option, and will force ``tox`` to +return success even if some of the specified environments were missing. This is +useful for some CI systems or running on a developer box, where you might only +have a subset of all your supported interpreters installed but don't want to +mark the build as failed because of it. envlist setting +++++++++++++++ diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 356a12bcd0d79355bfb7f73146e7d193dac0ea5f tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -943,6 +943,14 @@ config = newconfig([], inisource) assert config.minversion == "3.0" + def test_skip_missing_interpreters(self, tmpdir, newconfig, monkeypatch): + inisource = """ + [tox] + skip_missing_interpreters = True + """ + config = newconfig([], inisource) + assert config.option.skip_missing_interpreters + def test_defaultenv_commandline(self, tmpdir, newconfig, monkeypatch): config = newconfig(["-epy24"], "") env = config.envconfigs['py24'] diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 356a12bcd0d79355bfb7f73146e7d193dac0ea5f tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -239,6 +239,10 @@ "{toxinidir}/.tox") config.minversion = reader.getdefault(toxsection, "minversion", None) + if not config.option.skip_missing_interpreters: + config.option.skip_missing_interpreters = \ + reader.getdefault(toxsection, "skip_missing_interpreters", None) + # determine indexserver dictionary config.indexserver = {'default': IndexServerConfig('default')} prefix = "indexserver" https://bitbucket.org/hpk42/tox/commits/52f230a402da/ Changeset: 52f230a402da Branch: missing_interpreter_config_option User: yunake Date: 2014-06-18 11:53:27 Summary: skip_missing_interpreters: fix bool handling and add appropriate test, thanks hpk42@ for the tip! Affected #: 2 files diff -r 356a12bcd0d79355bfb7f73146e7d193dac0ea5f -r 52f230a402daf3dba2db2d65ed0268942b61014a tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -943,7 +943,7 @@ config = newconfig([], inisource) assert config.minversion == "3.0" - def test_skip_missing_interpreters(self, tmpdir, newconfig, monkeypatch): + def test_skip_missing_interpreters_true(self, tmpdir, newconfig, monkeypatch): inisource = """ [tox] skip_missing_interpreters = True @@ -951,6 +951,14 @@ config = newconfig([], inisource) assert config.option.skip_missing_interpreters + def test_skip_missing_interpreters_false(self, tmpdir, newconfig, monkeypatch): + inisource = """ + [tox] + skip_missing_interpreters = False + """ + config = newconfig([], inisource) + assert not config.option.skip_missing_interpreters + def test_defaultenv_commandline(self, tmpdir, newconfig, monkeypatch): config = newconfig(["-epy24"], "") env = config.envconfigs['py24'] diff -r 356a12bcd0d79355bfb7f73146e7d193dac0ea5f -r 52f230a402daf3dba2db2d65ed0268942b61014a tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -241,7 +241,7 @@ if not config.option.skip_missing_interpreters: config.option.skip_missing_interpreters = \ - reader.getdefault(toxsection, "skip_missing_interpreters", None) + reader.getbool(toxsection, "skip_missing_interpreters", False) # determine indexserver dictionary config.indexserver = {'default': IndexServerConfig('default')} https://bitbucket.org/hpk42/tox/commits/79dc2e679b3b/ Changeset: 79dc2e679b3b Branch: missing_interpreter_config_option User: yunake Date: 2014-06-18 12:03:34 Summary: skip_missing_interpreters: move documentation into a separate confval section Affected #: 1 file diff -r 52f230a402daf3dba2db2d65ed0268942b61014a -r 79dc2e679b3b20259c645f0715d1ef4554b44f3a doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -22,7 +22,6 @@ distshare=path # defaults to {homedir}/.tox/distshare envlist=ENVLIST # defaults to the list of all environments skipsdist=BOOL # defaults to false - skip_missing_interpreters=BOOL # defaults to false ``tox`` autodetects if it is running in a Jenkins_ context @@ -33,12 +32,18 @@ ... # override [tox] settings for the jenkins context # note: for jenkins distshare defaults to ``{toxworkdir}/distshare``. -Setting ``skip_missing_interpreters`` to ``True`` is equivalent of passing the -``--skip-missing-interpreters`` command line option, and will force ``tox`` to -return success even if some of the specified environments were missing. This is -useful for some CI systems or running on a developer box, where you might only -have a subset of all your supported interpreters installed but don't want to -mark the build as failed because of it. +.. confval:: skip_missing_interpreters=BOOL + + .. versionadded:: 1.7.2 + + Setting this to ``True`` is equivalent of passing the + ``--skip-missing-interpreters`` command line option, and will force ``tox`` to + return success even if some of the specified environments were missing. This is + useful for some CI systems or running on a developer box, where you might only + have a subset of all your supported interpreters installed but don't want to + mark the build as failed because of it. As expected, the command line switch + always overrides this setting if passed on the invokation. + **Default:** ``False`` envlist setting +++++++++++++++ https://bitbucket.org/hpk42/tox/commits/0c9bf47d235d/ Changeset: 0c9bf47d235d User: hpk42 Date: 2014-06-18 12:07:35 Summary: Merged in yunake/tox/missing_interpreter_config_option (pull request #111) Add support for setting skip_missing_interpreters as a config option and not just a command line flag Affected #: 5 files diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 0c9bf47d235dc5ff021b3355e85f94fcd5095d41 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -7,7 +7,8 @@ resulting in a more refined behaviour in the 1.8 series. And thanks to Clark Boylan for the PR. -- fix issue59: add option "--skip-missing-interpreters" which won't fail the +- fix issue59: add a config variable ``skip-missing-interpreters`` as well as + command line option ``--skip-missing-interpreters`` which won't fail the build if Python interpreters listed in tox.ini are missing. Thanks Alexandre Conrad for PR104. diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 0c9bf47d235dc5ff021b3355e85f94fcd5095d41 CONTRIBUTORS --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -27,3 +27,4 @@ Morgan Fainberg Marc Schlaich Clark Boylan +Eugene Yunak diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 0c9bf47d235dc5ff021b3355e85f94fcd5095d41 doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -32,6 +32,18 @@ ... # override [tox] settings for the jenkins context # note: for jenkins distshare defaults to ``{toxworkdir}/distshare``. +.. confval:: skip_missing_interpreters=BOOL + + .. versionadded:: 1.7.2 + + Setting this to ``True`` is equivalent of passing the + ``--skip-missing-interpreters`` command line option, and will force ``tox`` to + return success even if some of the specified environments were missing. This is + useful for some CI systems or running on a developer box, where you might only + have a subset of all your supported interpreters installed but don't want to + mark the build as failed because of it. As expected, the command line switch + always overrides this setting if passed on the invokation. + **Default:** ``False`` envlist setting +++++++++++++++ diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 0c9bf47d235dc5ff021b3355e85f94fcd5095d41 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -943,6 +943,22 @@ config = newconfig([], inisource) assert config.minversion == "3.0" + def test_skip_missing_interpreters_true(self, tmpdir, newconfig, monkeypatch): + inisource = """ + [tox] + skip_missing_interpreters = True + """ + config = newconfig([], inisource) + assert config.option.skip_missing_interpreters + + def test_skip_missing_interpreters_false(self, tmpdir, newconfig, monkeypatch): + inisource = """ + [tox] + skip_missing_interpreters = False + """ + config = newconfig([], inisource) + assert not config.option.skip_missing_interpreters + def test_defaultenv_commandline(self, tmpdir, newconfig, monkeypatch): config = newconfig(["-epy24"], "") env = config.envconfigs['py24'] diff -r 7ca156d4acfd6044d65c6c50c9a064e89ad5b579 -r 0c9bf47d235dc5ff021b3355e85f94fcd5095d41 tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -239,6 +239,10 @@ "{toxinidir}/.tox") config.minversion = reader.getdefault(toxsection, "minversion", None) + if not config.option.skip_missing_interpreters: + config.option.skip_missing_interpreters = \ + reader.getbool(toxsection, "skip_missing_interpreters", False) + # determine indexserver dictionary config.indexserver = {'default': IndexServerConfig('default')} prefix = "indexserver" 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 Wed Jun 18 12:11:09 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Wed, 18 Jun 2014 10:11:09 -0000 Subject: [Pytest-commit] commit/tox: hpk42: also put "envlist" into its own section. Message-ID: <20140618101109.15048.13308@app13.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/cefc0fd28dda/ Changeset: cefc0fd28dda User: hpk42 Date: 2014-06-18 12:11:01 Summary: also put "envlist" into its own section. Affected #: 1 file diff -r 0c9bf47d235dc5ff021b3355e85f94fcd5095d41 -r cefc0fd28dda72ac76a9170b4c586e0eb3f1d124 doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -45,15 +45,14 @@ always overrides this setting if passed on the invokation. **Default:** ``False`` -envlist setting -+++++++++++++++ +.. confval:: envlist=CSV -Determining the environment list that ``tox`` is to operate on -happens in this order: + Determining the environment list that ``tox`` is to operate on + happens in this order (if any is found, no further lookups are made): -* command line option ``-eENVLIST`` -* environment variable ``TOXENV`` -* ``tox.ini`` file's ``envlist`` + * command line option ``-eENVLIST`` + * environment variable ``TOXENV`` + * ``tox.ini`` file's ``envlist`` Virtualenv test environment settings 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 Wed Jun 18 12:18:42 2014 From: issues-reply at bitbucket.org (=?utf-8?q?Thomas_G=C3=BCttler?=) Date: Wed, 18 Jun 2014 10:18:42 -0000 Subject: [Pytest-commit] Issue #529: "unique basename" and __init__.py docs (hpk42/pytest) Message-ID: <20140618101842.27732.78060@app08.ash-private.bitbucket.org> New issue 529: "unique basename" and __init__.py docs https://bitbucket.org/hpk42/pytest/issue/529/unique-basename-and-__init__py-docs Thomas G?ttler: Our tests don't have unique basenames, since we use this pattern: The tests for admin.py is located in tests/unit/test_admin.py There are several apps in one project which have an admin.py. This way we get the well known error message: ``` import file mismatch: imported module 'test_admin' has this __file__ attribute: foo/tests/unit/views/test_admin.py which is not the same as the test file we want to collect: bar/tests/unit/test_admin.py HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules ``` Our current solution is to create `__init__.py` files. This is against the docs: *avoid ?__init__.py? files in your test directories. This way your tests can run easily against an installed version of mypkg, independently from the installed package if it contains the tests or not. * Please think about this again. For me, the constraint to have unique base names way to hard. Maybe the best solution is to update the docs: *If you avoid __init__.py files you can ....* I don't think every one should avoid `__init__.py` files. From issues-reply at bitbucket.org Sun Jun 22 00:34:05 2014 From: issues-reply at bitbucket.org (ccanepa) Date: Sat, 21 Jun 2014 22:34:05 -0000 Subject: [Pytest-commit] Issue #530: add an option to run tests versus the WC, not the installed package (hpk42/pytest) Message-ID: <20140621223405.9802.58788@app07.ash-private.bitbucket.org> New issue 530: add an option to run tests versus the WC, not the installed package https://bitbucket.org/hpk42/pytest/issue/530/add-an-option-to-run-tests-versus-the-wc ccanepa: I see in issue https://bitbucket.org/hpk42/pytest/issue/54/ that currently the py.test way is holger krekel said """ The general strategy is to require "python setup.py develop" or "pip install -e ." when running tests, for the tests to find the code they are supposed to test. Otherwise it becomes hard to run the tests against an installed package which is something where py.test shouldn't get in the way. """ While this makes easy to test installed packages, it makes difficult to test without installing. It should be possible to support both ways, without damaging the stated philosophy. **Proposal** Add an option, say -d, such that * py.test ... has the actual behavior * py.test -d ... does the sys.path.insert(0, os.abspath(os.cwd()) thing The -d way supports the workflow * clone dev * hack, hack, py.test -d , hack, py.test -d * push While not touching the stable installation in python **Motivation** While it can be argued that dev should only happen on virtual envs, and that devs should not type in the wrong console :-), eventually bad things happen. **Keeping it simple** The description facing the user can be """ -d inserts the CWD at the beginning of sys.path, meaning tests will run against a local copy of package, if any. When the repository has a typical layout you have ``` cd checkout py.test -d ``` will test against the checked out version, without installing the package. To test the package as installed, you do ``` cd checkout pip install . py.test ``` the test will run against the *installed package*; the installation can be done with any variant of pip install or setup.py install. """ From issues-reply at bitbucket.org Tue Jun 24 05:11:29 2014 From: issues-reply at bitbucket.org (Nikolaus Rath) Date: Tue, 24 Jun 2014 03:11:29 -0000 Subject: [Pytest-commit] Issue #531: Problems with fixture parametrization (hpk42/pytest) Message-ID: <20140624031129.19406.32034@app02.ash-private.bitbucket.org> New issue 531: Problems with fixture parametrization https://bitbucket.org/hpk42/pytest/issue/531/problems-with-fixture-parametrization Nikolaus Rath: Please consider the attached test. In this form, it runs just fine: ``` text $ py.test-3 -v -s test_bug.py =========================== test session starts ============================ platform linux -- Python 3.4.1 -- py-1.4.20 -- pytest-2.5.2 -- /usr/bin/python3 collected 3 items test_bug.py:31: test_one[val1-globorz] PASSED test_bug.py:34: test_two[val1-globorz] PASSED test_bug.py:31: test_one[val2-globorz] PASSED ========================= 3 passed in 0.01 seconds ========================= ``` However, if you reverse the order of the first fixture parametrization, i.e. if you use ``` values = [ Container('val2'), Container('val1') ] ``` instead of ``` values = [ Container('val1'), Container('val2') ] ``` the test suddenly fails with: ``` text test_bug.py:31: test_one[val2-globorz] PASSED test_bug.py:34: test_two[val1-globorz] FAILED test_bug.py:31: test_one[val1-globorz] PASSED ================================= FAILURES ================================= __________________________ test_two[val1-globorz] __________________________ fix1 = (, 'globorz') def test_two(fix1): > assert fix1[0].v == 'val1' E assert 'val2' == 'val1' E - val2 E ? ^ E + val1 E ? ^ test_bug.py:35: AssertionError ``` It seems that py.test thinks that it is passing "val1" to test_two, but it actually passes "val2". From issues-reply at bitbucket.org Wed Jun 25 12:14:52 2014 From: issues-reply at bitbucket.org (Dima Tisnek) Date: Wed, 25 Jun 2014 10:14:52 -0000 Subject: [Pytest-commit] Issue #532: pytest -f does not notice new tests (hpk42/pytest) Message-ID: <20140625101452.4113.66713@app01.ash-private.bitbucket.org> New issue 532: pytest -f does not notice new tests https://bitbucket.org/hpk42/pytest/issue/532/pytest-f-does-not-notice-new-tests Dima Tisnek: pytest -f appears to latch to the set of test cases on first run and does not detect when new test is added. e.g. test_foo.py: def test foo(): assert 0 run pytest -f test_foo.py (one test failing) edit test_foo.py, add def test_bar(): assert 0 (still only one test failing) From issues-reply at bitbucket.org Thu Jun 26 10:59:10 2014 From: issues-reply at bitbucket.org (Simon Lundmark) Date: Thu, 26 Jun 2014 08:59:10 -0000 Subject: [Pytest-commit] Issue #533: Add ability to set suite name in JUnit XML report (hpk42/pytest) Message-ID: <20140626085910.12025.7085@app07.ash-private.bitbucket.org> New issue 533: Add ability to set suite name in JUnit XML report https://bitbucket.org/hpk42/pytest/issue/533/add-ability-to-set-suite-name-in-junit-xml Simon Lundmark: Today as of the resolved issue #355 the XML report's root `` tag's `name` attribute is hard-coded to `pytest`. To make reporting easier in larger projects with several test suites it is useful to set this attribute to something meaningful like `unit`, `integration`, `gui`, etc. Other reporting tools that read and aggregate JUnit-style XML reports rely on this argument. I propose adding a `--junit-suitename str` argument to the py.test command which would set this string. I'm happy to contribute to the project with this feature if the people in charge think it's a good idea. From commits-noreply at bitbucket.org Thu Jun 26 14:28:02 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 26 Jun 2014 12:28:02 -0000 Subject: [Pytest-commit] commit/tox: ssc: Add support for PyPy3 (env "pypy3"). Message-ID: <20140626122802.19339.90992@app13.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/18901cb31482/ Changeset: 18901cb31482 User: ssc Date: 2014-06-25 09:41:37 Summary: Add support for PyPy3 (env "pypy3"). Affected #: 2 files diff -r cefc0fd28dda72ac76a9170b4c586e0eb3f1d124 -r 18901cb31482da6c4db6ed312287f115e9ca5a41 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -554,7 +554,7 @@ envconfig = config.envconfigs['python'] assert envconfig.envpython == envconfig.envbindir.join("python") - @pytest.mark.parametrize("bp", ["jython", "pypy"]) + @pytest.mark.parametrize("bp", ["jython", "pypy", "pypy3"]) def test_envbindir_jython(self, tmpdir, newconfig, bp): config = newconfig(""" [testenv] @@ -916,7 +916,7 @@ assert str(env.basepython) == sys.executable def test_default_environments(self, tmpdir, newconfig, monkeypatch): - envs = "py26,py27,py31,py32,py33,jython,pypy" + envs = "py26,py27,py31,py32,py33,py34,jython,pypy,pypy3" inisource = """ [tox] envlist = %s @@ -928,8 +928,8 @@ env = config.envconfigs[name] if name == "jython": assert env.basepython == "jython" - elif name == "pypy": - assert env.basepython == "pypy" + elif name.startswith("pypy"): + assert env.basepython == name else: assert name.startswith("py") bp = "python%s.%s" %(name[2], name[3]) diff -r cefc0fd28dda72ac76a9170b4c586e0eb3f1d124 -r 18901cb31482da6c4db6ed312287f115e9ca5a41 tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -15,7 +15,7 @@ iswin32 = sys.platform == "win32" -defaultenvs = {'jython': 'jython', 'pypy': 'pypy'} +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 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 Jun 27 06:09:09 2014 From: issues-reply at bitbucket.org (TonasJ) Date: Fri, 27 Jun 2014 04:09:09 -0000 Subject: [Pytest-commit] Issue #179: Tox messes around with system-wide python install for no reason, breaks (hpk42/tox) Message-ID: <20140627040909.14750.24098@app09.ash-private.bitbucket.org> New issue 179: Tox messes around with system-wide python install for no reason, breaks https://bitbucket.org/hpk42/tox/issue/179/tox-messes-around-with-system-wide-python TonasJ: What did I do: I downloaded python 3.4. I compiled it (but didn't install it). I did ./python -m venv --clear /home/jonas/Develop/miraclecrafter/py34venv/ to create a virtualenv. I installed tox inside. The tox.ini I am working with has this envlist: [tox] envlist=py34 .. and this interpreter info: [testenv:py34] basepython=/home/jonas/Develop/miraclecrafter/py34venv/bin/python What happened? When I try to run tox, it tries to access /usr/bin/python anyway which doesn't even have virtualenv installed. For whatever random reason. Unsurprisingly, it falls flat on the face: (py34venv) jonas at cyberman#0: tox GLOB sdist-make: /home/jonas/Develop/miraclecrafter/setup.py py34 create: /home/jonas/Develop/miraclecrafter/.tox/py34 ERROR: invocation failed, logfile: /home/jonas/Develop/miraclecrafter/.tox/py34/log/py34-0.log ERROR: actionid=py34 msg=getenv cmdargs=['/usr/bin/python', '-mvirtualenv', '--setuptools', '--python', '/home/jonas/Develop/miraclecrafter/py34venv/bin/python', 'py34'] env={'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'LESSOPEN': '||/usr/bin/lesspipe.sh %s', 'QT_IM_MODULE': 'ibus', 'LOGNAME': 'jonas', 'USER': 'jonas', 'GNOME_KEYRING_CONTROL': '/run/user/1000/keyring-juNaSm', 'XDG_VTNR': '1', 'QTDIR': '/usr/lib/qt-3.3', 'PS1': '(py34venv) \\u@\\h#\\l: ', 'WINDOWPATH': '1', 'LANG': 'en_US.UTF-8', 'QTLIB': '/usr/lib/qt-3.3/lib', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'XAUTHORITY': '/run/gdm/auth-for-jonas-tFALE0/database', 'SESSION_MANAGER': 'local/unix:@/tmp/.ICE-unix/1543,unix/unix:/tmp/.ICE-unix/1543', 'QTINC': '/usr/lib/qt-3.3/include', 'HISTSIZE': '1000', 'WINDOWID': '38070893', 'XMODIFIERS': '@im=ibus', 'PYTHONHASHSEED': '3820106888', 'SVN_EDITOR': '/usr/bin/vimx', 'HOME': '/home/jonas', 'USERNAME': 'jonas', 'XDG_RUNTIME_DIR': '/run/user/1000', 'SSH_AUTH_SOCK': '/run/user/1000/keyring-juNaSm/ssh', 'VIRTUAL_ENV': '/home/jonas/Develop/miraclecrafter/py34venv', 'VTE_VERSION': '3409', 'PATH': '/home/jonas/Develop/miraclecrafter/.tox/py3 4/bin:/home/jonas/Develop/miraclecrafter/py34venv/bin:/usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin', 'XDG_MENU_PREFIX': 'gnome-', 'QT_GRAPHICSSYSTEM_CHECKED': '1', 'XDG_SESSION_ID': '1', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-z0Vg5HGDXS,guid=9a1dfc2cf5c2a67eb0def58253a3d9c2', '_': '/usr/bin/tox', 'GDMSESSION': 'gnome', 'DESKTOP_SESSION': 'gnome', 'GPG_AGENT_INFO': '/run/user/1000/keyring-juNaSm/gpg:0:1', 'DISPLAY': ':0', 'GNOME_KEYRING_PID': '1541', 'OLDPWD': '/home/jonas/Develop/miraclecrafter/py34venv', 'HOSTNAME': 'cyberman', 'GDM_LANG': 'en_US.UTF-8', 'HISTCONTROL': 'ignoreboth', 'SHLVL': '2', 'PWD': '/home/jonas/Develop/miraclecrafter', 'COLORTERM': 'gnome-terminal', 'MAIL': '/var/spool/mail/jonas', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*. lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36: *.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:', 'XDG_SEAT': 'seat0'} /usr/bin/python: No module named virtualenv ERROR: InvocationError: /usr/bin/python -mvirtualenv --setuptools --python /home/jonas/Develop/miraclecrafter/py34venv/bin/python py34 (see /home/jonas/Develop/miraclecrafter/.tox/py34/log/py34-0.log) ___________________________________ summary ____________________________________ ERROR: py34: InvocationError: /usr/bin/python -mvirtualenv --setuptools --python /home/jonas/Develop/miraclecrafter/py34venv/bin/python py34 (see /home/jonas/Develop/miraclecrafter/.tox/py34/log/py34-0.log) (py34venv) jonas at cyberman#0: So why is this? I didn't even install tox outside the virtualenv. The only test environment py34 I used has an explicit interpreter path to the virtualenv binary. Everything would be available inside there - but tox thinks it needs to touch the system python. Please fix or provide advise on how to avoid. From commits-noreply at bitbucket.org Sat Jun 28 20:23:13 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sat, 28 Jun 2014 18:23:13 -0000 Subject: [Pytest-commit] commit/py: hpk42: Merged in suor/py/suor/remove-duplicate-line-on-pypath-in-readm-1403230088646 (pull request #16) Message-ID: <20140628182313.21041.44535@app09.ash-private.bitbucket.org> 1 new commit in py: https://bitbucket.org/hpk42/py/commits/c769b9203321/ Changeset: c769b9203321 User: hpk42 Date: 2014-06-28 20:23:09 Summary: Merged in suor/py/suor/remove-duplicate-line-on-pypath-in-readm-1403230088646 (pull request #16) Remove duplicate line on py.path in README Affected #: 1 file diff -r efe89560c45df226b37fd2dd929f5d46b6f5421c -r c769b9203321f3a00aaa37f0d77f98320f92ceea README.txt --- a/README.txt +++ b/README.txt @@ -5,7 +5,6 @@ * py.apipkg: explicit API control and lazy-importing * py.iniconfig: easy parsing of .ini files * py.code: dynamic code generation and introspection -* py.path: uniform local and svn path objects NOTE: prior to the 1.4 release this distribution used to contain py.test which is now its own package, see http://pytest.org 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 Sat Jun 28 20:23:13 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sat, 28 Jun 2014 18:23:13 -0000 Subject: [Pytest-commit] commit/py: 2 new changesets Message-ID: <20140628182313.25490.92985@app03.ash-private.bitbucket.org> 2 new commits in py: https://bitbucket.org/hpk42/py/commits/4067e6218f9c/ Changeset: 4067e6218f9c Branch: suor/remove-duplicate-line-on-pypath-in-readm-1403230088646 User: suor Date: 2014-06-20 04:08:29 Summary: Remove duplicate line on py.path in README Affected #: 1 file diff -r efe89560c45df226b37fd2dd929f5d46b6f5421c -r 4067e6218f9c5cb85ee9d26572d9f2840e5754fd README.txt --- a/README.txt +++ b/README.txt @@ -5,7 +5,6 @@ * py.apipkg: explicit API control and lazy-importing * py.iniconfig: easy parsing of .ini files * py.code: dynamic code generation and introspection -* py.path: uniform local and svn path objects NOTE: prior to the 1.4 release this distribution used to contain py.test which is now its own package, see http://pytest.org https://bitbucket.org/hpk42/py/commits/c769b9203321/ Changeset: c769b9203321 User: hpk42 Date: 2014-06-28 20:23:09 Summary: Merged in suor/py/suor/remove-duplicate-line-on-pypath-in-readm-1403230088646 (pull request #16) Remove duplicate line on py.path in README Affected #: 1 file diff -r efe89560c45df226b37fd2dd929f5d46b6f5421c -r c769b9203321f3a00aaa37f0d77f98320f92ceea README.txt --- a/README.txt +++ b/README.txt @@ -5,7 +5,6 @@ * py.apipkg: explicit API control and lazy-importing * py.iniconfig: easy parsing of .ini files * py.code: dynamic code generation and introspection -* py.path: uniform local and svn path objects NOTE: prior to the 1.4 release this distribution used to contain py.test which is now its own package, see http://pytest.org 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 issues-reply at bitbucket.org Sun Jun 29 05:09:18 2014 From: issues-reply at bitbucket.org (William Ting) Date: Sun, 29 Jun 2014 03:09:18 -0000 Subject: [Pytest-commit] Issue #534: pytest fails to catch UnicodeDecodeError's (hpk42/pytest) Message-ID: <20140629030918.27407.14849@app05.ash-private.bitbucket.org> New issue 534: pytest fails to catch UnicodeDecodeError's https://bitbucket.org/hpk42/pytest/issue/534/pytest-fails-to-catch-unicodedecodeerrors William Ting: ``` #!python In [43]: with pytest.raises(UnicodeDecodeError): ....: raise UnicodeDecodeError ....: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in () 1 with pytest.raises(UnicodeDecodeError): ----> 2 raise UnicodeDecodeError 3 TypeError: function takes exactly 5 arguments (0 given) In [44]: ``` From commits-noreply at bitbucket.org Sun Jun 29 09:48:02 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 29 Jun 2014 07:48:02 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: colors as used on the live web page Message-ID: <20140629074802.25188.1252@app03.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/f4bdaf606ad1/ Changeset: f4bdaf606ad1 User: hpk42 Date: 2014-06-29 09:47:50 Summary: colors as used on the live web page Affected #: 1 file diff -r 0457bfb8ce8f2cf0f8481142122fa634726dbdfc -r f4bdaf606ad155ba3b2ed20d19f914001d4f1806 doc/en/_themes/flask/static/flasky.css_t --- a/doc/en/_themes/flask/static/flasky.css_t +++ b/doc/en/_themes/flask/static/flasky.css_t @@ -8,8 +8,9 @@ {% set page_width = '1020px' %} {% set sidebar_width = '220px' %} -{% set link_color = '#490' %} -{% set link_hover_color = '#9c0' %} +/* orange of logo is #d67c29 but we use black for links for now */ +{% set link_color = '#000' %} +{% set link_hover_color = '#000' %} {% set base_font = 'sans-serif' %} {% set header_font = 'sans-serif' %} Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Sun Jun 29 12:08:32 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 29 Jun 2014 10:08:32 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Merged in c_henz/pytest/explicit-ini-filename (pull request #175) Message-ID: <20140629100832.16064.6677@app01.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/b2dc874930b7/ Changeset: b2dc874930b7 User: hpk42 Date: 2014-06-29 12:08:29 Summary: Merged in c_henz/pytest/explicit-ini-filename (pull request #175) Implement the "-c" command line switch that allows to explicitly specifiy the config file to load. Affected #: 3 files diff -r f4bdaf606ad155ba3b2ed20d19f914001d4f1806 -r b2dc874930b733c81582cb7aaecda71939dd4686 _pytest/config.py --- a/_pytest/config.py +++ b/_pytest/config.py @@ -685,7 +685,15 @@ pytest_load_initial_conftests.trylast = True def _initini(self, args): - self.inicfg = getcfg(args, ["pytest.ini", "tox.ini", "setup.cfg"]) + parsed_args = self._parser.parse_known_args(args) + if parsed_args.inifilename: + iniconfig = py.iniconfig.IniConfig(parsed_args.inifilename) + if 'pytest' in iniconfig.sections: + self.inicfg = iniconfig['pytest'] + else: + self.inicfg = {} + else: + self.inicfg = getcfg(args, ["pytest.ini", "tox.ini", "setup.cfg"]) self._parser.addini('addopts', 'extra command line options', 'args') self._parser.addini('minversion', 'minimally required pytest version') diff -r f4bdaf606ad155ba3b2ed20d19f914001d4f1806 -r b2dc874930b733c81582cb7aaecda71939dd4686 _pytest/main.py --- a/_pytest/main.py +++ b/_pytest/main.py @@ -38,6 +38,8 @@ help="exit after first num failures or errors.") group._addoption('--strict', action="store_true", help="run pytest in strict mode, warnings become errors.") + group._addoption("-c", metavar="file", type=str, dest="inifilename", + help="load configuration from `file` instead of trying to locate one of the implicit configuration files.") group = parser.getgroup("collect", "collection") group.addoption('--collectonly', '--collect-only', action="store_true", diff -r f4bdaf606ad155ba3b2ed20d19f914001d4f1806 -r b2dc874930b733c81582cb7aaecda71939dd4686 testing/test_config.py --- a/testing/test_config.py +++ b/testing/test_config.py @@ -79,6 +79,21 @@ config = testdir.parseconfig() pytest.raises(AssertionError, lambda: config.parse([])) + def test_explicitly_specified_config_file_is_loaded(self, testdir): + testdir.makeconftest(""" + def pytest_addoption(parser): + parser.addini("custom", "") + """) + testdir.makeini(""" + [pytest] + custom = 0 + """) + testdir.makefile(".cfg", custom = """ + [pytest] + custom = 1 + """) + config = testdir.parseconfig("-c", "custom.cfg") + assert config.getini("custom") == "1" class TestConfigAPI: def test_config_trace(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 Sun Jun 29 12:08:32 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 29 Jun 2014 10:08:32 -0000 Subject: [Pytest-commit] commit/pytest: 3 new changesets Message-ID: <20140629100832.31900.41229@app11.ash-private.bitbucket.org> 3 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/f052cd6a607b/ Changeset: f052cd6a607b Branch: explicit-ini-filename User: chri... at christian-linux.sarrazin.local Date: 2014-06-27 17:42:37 Summary: Implement the "-c" command line switch that allows to explicitly specifiy the config file to load. This feature was requested in issue #174. Affected #: 3 files diff -r 0457bfb8ce8f2cf0f8481142122fa634726dbdfc -r f052cd6a607b344c783a8bf33cdd5f3ce3562e98 _pytest/config.py --- a/_pytest/config.py +++ b/_pytest/config.py @@ -833,6 +833,14 @@ return False def getcfg(args, inibasenames): + if "-c" in args: + n = len(args) + for i in range(1, n): + if args[i - 1] == "-c" and not str(args[i]).startswith("-"): + iniconfig = py.iniconfig.IniConfig(args[i]) + if 'pytest' in iniconfig.sections: + return iniconfig['pytest'] + return {} args = [x for x in args if not str(x).startswith("-")] if not args: args = [py.path.local()] diff -r 0457bfb8ce8f2cf0f8481142122fa634726dbdfc -r f052cd6a607b344c783a8bf33cdd5f3ce3562e98 _pytest/main.py --- a/_pytest/main.py +++ b/_pytest/main.py @@ -38,6 +38,9 @@ help="exit after first num failures or errors.") group._addoption('--strict', action="store_true", help="run pytest in strict mode, warnings become errors.") + # This option is never used as such, see config.getcfg(). + group._addoption("-c", metavar="file", type=str, dest="_inifilename", + help="load configuration from `file` instead of trying to locate one of the implicit configuration files.") group = parser.getgroup("collect", "collection") group.addoption('--collectonly', '--collect-only', action="store_true", diff -r 0457bfb8ce8f2cf0f8481142122fa634726dbdfc -r f052cd6a607b344c783a8bf33cdd5f3ce3562e98 testing/test_config.py --- a/testing/test_config.py +++ b/testing/test_config.py @@ -79,6 +79,21 @@ config = testdir.parseconfig() pytest.raises(AssertionError, lambda: config.parse([])) + def test_explicitly_specified_config_file_is_loaded(self, testdir): + testdir.makeconftest(""" + def pytest_addoption(parser): + parser.addini("custom", "") + """) + testdir.makeini(""" + [pytest] + custom = 0 + """) + testdir.makefile(".cfg", custom = """ + [pytest] + custom = 1 + """) + config = testdir.parseconfig("-c", "custom.cfg") + assert config.getini("custom") == "1" class TestConfigAPI: def test_config_trace(self, testdir): https://bitbucket.org/hpk42/pytest/commits/e68b51ff970f/ Changeset: e68b51ff970f Branch: explicit-ini-filename User: c_henz Date: 2014-06-28 12:03:55 Summary: Cleaner implementation of early handling of the '-c' command line switch. Affected #: 2 files diff -r f052cd6a607b344c783a8bf33cdd5f3ce3562e98 -r e68b51ff970f72cf23f41f243c0dbad4f1a3da18 _pytest/config.py --- a/_pytest/config.py +++ b/_pytest/config.py @@ -685,7 +685,15 @@ pytest_load_initial_conftests.trylast = True def _initini(self, args): - self.inicfg = getcfg(args, ["pytest.ini", "tox.ini", "setup.cfg"]) + parsed_args = self._parser.parse_known_args(args) + if parsed_args.inifilename: + iniconfig = py.iniconfig.IniConfig(parsed_args.inifilename) + if 'pytest' in iniconfig.sections: + self.inicfg = iniconfig['pytest'] + else: + self.inicfg = {} + else: + self.inicfg = getcfg(args, ["pytest.ini", "tox.ini", "setup.cfg"]) self._parser.addini('addopts', 'extra command line options', 'args') self._parser.addini('minversion', 'minimally required pytest version') @@ -833,14 +841,6 @@ return False def getcfg(args, inibasenames): - if "-c" in args: - n = len(args) - for i in range(1, n): - if args[i - 1] == "-c" and not str(args[i]).startswith("-"): - iniconfig = py.iniconfig.IniConfig(args[i]) - if 'pytest' in iniconfig.sections: - return iniconfig['pytest'] - return {} args = [x for x in args if not str(x).startswith("-")] if not args: args = [py.path.local()] diff -r f052cd6a607b344c783a8bf33cdd5f3ce3562e98 -r e68b51ff970f72cf23f41f243c0dbad4f1a3da18 _pytest/main.py --- a/_pytest/main.py +++ b/_pytest/main.py @@ -38,8 +38,7 @@ help="exit after first num failures or errors.") group._addoption('--strict', action="store_true", help="run pytest in strict mode, warnings become errors.") - # This option is never used as such, see config.getcfg(). - group._addoption("-c", metavar="file", type=str, dest="_inifilename", + group._addoption("-c", metavar="file", type=str, dest="inifilename", help="load configuration from `file` instead of trying to locate one of the implicit configuration files.") group = parser.getgroup("collect", "collection") https://bitbucket.org/hpk42/pytest/commits/b2dc874930b7/ Changeset: b2dc874930b7 User: hpk42 Date: 2014-06-29 12:08:29 Summary: Merged in c_henz/pytest/explicit-ini-filename (pull request #175) Implement the "-c" command line switch that allows to explicitly specifiy the config file to load. Affected #: 3 files diff -r f4bdaf606ad155ba3b2ed20d19f914001d4f1806 -r b2dc874930b733c81582cb7aaecda71939dd4686 _pytest/config.py --- a/_pytest/config.py +++ b/_pytest/config.py @@ -685,7 +685,15 @@ pytest_load_initial_conftests.trylast = True def _initini(self, args): - self.inicfg = getcfg(args, ["pytest.ini", "tox.ini", "setup.cfg"]) + parsed_args = self._parser.parse_known_args(args) + if parsed_args.inifilename: + iniconfig = py.iniconfig.IniConfig(parsed_args.inifilename) + if 'pytest' in iniconfig.sections: + self.inicfg = iniconfig['pytest'] + else: + self.inicfg = {} + else: + self.inicfg = getcfg(args, ["pytest.ini", "tox.ini", "setup.cfg"]) self._parser.addini('addopts', 'extra command line options', 'args') self._parser.addini('minversion', 'minimally required pytest version') diff -r f4bdaf606ad155ba3b2ed20d19f914001d4f1806 -r b2dc874930b733c81582cb7aaecda71939dd4686 _pytest/main.py --- a/_pytest/main.py +++ b/_pytest/main.py @@ -38,6 +38,8 @@ help="exit after first num failures or errors.") group._addoption('--strict', action="store_true", help="run pytest in strict mode, warnings become errors.") + group._addoption("-c", metavar="file", type=str, dest="inifilename", + help="load configuration from `file` instead of trying to locate one of the implicit configuration files.") group = parser.getgroup("collect", "collection") group.addoption('--collectonly', '--collect-only', action="store_true", diff -r f4bdaf606ad155ba3b2ed20d19f914001d4f1806 -r b2dc874930b733c81582cb7aaecda71939dd4686 testing/test_config.py --- a/testing/test_config.py +++ b/testing/test_config.py @@ -79,6 +79,21 @@ config = testdir.parseconfig() pytest.raises(AssertionError, lambda: config.parse([])) + def test_explicitly_specified_config_file_is_loaded(self, testdir): + testdir.makeconftest(""" + def pytest_addoption(parser): + parser.addini("custom", "") + """) + testdir.makeini(""" + [pytest] + custom = 0 + """) + testdir.makefile(".cfg", custom = """ + [pytest] + custom = 1 + """) + config = testdir.parseconfig("-c", "custom.cfg") + assert config.getini("custom") == "1" class TestConfigAPI: def test_config_trace(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 Sun Jun 29 12:08:33 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 29 Jun 2014 10:08:33 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: Close branch explicit-ini-filename Message-ID: <20140629100833.12725.74433@app12.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/7efde3919ec4/ Changeset: 7efde3919ec4 Branch: explicit-ini-filename User: hpk42 Date: 2014-06-29 12:08:29 Summary: Close branch explicit-ini-filename 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 Sun Jun 29 13:42:47 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 29 Jun 2014 11:42:47 -0000 Subject: [Pytest-commit] commit/py: hpk42: make short-style tracebacks more like native and allow callers Message-ID: <20140629114247.17370.27121@app13.ash-private.bitbucket.org> 1 new commit in py: https://bitbucket.org/hpk42/py/commits/6698f8b49b78/ Changeset: 6698f8b49b78 User: hpk42 Date: 2014-06-29 13:00:28 Summary: make short-style tracebacks more like native and allow callers (in particular pytest) to set tb-style on a per-traceback entry basis Affected #: 5 files diff -r c769b9203321f3a00aaa37f0d77f98320f92ceea -r 6698f8b49b78c6489c932ce95ebda8dac2a3655d CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,11 @@ methods to allow adding information in the boxed process. Thanks Marc Schlaich. +- 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 + isplayed as short or long entries. + 1.4.20 ================================================== diff -r c769b9203321f3a00aaa37f0d77f98320f92ceea -r 6698f8b49b78c6489c932ce95ebda8dac2a3655d 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.dev1' +__version__ = '1.4.21.dev2' from py import _apipkg diff -r c769b9203321f3a00aaa37f0d77f98320f92ceea -r 6698f8b49b78c6489c932ce95ebda8dac2a3655d py/_code/code.py --- a/py/_code/code.py +++ b/py/_code/code.py @@ -133,12 +133,17 @@ class TracebackEntry(object): """ a single entry in a traceback """ + _repr_style = None exprinfo = None def __init__(self, rawentry): self._rawentry = rawentry self.lineno = rawentry.tb_lineno - 1 + def set_repr_style(self, mode): + assert mode in ("short", "long") + self._repr_style = mode + @property def frame(self): return py.code.Frame(self._rawentry.tb_frame) @@ -470,17 +475,17 @@ line_index = 0 if line_index < 0: line_index += len(source) - for i in range(len(source)): - if i == line_index: - prefix = self.flow_marker + " " - else: - if short: - continue - prefix = " " - line = prefix + source[i] - lines.append(line) + space_prefix = " " + if short: + lines.append(space_prefix + source.lines[line_index].strip()) + else: + for line in source.lines[:line_index]: + lines.append(space_prefix + line) + lines.append(self.flow_marker + " " + source.lines[line_index]) + for line in source.lines[line_index+1:]: + lines.append(space_prefix + line) if excinfo is not None: - indent = self._getindent(source) + indent = 4 if short else self._getindent(source) lines.extend(self.get_exconly(excinfo, indent=indent, markall=True)) return lines @@ -520,7 +525,6 @@ return ReprLocals(lines) def repr_traceback_entry(self, entry, excinfo=None): - # excinfo is not None if this is the last tb entry source = self._getentrysource(entry) if source is None: source = py.code.Source("???") @@ -530,11 +534,12 @@ line_index = entry.lineno - max(entry.getfirstlinesource(), 0) lines = [] - if self.style in ("short", "long"): - short = self.style == "short" - reprargs = None - if not short: - reprargs = self.repr_args(entry) + style = entry._repr_style + if style is None: + style = self.style + if style in ("short", "long"): + short = style == "short" + reprargs = self.repr_args(entry) if not short else None s = self.get_source(source, line_index, excinfo, short=short) lines.extend(s) if short: @@ -546,10 +551,10 @@ localsrepr = None if not short: localsrepr = self.repr_locals(entry.locals) - return ReprEntry(lines, reprargs, localsrepr, filelocrepr, short) + return ReprEntry(lines, reprargs, localsrepr, filelocrepr, style) if excinfo: lines.extend(self.get_exconly(excinfo, indent=4)) - return ReprEntry(lines, None, None, None, False) + return ReprEntry(lines, None, None, None, style) def _makepath(self, path): if not self.abspath: @@ -628,14 +633,18 @@ self.style = style def toterminal(self, tw): - sepok = False - for entry in self.reprentries: - if self.style == "long": - if sepok: + # the entries might have different styles + last_style = None + for i, entry in enumerate(self.reprentries): + if entry.style == "long": + tw.line("") + entry.toterminal(tw) + if i < len(self.reprentries) - 1: + next_entry = self.reprentries[i+1] + if entry.style == "long" or \ + entry.style == "short" and next_entry.style == "long": tw.sep(self.entrysep) - tw.line("") - sepok = True - entry.toterminal(tw) + if self.extraline: tw.line(self.extraline) @@ -646,6 +655,8 @@ self.extraline = None class ReprEntryNative(TerminalRepr): + style = "native" + def __init__(self, tblines): self.lines = tblines @@ -655,15 +666,15 @@ class ReprEntry(TerminalRepr): localssep = "_ " - def __init__(self, lines, reprfuncargs, reprlocals, filelocrepr, short): + def __init__(self, lines, reprfuncargs, reprlocals, filelocrepr, style): self.lines = lines self.reprfuncargs = reprfuncargs self.reprlocals = reprlocals self.reprfileloc = filelocrepr - self.short = short + self.style = style def toterminal(self, tw): - if self.short: + if self.style == "short": self.reprfileloc.toterminal(tw) for line in self.lines: red = line.startswith("E ") @@ -680,7 +691,8 @@ tw.line("") self.reprlocals.toterminal(tw) if self.reprfileloc: - tw.line("") + if self.lines: + tw.line("") self.reprfileloc.toterminal(tw) def __str__(self): diff -r c769b9203321f3a00aaa37f0d77f98320f92ceea -r 6698f8b49b78c6489c932ce95ebda8dac2a3655d 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.dev1', + version='1.4.21.dev2', url='http://pylib.readthedocs.org/', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff -r c769b9203321f3a00aaa37f0d77f98320f92ceea -r 6698f8b49b78c6489c932ce95ebda8dac2a3655d testing/code/test_excinfo.py --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -547,7 +547,7 @@ reprtb = p.repr_traceback_entry(excinfo.traceback[-2]) lines = reprtb.lines basename = py.path.local(mod.__file__).basename - assert lines[0] == '> func1()' + assert lines[0] == ' func1()' assert basename in str(reprtb.reprfileloc.path) assert reprtb.reprfileloc.lineno == 5 @@ -555,8 +555,8 @@ p = FormattedExcinfo(style="short") reprtb = p.repr_traceback_entry(excinfo.traceback[-1], excinfo) lines = reprtb.lines - assert lines[0] == '> raise ValueError("hello")' - assert lines[1] == 'E ValueError: hello' + assert lines[0] == ' raise ValueError("hello")' + assert lines[1] == 'E ValueError: hello' assert basename in str(reprtb.reprfileloc.path) assert reprtb.reprfileloc.lineno == 3 @@ -611,10 +611,10 @@ last_lines = last_reprtb.lines monkeypatch.undo() basename = py.path.local(mod.__file__).basename - assert lines[0] == '> func1()' + assert lines[0] == ' func1()' - assert last_lines[0] == '> raise ValueError("hello")' - assert last_lines[1] == 'E ValueError: hello' + assert last_lines[0] == ' raise ValueError("hello")' + assert last_lines[1] == 'E ValueError: hello' def test_repr_traceback_and_excinfo(self, importasmod): mod = importasmod(""" @@ -819,3 +819,40 @@ # python 2.4 fails to get the source line for the assert if py.std.sys.version_info >= (2, 5): assert s.count('assert 0') == 2 + + def test_traceback_repr_style(self, importasmod): + mod = importasmod(""" + def f(): + g() + def g(): + h() + def h(): + i() + def i(): + raise ValueError() + """) + excinfo = py.test.raises(ValueError, mod.f) + excinfo.traceback = excinfo.traceback.filter() + excinfo.traceback[1].set_repr_style("short") + excinfo.traceback[2].set_repr_style("short") + r = excinfo.getrepr(style="long") + tw = TWMock() + r.toterminal(tw) + for line in tw.lines: print (line) + assert tw.lines[0] == "" + assert tw.lines[1] == " def f():" + assert tw.lines[2] == "> g()" + assert tw.lines[3] == "" + assert tw.lines[4].endswith("mod.py:3: ") + assert tw.lines[5] == ("_ ", None) + assert tw.lines[6].endswith("in g") + assert tw.lines[7] == " h()" + assert tw.lines[8].endswith("in h") + assert tw.lines[9] == " i()" + assert tw.lines[10] == ("_ ", None) + assert tw.lines[11] == "" + assert tw.lines[12] == " def i():" + assert tw.lines[13] == "> raise ValueError()" + assert tw.lines[14] == "E ValueError" + assert tw.lines[15] == "" + assert tw.lines[16].endswith("mod.py:9: ValueError") 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 Sun Jun 29 13:45:35 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sun, 29 Jun 2014 11:45:35 -0000 Subject: [Pytest-commit] commit/pytest: hpk42: fix issue364: shorten and enhance tracebacks representation by default. Message-ID: <20140629114535.30512.26262@app05.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/011b6de727bc/ Changeset: 011b6de727bc User: hpk42 Date: 2014-06-29 13:32:53 Summary: 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. Affected #: 9 files diff -r b2dc874930b733c81582cb7aaecda71939dd4686 -r 011b6de727bce776d2bb939e65a485c089351a71 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,12 @@ NEXT (2.6) ----------------------------------- +- 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 - change -v output to include full node IDs of tests. Users can copy diff -r b2dc874930b733c81582cb7aaecda71939dd4686 -r 011b6de727bce776d2bb939e65a485c089351a71 _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.6.0.dev1' +__version__ = '2.6.0.dev2' diff -r b2dc874930b733c81582cb7aaecda71939dd4686 -r 011b6de727bce776d2bb939e65a485c089351a71 _pytest/main.py --- a/_pytest/main.py +++ b/_pytest/main.py @@ -390,20 +390,24 @@ fm = self.session._fixturemanager if excinfo.errisinstance(fm.FixtureLookupError): return excinfo.value.formatrepr() + tbfilter = True if self.config.option.fulltrace: style="long" else: self._prunetraceback(excinfo) - # XXX should excinfo.getrepr record all data and toterminal() - # process it? + tbfilter = False # prunetraceback already does it + if style == "auto": + style = "long" + # XXX should excinfo.getrepr record all data and toterminal() process it? if style is None: if self.config.option.tbstyle == "short": style = "short" else: style = "long" + return excinfo.getrepr(funcargs=True, showlocals=self.config.option.showlocals, - style=style) + style=style, tbfilter=tbfilter) repr_failure = _repr_failure_py diff -r b2dc874930b733c81582cb7aaecda71939dd4686 -r 011b6de727bce776d2bb939e65a485c089351a71 _pytest/python.py --- a/_pytest/python.py +++ b/_pytest/python.py @@ -578,6 +578,12 @@ if ntraceback == traceback: ntraceback = ntraceback.cut(excludepath=cutdir) excinfo.traceback = ntraceback.filter() + # issue364: mark all but first and last frames to + # only show a single-line message for each frame + if self.config.option.tbstyle == "auto": + if len(excinfo.traceback) > 2: + for entry in excinfo.traceback[1:-1]: + entry.set_repr_style('short') def _repr_failure_py(self, excinfo, style="long"): if excinfo.errisinstance(pytest.fail.Exception): @@ -588,8 +594,10 @@ def repr_failure(self, excinfo, outerr=None): assert outerr is None, "XXX outerr usage is deprecated" - return self._repr_failure_py(excinfo, - style=self.config.option.tbstyle) + style = self.config.option.tbstyle + if style == "auto": + style = "long" + return self._repr_failure_py(excinfo, style=style) class Generator(FunctionMixin, PyCollector): diff -r b2dc874930b733c81582cb7aaecda71939dd4686 -r 011b6de727bce776d2bb939e65a485c089351a71 _pytest/terminal.py --- a/_pytest/terminal.py +++ b/_pytest/terminal.py @@ -23,8 +23,8 @@ action="store", dest="report", default=None, metavar="opts", help="(deprecated, use -r)") group._addoption('--tb', metavar="style", - action="store", dest="tbstyle", default='long', - choices=['long', 'short', 'no', 'line', 'native'], + action="store", dest="tbstyle", default='auto', + choices=['auto', 'long', 'short', 'no', 'line', 'native'], help="traceback print mode (long/short/line/native/no).") group._addoption('--fulltrace', '--full-trace', action="store_true", default=False, diff -r b2dc874930b733c81582cb7aaecda71939dd4686 -r 011b6de727bce776d2bb939e65a485c089351a71 setup.py --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ def main(): - install_requires = ['py>=1.4.20'] + install_requires = ['py>=1.4.21.dev2'] 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.dev1', + version='2.6.0.dev2', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff -r b2dc874930b733c81582cb7aaecda71939dd4686 -r 011b6de727bce776d2bb939e65a485c089351a71 testing/python/collect.py --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -641,7 +641,7 @@ assert "x = 1" not in out assert "x = 2" not in out result.stdout.fnmatch_lines([ - ">*asd*", + " *asd*", "E*NameError*", ]) result = testdir.runpytest("--fulltrace") diff -r b2dc874930b733c81582cb7aaecda71939dd4686 -r 011b6de727bce776d2bb939e65a485c089351a71 testing/test_assertion.py --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -369,7 +369,7 @@ def test_onefails(): f(3) """) - result = testdir.runpytest(p1) + result = testdir.runpytest(p1, "--tb=long") result.stdout.fnmatch_lines([ "*test_traceback_failure.py F", "====* FAILURES *====", @@ -389,6 +389,25 @@ "*test_traceback_failure.py:4: AssertionError" ]) + result = testdir.runpytest(p1) # "auto" + result.stdout.fnmatch_lines([ + "*test_traceback_failure.py F", + "====* FAILURES *====", + "____*____", + "", + " def test_onefails():", + "> f(3)", + "", + "*test_*.py:6: ", + "", + " def f(x):", + "> assert x == g()", + "E assert 3 == 2", + "E + where 2 = g()", + "", + "*test_traceback_failure.py:4: AssertionError" + ]) + @pytest.mark.skipif("sys.version_info < (2,5) or '__pypy__' in sys.builtin_module_names or sys.platform.startswith('java')" ) def test_warn_missing(testdir): testdir.makepyfile("") diff -r b2dc874930b733c81582cb7aaecda71939dd4686 -r 011b6de727bce776d2bb939e65a485c089351a71 testing/test_terminal.py --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -559,8 +559,8 @@ assert 'x = 0' not in s result.stdout.fnmatch_lines([ "*%s:5*" % p.basename, - ">*assert x", - "E*assert*", + " assert x", + "E assert*", ]) result = testdir.runpytest() s = result.stdout.str() @@ -583,7 +583,7 @@ testdir.makepyfile("import xyz\n") result = testdir.runpytest(*option.args) result.stdout.fnmatch_lines([ - "> import xyz", + "? import xyz", "E ImportError: No module named *xyz*", "*1 error*", ]) 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 Jun 30 12:28:42 2014 From: issues-reply at bitbucket.org (Ronny Pfannschmidt) Date: Mon, 30 Jun 2014 10:28:42 -0000 Subject: [Pytest-commit] Issue #535: marker transfer incompatible with inheritance (hpk42/pytest) Message-ID: <20140630102842.20691.81076@app10.ash-private.bitbucket.org> New issue 535: marker transfer incompatible with inheritance https://bitbucket.org/hpk42/pytest/issue/535/marker-transfer-incompatible-with Ronny Pfannschmidt: when a method is inherited, markers will trasnfer from the subclass to the superclass ``` #!python import pytest class TestAClass(object): def test_something(self): assert True @pytest.mark.skipif("True") class TestBClass(TestAClass): pass class TestCClass(TestAClass): pass ``` will skip in TestCClass (given by tradej on irc) im not yet sure if there is a clear backward-compatible way to solve this