2010-05-26 02:46:51 +08:00
|
|
|
py.test/pylib 1.3.1: new py.test.xfail, --maxfail, better reporting
|
2010-05-22 23:11:30 +08:00
|
|
|
===========================================================================
|
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
The pylib/py.test 1.3.1 release brings:
|
2010-05-26 03:01:43 +08:00
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
- the new imperative ``py.test.xfail()`` helper in order to have a test or
|
2010-05-26 03:01:43 +08:00
|
|
|
setup function result in an "expected failure"
|
|
|
|
- a new option ``--maxfail=NUM`` to stop the test run after some failures
|
|
|
|
- markers/decorators are now applicable to test classes (>=Python2.6)
|
|
|
|
- improved reporting, shorter tracebacks in several cases
|
2010-07-27 03:15:15 +08:00
|
|
|
- some simplified internals, more compatibility with Jython and PyPy
|
2010-05-26 03:01:43 +08:00
|
|
|
- bug fixes and various refinements
|
2010-05-26 02:46:51 +08:00
|
|
|
|
|
|
|
See the below CHANGELOG entry below for more details and
|
2010-07-27 03:15:15 +08:00
|
|
|
http://pylib.org/install.html for installation instructions.
|
2010-05-22 23:11:30 +08:00
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
If you used older versions of py.test you should be able to upgrade
|
|
|
|
to 1.3.1 without changes to your test source code.
|
2010-05-26 03:01:43 +08:00
|
|
|
|
|
|
|
py.test is an automated testing tool working with Python2,
|
2010-05-22 23:11:30 +08:00
|
|
|
Python3, Jython and PyPy versions on all major operating systems. It
|
|
|
|
offers a no-boilerplate testing approach and has inspired other testing
|
|
|
|
tools and enhancements in the standard Python library for more than five
|
|
|
|
years. It has a simple and extensive plugin architecture, configurable
|
|
|
|
reporting and provides unique ways to make it fit to your testing
|
2010-07-27 03:15:15 +08:00
|
|
|
process and needs.
|
2010-05-22 23:11:30 +08:00
|
|
|
|
|
|
|
See http://pytest.org for more info.
|
|
|
|
|
|
|
|
cheers and have fun,
|
|
|
|
|
|
|
|
holger krekel
|
|
|
|
|
|
|
|
Changes between 1.3.0 and 1.3.1
|
|
|
|
==================================================
|
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
New features
|
2010-05-22 23:11:30 +08:00
|
|
|
++++++++++++++++++
|
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
- issue91: introduce new py.test.xfail(reason) helper
|
|
|
|
to imperatively mark a test as expected to fail. Can
|
2010-05-22 23:11:30 +08:00
|
|
|
be used from within setup and test functions. This is
|
2010-07-27 03:15:15 +08:00
|
|
|
useful especially for parametrized tests when certain
|
2010-05-22 23:11:30 +08:00
|
|
|
configurations are expected-to-fail. In this case the
|
|
|
|
declarative approach with the @py.test.mark.xfail cannot
|
2010-07-27 03:15:15 +08:00
|
|
|
be used as it would mark all configurations as xfail.
|
2010-05-22 23:11:30 +08:00
|
|
|
|
2010-05-26 02:46:51 +08:00
|
|
|
- issue102: introduce new --maxfail=NUM option to stop
|
|
|
|
test runs after NUM failures. This is a generalization
|
|
|
|
of the '-x' or '--exitfirst' option which is now equivalent
|
2010-07-27 03:15:15 +08:00
|
|
|
to '--maxfail=1'. Both '-x' and '--maxfail' will
|
|
|
|
now also print a line near the end indicating the Interruption.
|
2010-05-26 02:46:51 +08:00
|
|
|
|
2010-05-22 23:11:30 +08:00
|
|
|
- issue89: allow py.test.mark decorators to be used on classes
|
2010-07-27 03:15:15 +08:00
|
|
|
(class decorators were introduced with python2.6) and
|
2010-05-22 23:11:30 +08:00
|
|
|
also allow to have multiple markers applied at class/module level
|
2010-07-27 03:15:15 +08:00
|
|
|
by specifying a list.
|
2010-05-22 23:11:30 +08:00
|
|
|
|
|
|
|
- improve and refine letter reporting in the progress bar:
|
|
|
|
. pass
|
|
|
|
f failed test
|
|
|
|
s skipped tests (reminder: use for dependency/platform mismatch only)
|
|
|
|
x xfailed test (test that was expected to fail)
|
|
|
|
X xpassed test (test that was expected to fail but passed)
|
|
|
|
|
|
|
|
You can use any combination of 'fsxX' with the '-r' extended
|
2010-07-27 03:15:15 +08:00
|
|
|
reporting option. The xfail/xpass results will show up as
|
|
|
|
skipped tests in the junitxml output - which also fixes
|
2010-05-22 23:11:30 +08:00
|
|
|
issue99.
|
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
- make py.test.cmdline.main() return the exitstatus instead of raising
|
2010-05-22 23:11:30 +08:00
|
|
|
SystemExit and also allow it to be called multiple times. This of
|
2010-07-27 03:15:15 +08:00
|
|
|
course requires that your application and tests are properly teared
|
|
|
|
down and don't have global state.
|
2010-05-22 23:11:30 +08:00
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
Fixes / Maintenance
|
2010-05-22 23:11:30 +08:00
|
|
|
++++++++++++++++++++++
|
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
- improved traceback presentation:
|
2010-05-22 23:11:30 +08:00
|
|
|
- improved and unified reporting for "--tb=short" option
|
|
|
|
- Errors during test module imports are much shorter, (using --tb=short style)
|
|
|
|
- raises shows shorter more relevant tracebacks
|
2010-05-26 02:46:51 +08:00
|
|
|
- --fulltrace now more systematically makes traces longer / inhibits cutting
|
2010-05-22 23:11:30 +08:00
|
|
|
|
|
|
|
- improve support for raises and other dynamically compiled code by
|
|
|
|
manipulating python's linecache.cache instead of the previous
|
2010-07-27 03:15:15 +08:00
|
|
|
rather hacky way of creating custom code objects. This makes
|
2010-05-22 23:11:30 +08:00
|
|
|
it seemlessly work on Jython and PyPy where it previously didn't.
|
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
- fix issue96: make capturing more resilient against Control-C
|
2010-05-22 23:11:30 +08:00
|
|
|
interruptions (involved somewhat substantial refactoring
|
2010-07-27 03:15:15 +08:00
|
|
|
to the underlying capturing functionality to avoid race
|
2010-05-22 23:11:30 +08:00
|
|
|
conditions).
|
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
- fix chaining of conditional skipif/xfail decorators - so it works now
|
2010-05-22 23:11:30 +08:00
|
|
|
as expected to use multiple @py.test.mark.skipif(condition) decorators,
|
2010-07-27 03:15:15 +08:00
|
|
|
including specific reporting which of the conditions lead to skipping.
|
2010-05-22 23:11:30 +08:00
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
- fix issue95: late-import zlib so that it's not required
|
|
|
|
for general py.test startup.
|
2010-05-22 23:11:30 +08:00
|
|
|
|
|
|
|
- fix issue94: make reporting more robust against bogus source code
|
|
|
|
(and internally be more careful when presenting unexpected byte sequences)
|
|
|
|
|