From brianna.laugher at gmail.com Wed Jul 6 09:16:08 2011 From: brianna.laugher at gmail.com (Brianna Laugher) Date: Wed, 6 Jul 2011 17:16:08 +1000 Subject: [py-dev] conftest setting option_tbstyle doesn't work? Message-ID: Hi, I'm not sure if I'm using it wrong, but it seems like setting option_tbstyle to a value in conftest.py is not having the desired effect. In the project I use at work we had option_tbstyle = 'short' and it was working fine, but lately I noticed it doesn't work and tracebacks are long. Manually doing 'py.test --tb=short' still works. At work we are using 1.3.4 (planning to upgrade soon!) but I just did a little test (see below) and it seems to be the case with 2.0.3, as well. I put pytest_runtest_setup in the conftest to validate that it was being used at all. (This example is pretty trivial but with our system tests, the long tracebacks take many pages to scroll through.) So am I specifying this option wrong, or what else might I be doing wrong? Also, was the --help-config option removed? v2.0.3 doesn't seem to know about it. thanks, Brianna (testpytest)blaugher at gfedev21 ~/software/testpytest]$ls conftest.py test_pytest.py (testpytest)blaugher at gfedev21 ~/software/testpytest]$cat conftest.py option_tbstyle = 'line' def pytest_runtest_setup(item): print ("setting up", item) (testpytest)blaugher at gfedev21 ~/software/testpytest]$cat test_pytest.py def func(x): return x + 1 def test_answer(): result = func(3) assert result == 5 (testpytest)blaugher at gfedev21 ~/software/testpytest]$py.test ================================ test session starts ================================= platform linux2 -- Python 2.7.0 -- pytest-2.0.3 collected 1 items test_pytest.py F ====================================== FAILURES ====================================== ____________________________________ test_answer _____________________________________ def test_answer(): result = func(3) > assert result == 5 E assert 4 == 5 test_pytest.py:7: AssertionError ---------------------------------- Captured stdout ----------------------------------- ('setting up', ) ============================== 1 failed in 0.04 seconds ============================== (testpytest)blaugher at gfedev21 ~/software/testpytest]$py.test --tb=short ================================ test session starts ================================= platform linux2 -- Python 2.7.0 -- pytest-2.0.3 collected 1 items test_pytest.py F ====================================== FAILURES ====================================== ____________________________________ test_answer _____________________________________ test_pytest.py:7: in test_answer > assert result == 5 E assert 4 == 5 ---------------------------------- Captured stdout ----------------------------------- ('setting up', ) ============================== 1 failed in 0.04 seconds ============================== (testpytest)blaugher at gfedev21 ~/software/testpytest]$ -- They've just been waiting in a mountain for the right moment: http://modernthings.org/ From holger at merlinux.eu Wed Jul 6 10:13:28 2011 From: holger at merlinux.eu (holger krekel) Date: Wed, 6 Jul 2011 08:13:28 +0000 Subject: [py-dev] conftest setting option_tbstyle doesn't work? In-Reply-To: References: Message-ID: <20110706081328.GY20287@merlinux.eu> Hi Brianna, On Wed, Jul 06, 2011 at 17:16 +1000, Brianna Laugher wrote: > Hi, > > I'm not sure if I'm using it wrong, but it seems like setting > option_tbstyle to a value in conftest.py is not having the desired > effect. > In the project I use at work we had > option_tbstyle = 'short' > and it was working fine, but lately I noticed it doesn't work and > tracebacks are long. Manually doing 'py.test --tb=short' still works. Hum, can you try adding/using an .ini file with an "addopts" value liek "--tb=short" like described here: http://doc.pytest.org/en/latest/customize.html?highlight=addopts#adding-default-options this should work with pytest-2.0 and above. In fact, the tbstyle is not configurable from conftest.py files anymore from the 2.0 version on. HTH, holger > At work we are using 1.3.4 (planning to upgrade soon!) but I just did > a little test (see below) and it seems to be the case with 2.0.3, as > well. I put pytest_runtest_setup in the conftest to validate that it > was being used at all. (This example is pretty trivial but with our > system tests, the long tracebacks take many pages to scroll through.) > > So am I specifying this option wrong, or what else might I be doing wrong? > > Also, was the --help-config option removed? v2.0.3 doesn't seem to > know about it. > > thanks, > Brianna > > > (testpytest)blaugher at gfedev21 ~/software/testpytest]$ls > conftest.py test_pytest.py > (testpytest)blaugher at gfedev21 ~/software/testpytest]$cat conftest.py > > option_tbstyle = 'line' > > > def pytest_runtest_setup(item): > print ("setting up", item) > (testpytest)blaugher at gfedev21 ~/software/testpytest]$cat test_pytest.py > > def func(x): > return x + 1 > > def test_answer(): > result = func(3) > assert result == 5 > > (testpytest)blaugher at gfedev21 ~/software/testpytest]$py.test > ================================ test session starts > ================================= > platform linux2 -- Python 2.7.0 -- pytest-2.0.3 > collected 1 items > > test_pytest.py F > > ====================================== FAILURES > ====================================== > ____________________________________ test_answer > _____________________________________ > > def test_answer(): > result = func(3) > > assert result == 5 > E assert 4 == 5 > > test_pytest.py:7: AssertionError > ---------------------------------- Captured stdout > ----------------------------------- > ('setting up', ) > ============================== 1 failed in 0.04 seconds > ============================== > > > (testpytest)blaugher at gfedev21 ~/software/testpytest]$py.test --tb=short > ================================ test session starts > ================================= > platform linux2 -- Python 2.7.0 -- pytest-2.0.3 > collected 1 items > > test_pytest.py F > > ====================================== FAILURES > ====================================== > ____________________________________ test_answer > _____________________________________ > test_pytest.py:7: in test_answer > > assert result == 5 > E assert 4 == 5 > ---------------------------------- Captured stdout > ----------------------------------- > ('setting up', ) > ============================== 1 failed in 0.04 seconds > ============================== > (testpytest)blaugher at gfedev21 ~/software/testpytest]$ > > > > > > > -- > They've just been waiting in a mountain for the right moment: > http://modernthings.org/ > _______________________________________________ > py-dev mailing list > py-dev at codespeak.net > http://codespeak.net/mailman/listinfo/py-dev > From brianna.laugher at gmail.com Thu Jul 7 02:35:38 2011 From: brianna.laugher at gmail.com (Brianna Laugher) Date: Thu, 7 Jul 2011 10:35:38 +1000 Subject: [py-dev] conftest setting option_tbstyle doesn't work? In-Reply-To: <20110706081328.GY20287@merlinux.eu> References: <20110706081328.GY20287@merlinux.eu> Message-ID: On 6 July 2011 18:13, holger krekel wrote: > Hum, can you try adding/using an .ini file with an "addopts" value > liek "--tb=short" like described here: > > http://doc.pytest.org/en/latest/customize.html?highlight=addopts#adding-default-options > > this should work with pytest-2.0 and above. ?In fact, the tbstyle is not > configurable from conftest.py files anymore from the 2.0 version on. Ah, thanks. I didn't catch on to the fact that that had changed. Adding the pytest.ini works. And it even works on the 1.3.4 version as well. :) cheers Brianna From holger at merlinux.eu Sat Jul 9 12:06:47 2011 From: holger at merlinux.eu (holger krekel) Date: Sat, 9 Jul 2011 10:06:47 +0000 Subject: [py-dev] pytest-2.1.0: perfected assertions and bug fixes Message-ID: <20110709100647.GD12151@merlinux.eu> Welcome to the relase of pytest-2.1, a mature testing tool for Python, supporting CPython 2.4-3.2, Jython and latest PyPy interpreters. See the improved extensive docs (now also as PDF!) with tested examples here: http://pytest.org/ The single biggest news about this release are **perfected assertions** courtesy of Benjamin Peterson. You can now safely use ``assert`` statements in test modules without having to worry about side effects or python optimization ("-OO") options. This is achieved by rewriting assert statements in test modules upon import, using a PEP302 hook. See http://pytest.org/assert.html#advanced-assertion-introspection for detailed information. The work has been partly sponsored by my company, merlinux GmbH. For further details on bug fixes and smaller enhancements see below. If you want to install or upgrade pytest, just type one of:: pip install -U pytest # or easy_install -U pytest best, holger krekel / http://merlinux.eu Changes between 2.0.3 and 2.1.0 ---------------------------------------------- - fix issue53 call nosestyle setup functions with correct ordering - fix issue58 and issue59: new assertion code fixes - merge Benjamin's assertionrewrite branch: now assertions for test modules on python 2.6 and above are done by rewriting the AST and saving the pyc file before the test module is imported. see doc/assert.txt for more info. - fix issue43: improve doctests with better traceback reporting on unexpected exceptions - fix issue47: timing output in junitxml for test cases is now correct - fix issue48: typo in MarkInfo repr leading to exception - fix issue49: avoid confusing error when initizaliation partially fails - fix issue44: env/username expansion for junitxml file path - show releaselevel information in test runs for pypy - reworked doc pages for better navigation and PDF generation - report KeyboardInterrupt even if interrupted during session startup - fix issue 35 - provide PDF doc version and download link from index page From holger at merlinux.eu Sat Jul 9 12:33:32 2011 From: holger at merlinux.eu (holger krekel) Date: Sat, 9 Jul 2011 10:33:32 +0000 Subject: [py-dev] tox-1.1: bug fixes and improved workflow Message-ID: <20110709103332.GE12151@merlinux.eu> Hey all, i just released tox-1.1, the virtualenv/test/CI automation tool. See here for general information and install info: http://codespeak.net/~hpk/tox or http://tox.readthedocs.org (which is missing some navigation links at time of sending email) The release incorporates a number of bug fixes and an enhanced work flow: repeatedly calling tox without increasing version numbers now works (by calling pip -U --nodeps). With this release i consider tox pretty stable and fit for general use. best & thanks to all contributors, holger krekel 1.1 ----------------- - fix issue5 - don't require argparse for python versions that have it - fix issue6 - recreate virtualenv if installing dependencies failed - fix issue3 - fix example on frontpage - fix issue2 - warn if a test command does not come from the test environment - fixed/enhanced: except for initial install always call "-U --no-deps" for installing the sdist package to ensure that a package gets upgraded even if its version number did not change. (reported on TIP mailing list and IRC) - inline virtualenv.py (1.6.1) script to avoid a number of issues, particularly failing to install python3 environents from a python2 virtualenv installation. - rework and enhance docs for display on readthedocs.org From jpmobjoe at gmail.com Tue Aug 9 02:16:56 2011 From: jpmobjoe at gmail.com (Joseph Prince) Date: Tue, 9 Aug 2011 10:16:56 +1000 Subject: [py-dev] How to install pytest on Android device? Message-ID: Hi, I have an Android device and I want to install pytest on it. At the moment, I could invoke Python (my version of Python is 2.6.2). I tried the usual way to install "setuptools". I tried to install a setuptools-0.6c11-py2.6.egg from the webpage ( http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other). so that I can install pytest on http://pypi.python.org/pypi/pytest/2.1.0 When I tried to run the shell for the .egg file, it gives me this error:- # sh setuptools-0.6c11-py2.6.egg dlopen libpython2.6.so error: invalid Python installation: unable to open /data/data/com.googlecode.pythonforandroid/files/python/lib/python2.6/config/Makefile (No such file or directory) Did I miss out any important steps? Please advise. Appreciate your help. -JP -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/py-dev/attachments/20110809/f3398c8e/attachment.htm From Ronny.Pfannschmidt at gmx.de Tue Aug 9 15:13:51 2011 From: Ronny.Pfannschmidt at gmx.de (Ronny Pfannschmidt) Date: Tue, 09 Aug 2011 15:13:51 +0200 Subject: [py-dev] How to install pytest on Android device? In-Reply-To: References: Message-ID: <1312895631.4344.6.camel@Klappe2> On Tue, 2011-08-09 at 10:16 +1000, Joseph Prince wrote: > Hi, > > I have an Android device and I want to install pytest on it. > > At the moment, I could invoke Python (my version of Python is 2.6.2). > I tried the usual way to install "setuptools". as far as i understand a source-install of setuptools is the best for you > > I tried to install a setuptools-0.6c11-py2.6.egg from the webpage > (http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other). > so that I can install pytest on > http://pypi.python.org/pypi/pytest/2.1.0 When I tried to run the shell > for the .egg file, it gives me this error:- > > # sh setuptools-0.6c11-py2.6.egg > dlopen libpython2.6.so > error: invalid Python installation: unable to > open /data/data/com.googlecode.pythonforandroid/files/python/lib/python2.6/config/Makefile (No such file or directory) > eggs are a tricky format, try a source install from a tarball using setup.py, in case of doubt, grab distribute (which is a drop in enhanced replacement for setuptools) > > Did I miss out any important steps? Please advise. > currently i'm not aware of the platform limitations of python on android, it seems it has some slight differences from a normal linux python install (like the missing Makefile the egg complains about) Currently Holger and me don't own Android devices, so please keep us updated on your findings. -- Ronny > > Appreciate your help. > > > -JP > _______________________________________________ > py-dev mailing list > py-dev at codespeak.net > http://codespeak.net/mailman/listinfo/py-dev -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/py-dev/attachments/20110809/f6fc8be6/attachment.pgp From holger at merlinux.eu Sat Aug 20 20:00:06 2011 From: holger at merlinux.eu (holger krekel) Date: Sat, 20 Aug 2011 18:00:06 +0000 Subject: [py-dev] pytest-2.1.1: assertion fixes and improved junitxml output Message-ID: <20110820180006.GO12151@merlinux.eu> pytest-2.1.1 is a backward compatible maintenance release of the popular py.test testing tool. See extensive docs with examples here: http://pytest.org/ Most bug fixes address remaining issues with the perfected assertions introduced with 2.1.0 - many thanks to the bug reporters and to Benjamin Peterson for helping to fix them. Also, junitxml output now produces system-out/err tags which lead to better displays of tracebacks with Jenkins. Also a quick note to package maintainers and others interested: there now is a "pytest" man page which can be generated with "make man" in doc/. If you want to install or upgrade pytest, just type one of:: pip install -U pytest # or easy_install -U pytest best, holger krekel / http://merlinux.eu Changes between 2.1.0 and 2.1.1 ---------------------------------------------- - fix issue64 / pytest.set_trace now works within pytest_generate_tests hooks - fix issue60 / fix error conditions involving the creation of __pycache__ - fix issue63 / assertion rewriting on inserts involving strings containing '%' - fix assertion rewriting on calls with a ** arg - don't cache rewritten modules if bytecode generation is disabled - fix assertion rewriting in read-only directories - fix issue59: provide system-out/err tags for junitxml output - fix issue61: assertion rewriting on boolean operations with 3 or more operands - you can now build a man page with "cd doc ; make man" From holger at merlinux.eu Sat Sep 24 14:11:27 2011 From: holger at merlinux.eu (holger krekel) Date: Sat, 24 Sep 2011 12:11:27 +0000 Subject: [py-dev] pytest-2.1.2: bug fixes and fixes for jython Message-ID: <20110924121127.GY1684@merlinux.eu> pytest-2.1.2 is a minor backward compatible maintenance release of the popular py.test testing tool. pytest is commonly used for unit, functional- and integration testing. See extensive docs with examples here: http://pytest.org/ Most bug fixes address remaining issues with the perfected assertions introduced in the 2.1 series - many thanks to the bug reporters and to Benjamin Peterson for helping to fix them. pytest should also work better with Jython-2.5.1 (and Jython trunk, but not Jython-2.5.2). If you want to install or upgrade pytest, just type one of:: pip install -U pytest # or easy_install -U pytest best, holger krekel / http://merlinux.eu Changes between 2.1.1 and 2.1.2 ---------------------------------------- - fix assertion rewriting on files with windows newlines on some Python versions - refine test discovery by package/module name (--pyargs), thanks Florian Mayer - fix issue69 / assertion rewriting fixed on some boolean operations - fix issue68 / packages now work with assertion rewriting - fix issue66: use different assertion rewriting caches when the -O option is passed - don't try assertion rewriting on Jython, use reinterp From jaraco at jaraco.com Thu Sep 29 23:39:12 2011 From: jaraco at jaraco.com (Jason R. Coombs) Date: Thu, 29 Sep 2011 14:39:12 -0700 Subject: [py-dev] plugin scoping or control Message-ID: I've run into an issue with pytest_assertrepr_compare - I want the hook to apply to only a subset of tests (tests/unit/**), so I defined tests/unit/conftest.py and defined my pytest_assertrepr_compare there, but still tests under tests/other/** get that behavior (when I run py.test on tests/). Is there a way to cause the hook to be loaded only for tests/unit/** (or some other subset of tests)? Alternatively, is there a way to detect from within the pytest_assertrepr_compare function which module/function is under test and select that way? Thanks, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/py-dev/attachments/20110929/76b59416/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 6448 bytes Desc: not available Url : http://codespeak.net/pipermail/py-dev/attachments/20110929/76b59416/attachment-0001.bin