From commits-noreply at bitbucket.org Wed Feb 1 15:05:43 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 01 Feb 2012 14:05:43 -0000 Subject: [py-svn] commit/pytest: hpk42: fix issue177 - actually perform session scope finalization Message-ID: <20120201140543.32602.36493@bitbucket03.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/changeset/d91418fd9fda/ changeset: d91418fd9fda user: hpk42 date: 2012-02-01 14:52:34 summary: fix issue177 - actually perform session scope finalization affected #: 4 files diff -r 6ef58a23837631d521e24ba7100a8cc40cb67c5e -r d91418fd9fda307e93246c053cbc725ad43b6394 _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.2.2.dev6' +__version__ = '2.2.2.dev7' diff -r 6ef58a23837631d521e24ba7100a8cc40cb67c5e -r d91418fd9fda307e93246c053cbc725ad43b6394 _pytest/runner.py --- a/_pytest/runner.py +++ b/_pytest/runner.py @@ -47,6 +47,8 @@ def pytest_sessionstart(session): session._setupstate = SetupState() +def pytest_sessionfinish(session): + session._setupstate.teardown_all() class NodeInfo: def __init__(self, location): diff -r 6ef58a23837631d521e24ba7100a8cc40cb67c5e -r d91418fd9fda307e93246c053cbc725ad43b6394 setup.py --- a/setup.py +++ b/setup.py @@ -17,14 +17,14 @@ Web page: http://pytest.org -(c) Holger Krekel and others, 2004-2011 +(c) Holger Krekel and others, 2004-2012 """ def main(): setup( name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.2.2.dev6', + version='2.2.2.dev7', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff -r 6ef58a23837631d521e24ba7100a8cc40cb67c5e -r d91418fd9fda307e93246c053cbc725ad43b6394 testing/test_python.py --- a/testing/test_python.py +++ b/testing/test_python.py @@ -1551,3 +1551,21 @@ result = testdir.runpytest() assert "TypeError" not in result.stdout.str() assert result.ret == 0 + +def test_issue117_sessionscopeteardown(testdir): + testdir.makepyfile(""" + def pytest_funcarg__app(request): + app = request.cached_setup( + scope='session', + setup=lambda: 0, + teardown=lambda x: 3/x) + return app + def test_func(app): + pass + """) + result = testdir.runpytest() + assert result.ret != 0 + result.stderr.fnmatch_lines([ + "*3/x*", + "*ZeroDivisionError*", + ]) 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 Feb 1 15:06:44 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Wed, 01 Feb 2012 14:06:44 -0000 Subject: [py-svn] commit/pytest: hpk42: add CHANGELOG for last commit Message-ID: <20120201140644.2791.10482@bitbucket13.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/changeset/9b7446ed51e4/ changeset: 9b7446ed51e4 user: hpk42 date: 2012-02-01 15:06:38 summary: add CHANGELOG for last commit affected #: 1 file diff -r d91418fd9fda307e93246c053cbc725ad43b6394 -r 9b7446ed51e4320a7670e499afc39902359c9d71 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ test directory was renamed and some pyc/__pycache__ remain - fix issue106: allow parametrize to be applied multiple times e.g. from module, class and at function level. +- fix issue107: actually perform session scope finalization - add chdir method to monkeypatch funcarg - fix crash resulting from calling monkeypatch undo a second time - extend reports accepting kwargs to set arbitrary additional attributes Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Thu Feb 2 12:24:44 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Thu, 02 Feb 2012 11:24:44 -0000 Subject: [py-svn] commit/pytest: hpk42: fix issue118 - typo Message-ID: <20120202112444.25135.22435@bitbucket03.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/changeset/93a95d1187d6/ changeset: 93a95d1187d6 user: hpk42 date: 2012-02-02 12:24:12 summary: fix issue118 - typo affected #: 1 file diff -r 9b7446ed51e4320a7670e499afc39902359c9d71 -r 93a95d1187d6a22168088a95001c0a5b944a33a5 doc/contents.txt --- a/doc/contents.txt +++ b/doc/contents.txt @@ -1,8 +1,8 @@ .. _toc: -Full pytest documenation -======================== +Full pytest documentation +=========================== `Download latest version as PDF `_ 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 Fri Feb 3 17:04:36 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Fri, 03 Feb 2012 16:04:36 -0000 Subject: [py-svn] commit/pytest: 2 new changesets Message-ID: <20120203160436.6354.46881@bitbucket02.managed.contegix.com> 2 new commits in pytest: https://bitbucket.org/hpk42/pytest/changeset/47ee3480080b/ changeset: 47ee3480080b user: RonnyPfannschmidt date: 2012-02-03 16:33:32 summary: create session.items before preparse, so collectonly wont break on preparse fail, fixes #115 affected #: 3 files diff -r 93a95d1187d6a22168088a95001c0a5b944a33a5 -r 47ee3480080baeac63d99bf2a67ac8d3f7e5bffd CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,8 @@ - fix crash resulting from calling monkeypatch undo a second time - extend reports accepting kwargs to set arbitrary additional attributes this helps xdist serialization/deserialization of extended/customized reports +- fix issue115: make --collectonly robust against preparse failure + (missing files/directories) Changes between 2.2.0 and 2.2.1 ---------------------------------------- diff -r 93a95d1187d6a22168088a95001c0a5b944a33a5 -r 47ee3480080baeac63d99bf2a67ac8d3f7e5bffd _pytest/main.py --- a/_pytest/main.py +++ b/_pytest/main.py @@ -410,6 +410,7 @@ self._notfound = [] self._initialpaths = set() self._initialparts = [] + self.items = items = [] for arg in args: parts = self._parsearg(arg) self._initialparts.append(parts) @@ -425,7 +426,6 @@ if not genitems: return rep.result else: - self.items = items = [] if rep.passed: for node in rep.result: self.items.extend(self.genitems(node)) diff -r 93a95d1187d6a22168088a95001c0a5b944a33a5 -r 47ee3480080baeac63d99bf2a67ac8d3f7e5bffd testing/test_terminal.py --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -256,6 +256,17 @@ *1 error* """).strip()) + def test_collectonly_missing_path(self, testdir): + """this checks issue 115, + failure in parseargs will cause session + not to have the items attribute + """ + result = testdir.runpytest("--collectonly", "uhm_missing_path") + assert result.ret == 3 + result.stderr.fnmatch_lines([ + '*ERROR: file not found*', + ]) + def test_repr_python_version(monkeypatch): try: https://bitbucket.org/hpk42/pytest/changeset/bce3fac6a204/ changeset: bce3fac6a204 user: RonnyPfannschmidt date: 2012-02-03 16:56:06 summary: more quit collectonly shows only files and the number of tests in them affected #: 3 files diff -r 47ee3480080baeac63d99bf2a67ac8d3f7e5bffd -r bce3fac6a204a0d8c8d9e534056ae5b9013c7150 CHANGELOG --- a/CHANGELOG +++ /dev/null @@ -1,1015 +0,0 @@ -Changes between 2.2.1 and 2.2.2.dev ----------------------------------------- - -- make monkeypatch more robust against intermediate dict/env deletions -- use distribute_setup script defaulting to 0.6.24 if no setuptools is installed -- fix issue101: wrong args to unittest.TestCase test function now - produce better output -- fix issue102: report more useful errors and hints for when a - test directory was renamed and some pyc/__pycache__ remain -- fix issue106: allow parametrize to be applied multiple times - e.g. from module, class and at function level. -- fix issue107: actually perform session scope finalization -- add chdir method to monkeypatch funcarg -- fix crash resulting from calling monkeypatch undo a second time -- extend reports accepting kwargs to set arbitrary additional attributes - this helps xdist serialization/deserialization of extended/customized reports -- fix issue115: make --collectonly robust against preparse failure - (missing files/directories) - -Changes between 2.2.0 and 2.2.1 ----------------------------------------- - -- fix issue99 (in pytest and py) internallerrors with resultlog now - produce better output - fixed by normalizing pytest_internalerror - input arguments. -- fix issue97 / traceback issues (in pytest and py) improve traceback output - in conjunction with jinja2 and cython which hack tracebacks -- fix issue93 (in pytest and pytest-xdist) avoid "delayed teardowns": - the final test in a test node will now run its teardown directly - instead of waiting for the end of the session. Thanks Dave Hunt for - the good reporting and feedback. The pytest_runtest_protocol as well - as the pytest_runtest_teardown hooks now have "nextitem" available - which will be None indicating the end of the test run. -- fix collection crash due to unknown-source collected items, thanks - to Ralf Schmitt (fixed by depending on a more recent pylib) - -Changes between 2.1.3 and 2.2.0 ----------------------------------------- - -- fix issue90: introduce eager tearing down of test items so that - teardown function are called earlier. -- add an all-powerful metafunc.parametrize function which allows to - parametrize test function arguments in multiple steps and therefore - from indepdenent plugins and palces. -- add a @pytest.mark.parametrize helper which allows to easily - call a test function with different argument values -- Add examples to the "parametrize" example page, including a quick port - of Test scenarios and the new parametrize function and decorator. -- introduce registration for "pytest.mark.*" helpers via ini-files - or through plugin hooks. Also introduce a "--strict" option which - will treat unregistered markers as errors - allowing to avoid typos and maintain a well described set of markers - for your test suite. See exaples at http://pytest.org/latest/mark.html - and its links. -- issue50: introduce "-m marker" option to select tests based on markers - (this is a stricter and more predictable version of '-k' in that "-m" - only matches complete markers and has more obvious rules for and/or - semantics. -- new feature to help optimizing the speed of your tests: - --durations=N option for displaying N slowest test calls - and setup/teardown methods. -- fix issue87: --pastebin now works with python3 -- fix issue89: --pdb with unexpected exceptions in doctest work more sensibly -- fix and cleanup pytest's own test suite to not leak FDs -- fix issue83: link to generated funcarg list -- fix issue74: pyarg module names are now checked against imp.find_module false positives -- fix compatibility with twisted/trial-11.1.0 use cases -- simplify Node.listchain -- simplify junitxml output code by relying on py.xml -- add support for skip properties on unittest classes and functions - -Changes between 2.1.2 and 2.1.3 ----------------------------------------- - -- fix issue79: assertion rewriting failed on some comparisons in boolops -- correctly handle zero length arguments (a la pytest '') -- fix issue67 / junitxml now contains correct test durations, thanks ronny -- fix issue75 / skipping test failure on jython -- fix issue77 / Allow assertrepr_compare hook to apply to a subset of tests - -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 - -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" - -Changes between 2.0.3 and 2.1.0.DEV ----------------------------------------------- - -- 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 - -Changes between 2.0.2 and 2.0.3 ----------------------------------------------- - -- fix issue38: nicer tracebacks on calls to hooks, particularly early - configure/sessionstart ones - -- fix missing skip reason/meta information in junitxml files, reported - via http://lists.idyll.org/pipermail/testing-in-python/2011-March/003928.html - -- fix issue34: avoid collection failure with "test" prefixed classes - deriving from object. - -- don't require zlib (and other libs) for genscript plugin without - --genscript actually being used. - -- speed up skips (by not doing a full traceback represenation - internally) - -- fix issue37: avoid invalid characters in junitxml's output - -Changes between 2.0.1 and 2.0.2 ----------------------------------------------- - -- tackle issue32 - speed up test runs of very quick test functions - by reducing the relative overhead - -- fix issue30 - extended xfail/skipif handling and improved reporting. - If you have a syntax error in your skip/xfail - expressions you now get nice error reports. - - Also you can now access module globals from xfail/skipif - expressions so that this for example works now:: - - import pytest - import mymodule - @pytest.mark.skipif("mymodule.__version__[0] == "1") - def test_function(): - pass - - This will not run the test function if the module's version string - does not start with a "1". Note that specifying a string instead - of a boolean expressions allows py.test to report meaningful information - when summarizing a test run as to what conditions lead to skipping - (or xfail-ing) tests. - -- fix issue28 - setup_method and pytest_generate_tests work together - The setup_method fixture method now gets called also for - test function invocations generated from the pytest_generate_tests - hook. - -- fix issue27 - collectonly and keyword-selection (-k) now work together - Also, if you do "py.test --collectonly -q" you now get a flat list - of test ids that you can use to paste to the py.test commandline - in order to execute a particular test. - -- fix issue25 avoid reported problems with --pdb and python3.2/encodings output - -- fix issue23 - tmpdir argument now works on Python3.2 and WindowsXP - Starting with Python3.2 os.symlink may be supported. By requiring - a newer py lib version the py.path.local() implementation acknowledges - this. - -- fixed typos in the docs (thanks Victor Garcia, Brianna Laugher) and particular - thanks to Laura Creighton who also revieved parts of the documentation. - -- fix slighly wrong output of verbose progress reporting for classes - (thanks Amaury) - -- more precise (avoiding of) deprecation warnings for node.Class|Function accesses - -- avoid std unittest assertion helper code in tracebacks (thanks Ronny) - -Changes between 2.0.0 and 2.0.1 ----------------------------------------------- - -- refine and unify initial capturing so that it works nicely - even if the logging module is used on an early-loaded conftest.py - file or plugin. -- allow to omit "()" in test ids to allow for uniform test ids - as produced by Alfredo's nice pytest.vim plugin. -- fix issue12 - show plugin versions with "--version" and - "--traceconfig" and also document how to add extra information - to reporting test header -- fix issue17 (import-* reporting issue on python3) by - requiring py>1.4.0 (1.4.1 is going to include it) -- fix issue10 (numpy arrays truth checking) by refining - assertion interpretation in py lib -- fix issue15: make nose compatibility tests compatible - with python3 (now that nose-1.0 supports python3) -- remove somewhat surprising "same-conftest" detection because - it ignores conftest.py when they appear in several subdirs. -- improve assertions ("not in"), thanks Floris Bruynooghe -- improve behaviour/warnings when running on top of "python -OO" - (assertions and docstrings are turned off, leading to potential - false positives) -- introduce a pytest_cmdline_processargs(args) hook - to allow dynamic computation of command line arguments. - This fixes a regression because py.test prior to 2.0 - allowed to set command line options from conftest.py - files which so far pytest-2.0 only allowed from ini-files now. -- fix issue7: assert failures in doctest modules. - unexpected failures in doctests will not generally - show nicer, i.e. within the doctest failing context. -- fix issue9: setup/teardown functions for an xfail-marked - test will report as xfail if they fail but report as normally - passing (not xpassing) if they succeed. This only is true - for "direct" setup/teardown invocations because teardown_class/ - teardown_module cannot closely relate to a single test. -- fix issue14: no logging errors at process exit -- refinements to "collecting" output on non-ttys -- refine internal plugin registration and --traceconfig output -- introduce a mechanism to prevent/unregister plugins from the - command line, see http://pytest.org/plugins.html#cmdunregister -- activate resultlog plugin by default -- fix regression wrt yielded tests which due to the - collection-before-running semantics were not - setup as with pytest 1.3.4. Note, however, that - the recommended and much cleaner way to do test - parametraization remains the "pytest_generate_tests" - mechanism, see the docs. - -Changes between 1.3.4 and 2.0.0 ----------------------------------------------- - -- pytest-2.0 is now its own package and depends on pylib-2.0 -- new ability: python -m pytest / python -m pytest.main ability -- new python invcation: pytest.main(args, plugins) to load - some custom plugins early. -- try harder to run unittest test suites in a more compatible manner - by deferring setup/teardown semantics to the unittest package. - also work harder to run twisted/trial and Django tests which - should now basically work by default. -- introduce a new way to set config options via ini-style files, - by default setup.cfg and tox.ini files are searched. The old - ways (certain environment variables, dynamic conftest.py reading - is removed). -- add a new "-q" option which decreases verbosity and prints a more - nose/unittest-style "dot" output. -- fix issue135 - marks now work with unittest test cases as well -- fix issue126 - introduce py.test.set_trace() to trace execution via - PDB during the running of tests even if capturing is ongoing. -- fix issue123 - new "python -m py.test" invocation for py.test - (requires Python 2.5 or above) -- fix issue124 - make reporting more resilient against tests opening - files on filedescriptor 1 (stdout). -- fix issue109 - sibling conftest.py files will not be loaded. - (and Directory collectors cannot be customized anymore from a Directory's - conftest.py - this needs to happen at least one level up). -- introduce (customizable) assertion failure representations and enhance - output on assertion failures for comparisons and other cases (Floris Bruynooghe) -- nose-plugin: pass through type-signature failures in setup/teardown - functions instead of not calling them (Ed Singleton) -- remove py.test.collect.Directory (follows from a major refactoring - and simplification of the collection process) -- majorly reduce py.test core code, shift function/python testing to own plugin -- fix issue88 (finding custom test nodes from command line arg) -- refine 'tmpdir' creation, will now create basenames better associated - with test names (thanks Ronny) -- "xpass" (unexpected pass) tests don't cause exitcode!=0 -- fix issue131 / issue60 - importing doctests in __init__ files used as namespace packages -- fix issue93 stdout/stderr is captured while importing conftest.py -- fix bug: unittest collected functions now also can have "pytestmark" - applied at class/module level -- add ability to use "class" level for cached_setup helper -- fix strangeness: mark.* objects are now immutable, create new instances - -Changes between 1.3.3 and 1.3.4 ----------------------------------------------- - -- fix issue111: improve install documentation for windows -- fix issue119: fix custom collectability of __init__.py as a module -- fix issue116: --doctestmodules work with __init__.py files as well -- fix issue115: unify internal exception passthrough/catching/GeneratorExit -- fix issue118: new --tb=native for presenting cpython-standard exceptions - -Changes between 1.3.2 and 1.3.3 ----------------------------------------------- - -- fix issue113: assertion representation problem with triple-quoted strings - (and possibly other cases) -- make conftest loading detect that a conftest file with the same - content was already loaded, avoids surprises in nested directory structures - which can be produced e.g. by Hudson. It probably removes the need to use - --confcutdir in most cases. -- fix terminal coloring for win32 - (thanks Michael Foord for reporting) -- fix weirdness: make terminal width detection work on stdout instead of stdin - (thanks Armin Ronacher for reporting) -- remove trailing whitespace in all py/text distribution files - -Changes between 1.3.1 and 1.3.2 ----------------------------------------------- - -New features -++++++++++++++++++ - -- fix issue103: introduce py.test.raises as context manager, examples:: - - with py.test.raises(ZeroDivisionError): - x = 0 - 1 / x - - with py.test.raises(RuntimeError) as excinfo: - call_something() - - # you may do extra checks on excinfo.value|type|traceback here - - (thanks Ronny Pfannschmidt) - -- Funcarg factories can now dynamically apply a marker to a - test invocation. This is for example useful if a factory - provides parameters to a test which are expected-to-fail:: - - def pytest_funcarg__arg(request): - request.applymarker(py.test.mark.xfail(reason="flaky config")) - ... - - def test_function(arg): - ... - -- improved error reporting on collection and import errors. This makes - use of a more general mechanism, namely that for custom test item/collect - nodes ``node.repr_failure(excinfo)`` is now uniformly called so that you can - override it to return a string error representation of your choice - which is going to be reported as a (red) string. - -- introduce '--junitprefix=STR' option to prepend a prefix - to all reports in the junitxml file. - -Bug fixes / Maintenance -++++++++++++++++++++++++++ - -- make tests and the ``pytest_recwarn`` plugin in particular fully compatible - to Python2.7 (if you use the ``recwarn`` funcarg warnings will be enabled so that - you can properly check for their existence in a cross-python manner). -- refine --pdb: ignore xfailed tests, unify its TB-reporting and - don't display failures again at the end. -- fix assertion interpretation with the ** operator (thanks Benjamin Peterson) -- fix issue105 assignment on the same line as a failing assertion (thanks Benjamin Peterson) -- fix issue104 proper escaping for test names in junitxml plugin (thanks anonymous) -- fix issue57 -f|--looponfail to work with xpassing tests (thanks Ronny) -- fix issue92 collectonly reporter and --pastebin (thanks Benjamin Peterson) -- fix py.code.compile(source) to generate unique filenames -- fix assertion re-interp problems on PyPy, by defering code - compilation to the (overridable) Frame.eval class. (thanks Amaury Forgeot) -- fix py.path.local.pyimport() to work with directories -- streamline py.path.local.mkdtemp implementation and usage -- don't print empty lines when showing junitxml-filename -- add optional boolean ignore_errors parameter to py.path.local.remove -- fix terminal writing on win32/python2.4 -- py.process.cmdexec() now tries harder to return properly encoded unicode objects - on all python versions -- install plain py.test/py.which scripts also for Jython, this helps to - get canonical script paths in virtualenv situations -- make path.bestrelpath(path) return ".", note that when calling - X.bestrelpath the assumption is that X is a directory. -- make initial conftest discovery ignore "--" prefixed arguments -- fix resultlog plugin when used in an multicpu/multihost xdist situation - (thanks Jakub Gustak) -- perform distributed testing related reporting in the xdist-plugin - rather than having dist-related code in the generic py.test - distribution -- fix homedir detection on Windows -- ship distribute_setup.py version 0.6.13 - -Changes between 1.3.0 and 1.3.1 ---------------------------------------------- - -New features -++++++++++++++++++ - -- issue91: introduce new py.test.xfail(reason) helper - to imperatively mark a test as expected to fail. Can - be used from within setup and test functions. This is - useful especially for parametrized tests when certain - configurations are expected-to-fail. In this case the - declarative approach with the @py.test.mark.xfail cannot - be used as it would mark all configurations as xfail. - -- 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 - to '--maxfail=1'. Both '-x' and '--maxfail' will - now also print a line near the end indicating the Interruption. - -- issue89: allow py.test.mark decorators to be used on classes - (class decorators were introduced with python2.6) and - also allow to have multiple markers applied at class/module level - by specifying a list. - -- 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 - reporting option. The xfail/xpass results will show up as - skipped tests in the junitxml output - which also fixes - issue99. - -- make py.test.cmdline.main() return the exitstatus instead of raising - SystemExit and also allow it to be called multiple times. This of - course requires that your application and tests are properly teared - down and don't have global state. - -Fixes / Maintenance -++++++++++++++++++++++ - -- improved traceback presentation: - - 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 - - --fulltrace now more systematically makes traces longer / inhibits cutting - -- improve support for raises and other dynamically compiled code by - manipulating python's linecache.cache instead of the previous - rather hacky way of creating custom code objects. This makes - it seemlessly work on Jython and PyPy where it previously didn't. - -- fix issue96: make capturing more resilient against Control-C - interruptions (involved somewhat substantial refactoring - to the underlying capturing functionality to avoid race - conditions). - -- fix chaining of conditional skipif/xfail decorators - so it works now - as expected to use multiple @py.test.mark.skipif(condition) decorators, - including specific reporting which of the conditions lead to skipping. - -- fix issue95: late-import zlib so that it's not required - for general py.test startup. - -- fix issue94: make reporting more robust against bogus source code - (and internally be more careful when presenting unexpected byte sequences) - - -Changes between 1.2.1 and 1.3.0 ---------------------------------------------- - -- deprecate --report option in favour of a new shorter and easier to - remember -r option: it takes a string argument consisting of any - combination of 'xfsX' characters. They relate to the single chars - you see during the dotted progress printing and will print an extra line - per test at the end of the test run. This extra line indicates the exact - position or test ID that you directly paste to the py.test cmdline in order - to re-run a particular test. - -- allow external plugins to register new hooks via the new - pytest_addhooks(pluginmanager) hook. The new release of - the pytest-xdist plugin for distributed and looponfailing - testing requires this feature. - -- add a new pytest_ignore_collect(path, config) hook to allow projects and - plugins to define exclusion behaviour for their directory structure - - for example you may define in a conftest.py this method:: - - def pytest_ignore_collect(path): - return path.check(link=1) - - to prevent even a collection try of any tests in symlinked dirs. - -- new pytest_pycollect_makemodule(path, parent) hook for - allowing customization of the Module collection object for a - matching test module. - -- extend and refine xfail mechanism: - ``@py.test.mark.xfail(run=False)`` do not run the decorated test - ``@py.test.mark.xfail(reason="...")`` prints the reason string in xfail summaries - specifiying ``--runxfail`` on command line virtually ignores xfail markers - -- expose (previously internal) commonly useful methods: - py.io.get_terminal_with() -> return terminal width - py.io.ansi_print(...) -> print colored/bold text on linux/win32 - py.io.saferepr(obj) -> return limited representation string - -- expose test outcome related exceptions as py.test.skip.Exception, - py.test.raises.Exception etc., useful mostly for plugins - doing special outcome interpretation/tweaking - -- (issue85) fix junitxml plugin to handle tests with non-ascii output - -- fix/refine python3 compatibility (thanks Benjamin Peterson) - -- fixes for making the jython/win32 combination work, note however: - jython2.5.1/win32 does not provide a command line launcher, see - http://bugs.jython.org/issue1491 . See pylib install documentation - for how to work around. - -- fixes for handling of unicode exception values and unprintable objects - -- (issue87) fix unboundlocal error in assertionold code - -- (issue86) improve documentation for looponfailing - -- refine IO capturing: stdin-redirect pseudo-file now has a NOP close() method - -- ship distribute_setup.py version 0.6.10 - -- added links to the new capturelog and coverage plugins - - -Changes between 1.2.1 and 1.2.0 ---------------------------------------------- - -- refined usage and options for "py.cleanup":: - - py.cleanup # remove "*.pyc" and "*$py.class" (jython) files - py.cleanup -e .swp -e .cache # also remove files with these extensions - py.cleanup -s # remove "build" and "dist" directory next to setup.py files - py.cleanup -d # also remove empty directories - py.cleanup -a # synonym for "-s -d -e 'pip-log.txt'" - py.cleanup -n # dry run, only show what would be removed - -- add a new option "py.test --funcargs" which shows available funcargs - and their help strings (docstrings on their respective factory function) - for a given test path - -- display a short and concise traceback if a funcarg lookup fails - -- early-load "conftest.py" files in non-dot first-level sub directories. - allows to conveniently keep and access test-related options in a ``test`` - subdir and still add command line options. - -- fix issue67: new super-short traceback-printing option: "--tb=line" will print a single line for each failing (python) test indicating its filename, lineno and the failure value - -- fix issue78: always call python-level teardown functions even if the - according setup failed. This includes refinements for calling setup_module/class functions - which will now only be called once instead of the previous behaviour where they'd be called - multiple times if they raise an exception (including a Skipped exception). Any exception - will be re-corded and associated with all tests in the according module/class scope. - -- fix issue63: assume <40 columns to be a bogus terminal width, default to 80 - -- fix pdb debugging to be in the correct frame on raises-related errors - -- update apipkg.py to fix an issue where recursive imports might - unnecessarily break importing - -- fix plugin links - -Changes between 1.2 and 1.1.1 ---------------------------------------------- - -- moved dist/looponfailing from py.test core into a new - separately released pytest-xdist plugin. - -- new junitxml plugin: --junitxml=path will generate a junit style xml file - which is processable e.g. by the Hudson CI system. - -- new option: --genscript=path will generate a standalone py.test script - which will not need any libraries installed. thanks to Ralf Schmitt. - -- new option: --ignore will prevent specified path from collection. - Can be specified multiple times. - -- new option: --confcutdir=dir will make py.test only consider conftest - files that are relative to the specified dir. - -- new funcarg: "pytestconfig" is the pytest config object for access - to command line args and can now be easily used in a test. - -- install 'py.test' and `py.which` with a ``-$VERSION`` suffix to - disambiguate between Python3, python2.X, Jython and PyPy installed versions. - -- new "pytestconfig" funcarg allows access to test config object - -- new "pytest_report_header" hook can return additional lines - to be displayed at the header of a test run. - -- (experimental) allow "py.test path::name1::name2::..." for pointing - to a test within a test collection directly. This might eventually - evolve as a full substitute to "-k" specifications. - -- streamlined plugin loading: order is now as documented in - customize.html: setuptools, ENV, commandline, conftest. - also setuptools entry point names are turned to canonical namees ("pytest_*") - -- automatically skip tests that need 'capfd' but have no os.dup - -- allow pytest_generate_tests to be defined in classes as well - -- deprecate usage of 'disabled' attribute in favour of pytestmark -- deprecate definition of Directory, Module, Class and Function nodes - in conftest.py files. Use pytest collect hooks instead. - -- collection/item node specific runtest/collect hooks are only called exactly - on matching conftest.py files, i.e. ones which are exactly below - the filesystem path of an item - -- change: the first pytest_collect_directory hook to return something - will now prevent further hooks to be called. - -- change: figleaf plugin now requires --figleaf to run. Also - change its long command line options to be a bit shorter (see py.test -h). - -- change: pytest doctest plugin is now enabled by default and has a - new option --doctest-glob to set a pattern for file matches. - -- change: remove internal py._* helper vars, only keep py._pydir - -- robustify capturing to survive if custom pytest_runtest_setup - code failed and prevented the capturing setup code from running. - -- make py.test.* helpers provided by default plugins visible early - - works transparently both for pydoc and for interactive sessions - which will regularly see e.g. py.test.mark and py.test.importorskip. - -- simplify internal plugin manager machinery -- simplify internal collection tree by introducing a RootCollector node - -- fix assert reinterpreation that sees a call containing "keyword=..." - -- fix issue66: invoke pytest_sessionstart and pytest_sessionfinish - hooks on slaves during dist-testing, report module/session teardown - hooks correctly. - -- fix issue65: properly handle dist-testing if no - execnet/py lib installed remotely. - -- skip some install-tests if no execnet is available - -- fix docs, fix internal bin/ script generation - - -Changes between 1.1.1 and 1.1.0 ---------------------------------------------- - -- introduce automatic plugin registration via 'pytest11' - entrypoints via setuptools' pkg_resources.iter_entry_points - -- fix py.test dist-testing to work with execnet >= 1.0.0b4 - -- re-introduce py.test.cmdline.main() for better backward compatibility - -- svn paths: fix a bug with path.check(versioned=True) for svn paths, - allow '%' in svn paths, make svnwc.update() default to interactive mode - like in 1.0.x and add svnwc.update(interactive=False) to inhibit interaction. - -- refine distributed tarball to contain test and no pyc files - -- try harder to have deprecation warnings for py.compat.* accesses - report a correct location - -Changes between 1.1.0 and 1.0.2 ---------------------------------------------- - -* adjust and improve docs - -* remove py.rest tool and internal namespace - it was - never really advertised and can still be used with - the old release if needed. If there is interest - it could be revived into its own tool i guess. - -* fix issue48 and issue59: raise an Error if the module - from an imported test file does not seem to come from - the filepath - avoids "same-name" confusion that has - been reported repeatedly - -* merged Ronny's nose-compatibility hacks: now - nose-style setup_module() and setup() functions are - supported - -* introduce generalized py.test.mark function marking - -* reshuffle / refine command line grouping - -* deprecate parser.addgroup in favour of getgroup which creates option group - -* add --report command line option that allows to control showing of skipped/xfailed sections - -* generalized skipping: a new way to mark python functions with skipif or xfail - at function, class and modules level based on platform or sys-module attributes. - -* extend py.test.mark decorator to allow for positional args - -* introduce and test "py.cleanup -d" to remove empty directories - -* fix issue #59 - robustify unittest test collection - -* make bpython/help interaction work by adding an __all__ attribute - to ApiModule, cleanup initpkg - -* use MIT license for pylib, add some contributors - -* remove py.execnet code and substitute all usages with 'execnet' proper - -* fix issue50 - cached_setup now caches more to expectations - for test functions with multiple arguments. - -* merge Jarko's fixes, issue #45 and #46 - -* add the ability to specify a path for py.lookup to search in - -* fix a funcarg cached_setup bug probably only occuring - in distributed testing and "module" scope with teardown. - -* many fixes and changes for making the code base python3 compatible, - many thanks to Benjamin Peterson for helping with this. - -* consolidate builtins implementation to be compatible with >=2.3, - add helpers to ease keeping 2 and 3k compatible code - -* deprecate py.compat.doctest|subprocess|textwrap|optparse - -* deprecate py.magic.autopath, remove py/magic directory - -* move pytest assertion handling to py/code and a pytest_assertion - plugin, add "--no-assert" option, deprecate py.magic namespaces - in favour of (less) py.code ones. - -* consolidate and cleanup py/code classes and files - -* cleanup py/misc, move tests to bin-for-dist - -* introduce delattr/delitem/delenv methods to py.test's monkeypatch funcarg - -* consolidate py.log implementation, remove old approach. - -* introduce py.io.TextIO and py.io.BytesIO for distinguishing between - text/unicode and byte-streams (uses underlying standard lib io.* - if available) - -* make py.unittest_convert helper script available which converts "unittest.py" - style files into the simpler assert/direct-test-classes py.test/nosetests - style. The script was written by Laura Creighton. - -* simplified internal localpath implementation - -Changes between 1.0.1 and 1.0.2 -------------------------------------------- - -* fixing packaging issues, triggered by fedora redhat packaging, - also added doc, examples and contrib dirs to the tarball. - -* added a documentation link to the new django plugin. - -Changes between 1.0.0 and 1.0.1 -------------------------------------------- - -* added a 'pytest_nose' plugin which handles nose.SkipTest, - nose-style function/method/generator setup/teardown and - tries to report functions correctly. - -* capturing of unicode writes or encoded strings to sys.stdout/err - work better, also terminalwriting was adapted and somewhat - unified between windows and linux. - -* improved documentation layout and content a lot - -* added a "--help-config" option to show conftest.py / ENV-var names for - all longopt cmdline options, and some special conftest.py variables. - renamed 'conf_capture' conftest setting to 'option_capture' accordingly. - -* fix issue #27: better reporting on non-collectable items given on commandline - (e.g. pyc files) - -* fix issue #33: added --version flag (thanks Benjamin Peterson) - -* fix issue #32: adding support for "incomplete" paths to wcpath.status() - -* "Test" prefixed classes are *not* collected by default anymore if they - have an __init__ method - -* monkeypatch setenv() now accepts a "prepend" parameter - -* improved reporting of collection error tracebacks - -* simplified multicall mechanism and plugin architecture, - renamed some internal methods and argnames - -Changes between 1.0.0b9 and 1.0.0 -------------------------------------------- - -* more terse reporting try to show filesystem path relatively to current dir -* improve xfail output a bit - -Changes between 1.0.0b8 and 1.0.0b9 -------------------------------------------- - -* cleanly handle and report final teardown of test setup - -* fix svn-1.6 compat issue with py.path.svnwc().versioned() - (thanks Wouter Vanden Hove) - -* setup/teardown or collection problems now show as ERRORs - or with big "E"'s in the progress lines. they are reported - and counted separately. - -* dist-testing: properly handle test items that get locally - collected but cannot be collected on the remote side - often - due to platform/dependency reasons - -* simplified py.test.mark API - see keyword plugin documentation - -* integrate better with logging: capturing now by default captures - test functions and their immediate setup/teardown in a single stream - -* capsys and capfd funcargs now have a readouterr() and a close() method - (underlyingly py.io.StdCapture/FD objects are used which grew a - readouterr() method as well to return snapshots of captured out/err) - -* make assert-reinterpretation work better with comparisons not - returning bools (reported with numpy from thanks maciej fijalkowski) - -* reworked per-test output capturing into the pytest_iocapture.py plugin - and thus removed capturing code from config object - -* item.repr_failure(excinfo) instead of item.repr_failure(excinfo, outerr) - - -Changes between 1.0.0b7 and 1.0.0b8 -------------------------------------------- - -* pytest_unittest-plugin is now enabled by default - -* introduced pytest_keyboardinterrupt hook and - refined pytest_sessionfinish hooked, added tests. - -* workaround a buggy logging module interaction ("closing already closed - files"). Thanks to Sridhar Ratnakumar for triggering. - -* if plugins use "py.test.importorskip" for importing - a dependency only a warning will be issued instead - of exiting the testing process. - -* many improvements to docs: - - refined funcargs doc , use the term "factory" instead of "provider" - - added a new talk/tutorial doc page - - better download page - - better plugin docstrings - - added new plugins page and automatic doc generation script - -* fixed teardown problem related to partially failing funcarg setups - (thanks MrTopf for reporting), "pytest_runtest_teardown" is now - always invoked even if the "pytest_runtest_setup" failed. - -* tweaked doctest output for docstrings in py modules, - thanks Radomir. - -Changes between 1.0.0b3 and 1.0.0b7 -------------------------------------------- - -* renamed py.test.xfail back to py.test.mark.xfail to avoid - two ways to decorate for xfail - -* re-added py.test.mark decorator for setting keywords on functions - (it was actually documented so removing it was not nice) - -* remove scope-argument from request.addfinalizer() because - request.cached_setup has the scope arg. TOOWTDI. - -* perform setup finalization before reporting failures - -* apply modified patches from Andreas Kloeckner to allow - test functions to have no func_code (#22) and to make - "-k" and function keywords work (#20) - -* apply patch from Daniel Peolzleithner (issue #23) - -* resolve issue #18, multiprocessing.Manager() and - redirection clash - -* make __name__ == "__channelexec__" for remote_exec code - -Changes between 1.0.0b1 and 1.0.0b3 -------------------------------------------- - -* plugin classes are removed: one now defines - hooks directly in conftest.py or global pytest_*.py - files. - -* added new pytest_namespace(config) hook that allows - to inject helpers directly to the py.test.* namespace. - -* documented and refined many hooks - -* added new style of generative tests via - pytest_generate_tests hook that integrates - well with function arguments. - - -Changes between 0.9.2 and 1.0.0b1 -------------------------------------------- - -* introduced new "funcarg" setup method, - see doc/test/funcarg.txt - -* introduced plugin architecuture and many - new py.test plugins, see - doc/test/plugins.txt - -* teardown_method is now guaranteed to get - called after a test method has run. - -* new method: py.test.importorskip(mod,minversion) - will either import or call py.test.skip() - -* completely revised internal py.test architecture - -* new py.process.ForkedFunc object allowing to - fork execution of a function to a sub process - and getting a result back. - -XXX lots of things missing here XXX - -Changes between 0.9.1 and 0.9.2 -------------------------------------------- - -* refined installation and metadata, created new setup.py, - now based on setuptools/ez_setup (thanks to Ralf Schmitt - for his support). - -* improved the way of making py.* scripts available in - windows environments, they are now added to the - Scripts directory as ".cmd" files. - -* py.path.svnwc.status() now is more complete and - uses xml output from the 'svn' command if available - (Guido Wesdorp) - -* fix for py.path.svn* to work with svn 1.5 - (Chris Lamb) - -* fix path.relto(otherpath) method on windows to - use normcase for checking if a path is relative. - -* py.test's traceback is better parseable from editors - (follows the filenames:LINENO: MSG convention) - (thanks to Osmo Salomaa) - -* fix to javascript-generation, "py.test --runbrowser" - should work more reliably now - -* removed previously accidentally added - py.test.broken and py.test.notimplemented helpers. - -* there now is a py.__version__ attribute - -Changes between 0.9.0 and 0.9.1 -------------------------------------------- - -This is a fairly complete list of changes between 0.9 and 0.9.1, which can -serve as a reference for developers. - -* allowing + signs in py.path.svn urls [39106] -* fixed support for Failed exceptions without excinfo in py.test [39340] -* added support for killing processes for Windows (as well as platforms that - support os.kill) in py.misc.killproc [39655] -* added setup/teardown for generative tests to py.test [40702] -* added detection of FAILED TO LOAD MODULE to py.test [40703, 40738, 40739] -* fixed problem with calling .remove() on wcpaths of non-versioned files in - py.path [44248] -* fixed some import and inheritance issues in py.test [41480, 44648, 44655] -* fail to run greenlet tests when pypy is available, but without stackless - [45294] -* small fixes in rsession tests [45295] -* fixed issue with 2.5 type representations in py.test [45483, 45484] -* made that internal reporting issues displaying is done atomically in py.test - [45518] -* made that non-existing files are igored by the py.lookup script [45519] -* improved exception name creation in py.test [45535] -* made that less threads are used in execnet [merge in 45539] -* removed lock required for atomical reporting issue displaying in py.test - [45545] -* removed globals from execnet [45541, 45547] -* refactored cleanup mechanics, made that setDaemon is set to 1 to make atexit - get called in 2.5 (py.execnet) [45548] -* fixed bug in joining threads in py.execnet's servemain [45549] -* refactored py.test.rsession tests to not rely on exact output format anymore - [45646] -* using repr() on test outcome [45647] -* added 'Reason' classes for py.test.skip() [45648, 45649] -* killed some unnecessary sanity check in py.test.collect [45655] -* avoid using os.tmpfile() in py.io.fdcapture because on Windows it's only - usable by Administrators [45901] -* added support for locking and non-recursive commits to py.path.svnwc [45994] -* locking files in py.execnet to prevent CPython from segfaulting [46010] -* added export() method to py.path.svnurl -* fixed -d -x in py.test [47277] -* fixed argument concatenation problem in py.path.svnwc [49423] -* restore py.test behaviour that it exits with code 1 when there are failures - [49974] -* don't fail on html files that don't have an accompanying .txt file [50606] -* fixed 'utestconvert.py < input' [50645] -* small fix for code indentation in py.code.source [50755] -* fix _docgen.py documentation building [51285] -* improved checks for source representation of code blocks in py.test [51292] -* added support for passing authentication to py.path.svn* objects [52000, - 52001] -* removed sorted() call for py.apigen tests in favour of [].sort() to support - Python 2.3 [52481] diff -r 47ee3480080baeac63d99bf2a67ac8d3f7e5bffd -r bce3fac6a204a0d8c8d9e534056ae5b9013c7150 _pytest/terminal.py --- a/_pytest/terminal.py +++ b/_pytest/terminal.py @@ -282,10 +282,18 @@ # we take care to leave out Instances aka () # because later versions are going to get rid of them anyway if self.config.option.verbose < 0: - for item in items: - nodeid = item.nodeid - nodeid = nodeid.replace("::()::", "::") - self._tw.line(nodeid) + if self.config.option.verbose < -1: + counts = {} + for item in items: + name = item.nodeid.split('::', 1)[0] + counts[name] = counts.get(name, 0) + 1 + for name, count in sorted(counts.items()): + self._tw.line("%s: %d" % (name, count)) + else: + for item in items: + nodeid = item.nodeid + nodeid = nodeid.replace("::()::", "::") + self._tw.line(nodeid) return stack = [] indent = "" diff -r 47ee3480080baeac63d99bf2a67ac8d3f7e5bffd -r bce3fac6a204a0d8c8d9e534056ae5b9013c7150 testing/test_terminal.py --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -267,6 +267,20 @@ '*ERROR: file not found*', ]) + def test_collectonly_quiet(self, testdir): + testdir.makepyfile("def test_foo(): pass") + result = testdir.runpytest("--collectonly", "-q") + result.stdout.fnmatch_lines([ + '*test_foo*', + ]) + + def test_collectonly_more_quiet(self, testdir): + testdir.makepyfile(test_fun="def test_foo(): pass") + result = testdir.runpytest("--collectonly", "-qq") + result.stdout.fnmatch_lines([ + '*test_fun.py: 1*', + ]) + def test_repr_python_version(monkeypatch): try: 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 Fri Feb 3 17:12:02 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Fri, 03 Feb 2012 16:12:02 -0000 Subject: [py-svn] commit/pytest: RonnyPfannschmidt: readd CHANGELOG, since i accidentially killed it with mq Message-ID: <20120203161202.754.74420@bitbucket13.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/changeset/0abb489082fd/ changeset: 0abb489082fd user: RonnyPfannschmidt date: 2012-02-03 17:11:42 summary: readd CHANGELOG, since i accidentially killed it with mq affected #: 1 file diff -r bce3fac6a204a0d8c8d9e534056ae5b9013c7150 -r 0abb489082fd4b6da3554c41c497d5bdbf9a80aa CHANGELOG --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,1016 @@ +Changes between 2.2.1 and 2.2.2.dev +---------------------------------------- + +- make monkeypatch more robust against intermediate dict/env deletions +- use distribute_setup script defaulting to 0.6.24 if no setuptools is installed +- fix issue101: wrong args to unittest.TestCase test function now + produce better output +- fix issue102: report more useful errors and hints for when a + test directory was renamed and some pyc/__pycache__ remain +- fix issue106: allow parametrize to be applied multiple times + e.g. from module, class and at function level. +- fix issue107: actually perform session scope finalization +- add chdir method to monkeypatch funcarg +- fix crash resulting from calling monkeypatch undo a second time +- extend reports accepting kwargs to set arbitrary additional attributes + this helps xdist serialization/deserialization of extended/customized reports +- fix issue115: make --collectonly robust against preparse failure + (missing files/directories) +- more quit collectonly shows only files and the number of tests in them + +Changes between 2.2.0 and 2.2.1 +---------------------------------------- + +- fix issue99 (in pytest and py) internallerrors with resultlog now + produce better output - fixed by normalizing pytest_internalerror + input arguments. +- fix issue97 / traceback issues (in pytest and py) improve traceback output + in conjunction with jinja2 and cython which hack tracebacks +- fix issue93 (in pytest and pytest-xdist) avoid "delayed teardowns": + the final test in a test node will now run its teardown directly + instead of waiting for the end of the session. Thanks Dave Hunt for + the good reporting and feedback. The pytest_runtest_protocol as well + as the pytest_runtest_teardown hooks now have "nextitem" available + which will be None indicating the end of the test run. +- fix collection crash due to unknown-source collected items, thanks + to Ralf Schmitt (fixed by depending on a more recent pylib) + +Changes between 2.1.3 and 2.2.0 +---------------------------------------- + +- fix issue90: introduce eager tearing down of test items so that + teardown function are called earlier. +- add an all-powerful metafunc.parametrize function which allows to + parametrize test function arguments in multiple steps and therefore + from indepdenent plugins and palces. +- add a @pytest.mark.parametrize helper which allows to easily + call a test function with different argument values +- Add examples to the "parametrize" example page, including a quick port + of Test scenarios and the new parametrize function and decorator. +- introduce registration for "pytest.mark.*" helpers via ini-files + or through plugin hooks. Also introduce a "--strict" option which + will treat unregistered markers as errors + allowing to avoid typos and maintain a well described set of markers + for your test suite. See exaples at http://pytest.org/latest/mark.html + and its links. +- issue50: introduce "-m marker" option to select tests based on markers + (this is a stricter and more predictable version of '-k' in that "-m" + only matches complete markers and has more obvious rules for and/or + semantics. +- new feature to help optimizing the speed of your tests: + --durations=N option for displaying N slowest test calls + and setup/teardown methods. +- fix issue87: --pastebin now works with python3 +- fix issue89: --pdb with unexpected exceptions in doctest work more sensibly +- fix and cleanup pytest's own test suite to not leak FDs +- fix issue83: link to generated funcarg list +- fix issue74: pyarg module names are now checked against imp.find_module false positives +- fix compatibility with twisted/trial-11.1.0 use cases +- simplify Node.listchain +- simplify junitxml output code by relying on py.xml +- add support for skip properties on unittest classes and functions + +Changes between 2.1.2 and 2.1.3 +---------------------------------------- + +- fix issue79: assertion rewriting failed on some comparisons in boolops +- correctly handle zero length arguments (a la pytest '') +- fix issue67 / junitxml now contains correct test durations, thanks ronny +- fix issue75 / skipping test failure on jython +- fix issue77 / Allow assertrepr_compare hook to apply to a subset of tests + +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 + +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" + +Changes between 2.0.3 and 2.1.0.DEV +---------------------------------------------- + +- 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 + +Changes between 2.0.2 and 2.0.3 +---------------------------------------------- + +- fix issue38: nicer tracebacks on calls to hooks, particularly early + configure/sessionstart ones + +- fix missing skip reason/meta information in junitxml files, reported + via http://lists.idyll.org/pipermail/testing-in-python/2011-March/003928.html + +- fix issue34: avoid collection failure with "test" prefixed classes + deriving from object. + +- don't require zlib (and other libs) for genscript plugin without + --genscript actually being used. + +- speed up skips (by not doing a full traceback represenation + internally) + +- fix issue37: avoid invalid characters in junitxml's output + +Changes between 2.0.1 and 2.0.2 +---------------------------------------------- + +- tackle issue32 - speed up test runs of very quick test functions + by reducing the relative overhead + +- fix issue30 - extended xfail/skipif handling and improved reporting. + If you have a syntax error in your skip/xfail + expressions you now get nice error reports. + + Also you can now access module globals from xfail/skipif + expressions so that this for example works now:: + + import pytest + import mymodule + @pytest.mark.skipif("mymodule.__version__[0] == "1") + def test_function(): + pass + + This will not run the test function if the module's version string + does not start with a "1". Note that specifying a string instead + of a boolean expressions allows py.test to report meaningful information + when summarizing a test run as to what conditions lead to skipping + (or xfail-ing) tests. + +- fix issue28 - setup_method and pytest_generate_tests work together + The setup_method fixture method now gets called also for + test function invocations generated from the pytest_generate_tests + hook. + +- fix issue27 - collectonly and keyword-selection (-k) now work together + Also, if you do "py.test --collectonly -q" you now get a flat list + of test ids that you can use to paste to the py.test commandline + in order to execute a particular test. + +- fix issue25 avoid reported problems with --pdb and python3.2/encodings output + +- fix issue23 - tmpdir argument now works on Python3.2 and WindowsXP + Starting with Python3.2 os.symlink may be supported. By requiring + a newer py lib version the py.path.local() implementation acknowledges + this. + +- fixed typos in the docs (thanks Victor Garcia, Brianna Laugher) and particular + thanks to Laura Creighton who also revieved parts of the documentation. + +- fix slighly wrong output of verbose progress reporting for classes + (thanks Amaury) + +- more precise (avoiding of) deprecation warnings for node.Class|Function accesses + +- avoid std unittest assertion helper code in tracebacks (thanks Ronny) + +Changes between 2.0.0 and 2.0.1 +---------------------------------------------- + +- refine and unify initial capturing so that it works nicely + even if the logging module is used on an early-loaded conftest.py + file or plugin. +- allow to omit "()" in test ids to allow for uniform test ids + as produced by Alfredo's nice pytest.vim plugin. +- fix issue12 - show plugin versions with "--version" and + "--traceconfig" and also document how to add extra information + to reporting test header +- fix issue17 (import-* reporting issue on python3) by + requiring py>1.4.0 (1.4.1 is going to include it) +- fix issue10 (numpy arrays truth checking) by refining + assertion interpretation in py lib +- fix issue15: make nose compatibility tests compatible + with python3 (now that nose-1.0 supports python3) +- remove somewhat surprising "same-conftest" detection because + it ignores conftest.py when they appear in several subdirs. +- improve assertions ("not in"), thanks Floris Bruynooghe +- improve behaviour/warnings when running on top of "python -OO" + (assertions and docstrings are turned off, leading to potential + false positives) +- introduce a pytest_cmdline_processargs(args) hook + to allow dynamic computation of command line arguments. + This fixes a regression because py.test prior to 2.0 + allowed to set command line options from conftest.py + files which so far pytest-2.0 only allowed from ini-files now. +- fix issue7: assert failures in doctest modules. + unexpected failures in doctests will not generally + show nicer, i.e. within the doctest failing context. +- fix issue9: setup/teardown functions for an xfail-marked + test will report as xfail if they fail but report as normally + passing (not xpassing) if they succeed. This only is true + for "direct" setup/teardown invocations because teardown_class/ + teardown_module cannot closely relate to a single test. +- fix issue14: no logging errors at process exit +- refinements to "collecting" output on non-ttys +- refine internal plugin registration and --traceconfig output +- introduce a mechanism to prevent/unregister plugins from the + command line, see http://pytest.org/plugins.html#cmdunregister +- activate resultlog plugin by default +- fix regression wrt yielded tests which due to the + collection-before-running semantics were not + setup as with pytest 1.3.4. Note, however, that + the recommended and much cleaner way to do test + parametraization remains the "pytest_generate_tests" + mechanism, see the docs. + +Changes between 1.3.4 and 2.0.0 +---------------------------------------------- + +- pytest-2.0 is now its own package and depends on pylib-2.0 +- new ability: python -m pytest / python -m pytest.main ability +- new python invcation: pytest.main(args, plugins) to load + some custom plugins early. +- try harder to run unittest test suites in a more compatible manner + by deferring setup/teardown semantics to the unittest package. + also work harder to run twisted/trial and Django tests which + should now basically work by default. +- introduce a new way to set config options via ini-style files, + by default setup.cfg and tox.ini files are searched. The old + ways (certain environment variables, dynamic conftest.py reading + is removed). +- add a new "-q" option which decreases verbosity and prints a more + nose/unittest-style "dot" output. +- fix issue135 - marks now work with unittest test cases as well +- fix issue126 - introduce py.test.set_trace() to trace execution via + PDB during the running of tests even if capturing is ongoing. +- fix issue123 - new "python -m py.test" invocation for py.test + (requires Python 2.5 or above) +- fix issue124 - make reporting more resilient against tests opening + files on filedescriptor 1 (stdout). +- fix issue109 - sibling conftest.py files will not be loaded. + (and Directory collectors cannot be customized anymore from a Directory's + conftest.py - this needs to happen at least one level up). +- introduce (customizable) assertion failure representations and enhance + output on assertion failures for comparisons and other cases (Floris Bruynooghe) +- nose-plugin: pass through type-signature failures in setup/teardown + functions instead of not calling them (Ed Singleton) +- remove py.test.collect.Directory (follows from a major refactoring + and simplification of the collection process) +- majorly reduce py.test core code, shift function/python testing to own plugin +- fix issue88 (finding custom test nodes from command line arg) +- refine 'tmpdir' creation, will now create basenames better associated + with test names (thanks Ronny) +- "xpass" (unexpected pass) tests don't cause exitcode!=0 +- fix issue131 / issue60 - importing doctests in __init__ files used as namespace packages +- fix issue93 stdout/stderr is captured while importing conftest.py +- fix bug: unittest collected functions now also can have "pytestmark" + applied at class/module level +- add ability to use "class" level for cached_setup helper +- fix strangeness: mark.* objects are now immutable, create new instances + +Changes between 1.3.3 and 1.3.4 +---------------------------------------------- + +- fix issue111: improve install documentation for windows +- fix issue119: fix custom collectability of __init__.py as a module +- fix issue116: --doctestmodules work with __init__.py files as well +- fix issue115: unify internal exception passthrough/catching/GeneratorExit +- fix issue118: new --tb=native for presenting cpython-standard exceptions + +Changes between 1.3.2 and 1.3.3 +---------------------------------------------- + +- fix issue113: assertion representation problem with triple-quoted strings + (and possibly other cases) +- make conftest loading detect that a conftest file with the same + content was already loaded, avoids surprises in nested directory structures + which can be produced e.g. by Hudson. It probably removes the need to use + --confcutdir in most cases. +- fix terminal coloring for win32 + (thanks Michael Foord for reporting) +- fix weirdness: make terminal width detection work on stdout instead of stdin + (thanks Armin Ronacher for reporting) +- remove trailing whitespace in all py/text distribution files + +Changes between 1.3.1 and 1.3.2 +---------------------------------------------- + +New features +++++++++++++++++++ + +- fix issue103: introduce py.test.raises as context manager, examples:: + + with py.test.raises(ZeroDivisionError): + x = 0 + 1 / x + + with py.test.raises(RuntimeError) as excinfo: + call_something() + + # you may do extra checks on excinfo.value|type|traceback here + + (thanks Ronny Pfannschmidt) + +- Funcarg factories can now dynamically apply a marker to a + test invocation. This is for example useful if a factory + provides parameters to a test which are expected-to-fail:: + + def pytest_funcarg__arg(request): + request.applymarker(py.test.mark.xfail(reason="flaky config")) + ... + + def test_function(arg): + ... + +- improved error reporting on collection and import errors. This makes + use of a more general mechanism, namely that for custom test item/collect + nodes ``node.repr_failure(excinfo)`` is now uniformly called so that you can + override it to return a string error representation of your choice + which is going to be reported as a (red) string. + +- introduce '--junitprefix=STR' option to prepend a prefix + to all reports in the junitxml file. + +Bug fixes / Maintenance +++++++++++++++++++++++++++ + +- make tests and the ``pytest_recwarn`` plugin in particular fully compatible + to Python2.7 (if you use the ``recwarn`` funcarg warnings will be enabled so that + you can properly check for their existence in a cross-python manner). +- refine --pdb: ignore xfailed tests, unify its TB-reporting and + don't display failures again at the end. +- fix assertion interpretation with the ** operator (thanks Benjamin Peterson) +- fix issue105 assignment on the same line as a failing assertion (thanks Benjamin Peterson) +- fix issue104 proper escaping for test names in junitxml plugin (thanks anonymous) +- fix issue57 -f|--looponfail to work with xpassing tests (thanks Ronny) +- fix issue92 collectonly reporter and --pastebin (thanks Benjamin Peterson) +- fix py.code.compile(source) to generate unique filenames +- fix assertion re-interp problems on PyPy, by defering code + compilation to the (overridable) Frame.eval class. (thanks Amaury Forgeot) +- fix py.path.local.pyimport() to work with directories +- streamline py.path.local.mkdtemp implementation and usage +- don't print empty lines when showing junitxml-filename +- add optional boolean ignore_errors parameter to py.path.local.remove +- fix terminal writing on win32/python2.4 +- py.process.cmdexec() now tries harder to return properly encoded unicode objects + on all python versions +- install plain py.test/py.which scripts also for Jython, this helps to + get canonical script paths in virtualenv situations +- make path.bestrelpath(path) return ".", note that when calling + X.bestrelpath the assumption is that X is a directory. +- make initial conftest discovery ignore "--" prefixed arguments +- fix resultlog plugin when used in an multicpu/multihost xdist situation + (thanks Jakub Gustak) +- perform distributed testing related reporting in the xdist-plugin + rather than having dist-related code in the generic py.test + distribution +- fix homedir detection on Windows +- ship distribute_setup.py version 0.6.13 + +Changes between 1.3.0 and 1.3.1 +--------------------------------------------- + +New features +++++++++++++++++++ + +- issue91: introduce new py.test.xfail(reason) helper + to imperatively mark a test as expected to fail. Can + be used from within setup and test functions. This is + useful especially for parametrized tests when certain + configurations are expected-to-fail. In this case the + declarative approach with the @py.test.mark.xfail cannot + be used as it would mark all configurations as xfail. + +- 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 + to '--maxfail=1'. Both '-x' and '--maxfail' will + now also print a line near the end indicating the Interruption. + +- issue89: allow py.test.mark decorators to be used on classes + (class decorators were introduced with python2.6) and + also allow to have multiple markers applied at class/module level + by specifying a list. + +- 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 + reporting option. The xfail/xpass results will show up as + skipped tests in the junitxml output - which also fixes + issue99. + +- make py.test.cmdline.main() return the exitstatus instead of raising + SystemExit and also allow it to be called multiple times. This of + course requires that your application and tests are properly teared + down and don't have global state. + +Fixes / Maintenance +++++++++++++++++++++++ + +- improved traceback presentation: + - 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 + - --fulltrace now more systematically makes traces longer / inhibits cutting + +- improve support for raises and other dynamically compiled code by + manipulating python's linecache.cache instead of the previous + rather hacky way of creating custom code objects. This makes + it seemlessly work on Jython and PyPy where it previously didn't. + +- fix issue96: make capturing more resilient against Control-C + interruptions (involved somewhat substantial refactoring + to the underlying capturing functionality to avoid race + conditions). + +- fix chaining of conditional skipif/xfail decorators - so it works now + as expected to use multiple @py.test.mark.skipif(condition) decorators, + including specific reporting which of the conditions lead to skipping. + +- fix issue95: late-import zlib so that it's not required + for general py.test startup. + +- fix issue94: make reporting more robust against bogus source code + (and internally be more careful when presenting unexpected byte sequences) + + +Changes between 1.2.1 and 1.3.0 +--------------------------------------------- + +- deprecate --report option in favour of a new shorter and easier to + remember -r option: it takes a string argument consisting of any + combination of 'xfsX' characters. They relate to the single chars + you see during the dotted progress printing and will print an extra line + per test at the end of the test run. This extra line indicates the exact + position or test ID that you directly paste to the py.test cmdline in order + to re-run a particular test. + +- allow external plugins to register new hooks via the new + pytest_addhooks(pluginmanager) hook. The new release of + the pytest-xdist plugin for distributed and looponfailing + testing requires this feature. + +- add a new pytest_ignore_collect(path, config) hook to allow projects and + plugins to define exclusion behaviour for their directory structure - + for example you may define in a conftest.py this method:: + + def pytest_ignore_collect(path): + return path.check(link=1) + + to prevent even a collection try of any tests in symlinked dirs. + +- new pytest_pycollect_makemodule(path, parent) hook for + allowing customization of the Module collection object for a + matching test module. + +- extend and refine xfail mechanism: + ``@py.test.mark.xfail(run=False)`` do not run the decorated test + ``@py.test.mark.xfail(reason="...")`` prints the reason string in xfail summaries + specifiying ``--runxfail`` on command line virtually ignores xfail markers + +- expose (previously internal) commonly useful methods: + py.io.get_terminal_with() -> return terminal width + py.io.ansi_print(...) -> print colored/bold text on linux/win32 + py.io.saferepr(obj) -> return limited representation string + +- expose test outcome related exceptions as py.test.skip.Exception, + py.test.raises.Exception etc., useful mostly for plugins + doing special outcome interpretation/tweaking + +- (issue85) fix junitxml plugin to handle tests with non-ascii output + +- fix/refine python3 compatibility (thanks Benjamin Peterson) + +- fixes for making the jython/win32 combination work, note however: + jython2.5.1/win32 does not provide a command line launcher, see + http://bugs.jython.org/issue1491 . See pylib install documentation + for how to work around. + +- fixes for handling of unicode exception values and unprintable objects + +- (issue87) fix unboundlocal error in assertionold code + +- (issue86) improve documentation for looponfailing + +- refine IO capturing: stdin-redirect pseudo-file now has a NOP close() method + +- ship distribute_setup.py version 0.6.10 + +- added links to the new capturelog and coverage plugins + + +Changes between 1.2.1 and 1.2.0 +--------------------------------------------- + +- refined usage and options for "py.cleanup":: + + py.cleanup # remove "*.pyc" and "*$py.class" (jython) files + py.cleanup -e .swp -e .cache # also remove files with these extensions + py.cleanup -s # remove "build" and "dist" directory next to setup.py files + py.cleanup -d # also remove empty directories + py.cleanup -a # synonym for "-s -d -e 'pip-log.txt'" + py.cleanup -n # dry run, only show what would be removed + +- add a new option "py.test --funcargs" which shows available funcargs + and their help strings (docstrings on their respective factory function) + for a given test path + +- display a short and concise traceback if a funcarg lookup fails + +- early-load "conftest.py" files in non-dot first-level sub directories. + allows to conveniently keep and access test-related options in a ``test`` + subdir and still add command line options. + +- fix issue67: new super-short traceback-printing option: "--tb=line" will print a single line for each failing (python) test indicating its filename, lineno and the failure value + +- fix issue78: always call python-level teardown functions even if the + according setup failed. This includes refinements for calling setup_module/class functions + which will now only be called once instead of the previous behaviour where they'd be called + multiple times if they raise an exception (including a Skipped exception). Any exception + will be re-corded and associated with all tests in the according module/class scope. + +- fix issue63: assume <40 columns to be a bogus terminal width, default to 80 + +- fix pdb debugging to be in the correct frame on raises-related errors + +- update apipkg.py to fix an issue where recursive imports might + unnecessarily break importing + +- fix plugin links + +Changes between 1.2 and 1.1.1 +--------------------------------------------- + +- moved dist/looponfailing from py.test core into a new + separately released pytest-xdist plugin. + +- new junitxml plugin: --junitxml=path will generate a junit style xml file + which is processable e.g. by the Hudson CI system. + +- new option: --genscript=path will generate a standalone py.test script + which will not need any libraries installed. thanks to Ralf Schmitt. + +- new option: --ignore will prevent specified path from collection. + Can be specified multiple times. + +- new option: --confcutdir=dir will make py.test only consider conftest + files that are relative to the specified dir. + +- new funcarg: "pytestconfig" is the pytest config object for access + to command line args and can now be easily used in a test. + +- install 'py.test' and `py.which` with a ``-$VERSION`` suffix to + disambiguate between Python3, python2.X, Jython and PyPy installed versions. + +- new "pytestconfig" funcarg allows access to test config object + +- new "pytest_report_header" hook can return additional lines + to be displayed at the header of a test run. + +- (experimental) allow "py.test path::name1::name2::..." for pointing + to a test within a test collection directly. This might eventually + evolve as a full substitute to "-k" specifications. + +- streamlined plugin loading: order is now as documented in + customize.html: setuptools, ENV, commandline, conftest. + also setuptools entry point names are turned to canonical namees ("pytest_*") + +- automatically skip tests that need 'capfd' but have no os.dup + +- allow pytest_generate_tests to be defined in classes as well + +- deprecate usage of 'disabled' attribute in favour of pytestmark +- deprecate definition of Directory, Module, Class and Function nodes + in conftest.py files. Use pytest collect hooks instead. + +- collection/item node specific runtest/collect hooks are only called exactly + on matching conftest.py files, i.e. ones which are exactly below + the filesystem path of an item + +- change: the first pytest_collect_directory hook to return something + will now prevent further hooks to be called. + +- change: figleaf plugin now requires --figleaf to run. Also + change its long command line options to be a bit shorter (see py.test -h). + +- change: pytest doctest plugin is now enabled by default and has a + new option --doctest-glob to set a pattern for file matches. + +- change: remove internal py._* helper vars, only keep py._pydir + +- robustify capturing to survive if custom pytest_runtest_setup + code failed and prevented the capturing setup code from running. + +- make py.test.* helpers provided by default plugins visible early - + works transparently both for pydoc and for interactive sessions + which will regularly see e.g. py.test.mark and py.test.importorskip. + +- simplify internal plugin manager machinery +- simplify internal collection tree by introducing a RootCollector node + +- fix assert reinterpreation that sees a call containing "keyword=..." + +- fix issue66: invoke pytest_sessionstart and pytest_sessionfinish + hooks on slaves during dist-testing, report module/session teardown + hooks correctly. + +- fix issue65: properly handle dist-testing if no + execnet/py lib installed remotely. + +- skip some install-tests if no execnet is available + +- fix docs, fix internal bin/ script generation + + +Changes between 1.1.1 and 1.1.0 +--------------------------------------------- + +- introduce automatic plugin registration via 'pytest11' + entrypoints via setuptools' pkg_resources.iter_entry_points + +- fix py.test dist-testing to work with execnet >= 1.0.0b4 + +- re-introduce py.test.cmdline.main() for better backward compatibility + +- svn paths: fix a bug with path.check(versioned=True) for svn paths, + allow '%' in svn paths, make svnwc.update() default to interactive mode + like in 1.0.x and add svnwc.update(interactive=False) to inhibit interaction. + +- refine distributed tarball to contain test and no pyc files + +- try harder to have deprecation warnings for py.compat.* accesses + report a correct location + +Changes between 1.1.0 and 1.0.2 +--------------------------------------------- + +* adjust and improve docs + +* remove py.rest tool and internal namespace - it was + never really advertised and can still be used with + the old release if needed. If there is interest + it could be revived into its own tool i guess. + +* fix issue48 and issue59: raise an Error if the module + from an imported test file does not seem to come from + the filepath - avoids "same-name" confusion that has + been reported repeatedly + +* merged Ronny's nose-compatibility hacks: now + nose-style setup_module() and setup() functions are + supported + +* introduce generalized py.test.mark function marking + +* reshuffle / refine command line grouping + +* deprecate parser.addgroup in favour of getgroup which creates option group + +* add --report command line option that allows to control showing of skipped/xfailed sections + +* generalized skipping: a new way to mark python functions with skipif or xfail + at function, class and modules level based on platform or sys-module attributes. + +* extend py.test.mark decorator to allow for positional args + +* introduce and test "py.cleanup -d" to remove empty directories + +* fix issue #59 - robustify unittest test collection + +* make bpython/help interaction work by adding an __all__ attribute + to ApiModule, cleanup initpkg + +* use MIT license for pylib, add some contributors + +* remove py.execnet code and substitute all usages with 'execnet' proper + +* fix issue50 - cached_setup now caches more to expectations + for test functions with multiple arguments. + +* merge Jarko's fixes, issue #45 and #46 + +* add the ability to specify a path for py.lookup to search in + +* fix a funcarg cached_setup bug probably only occuring + in distributed testing and "module" scope with teardown. + +* many fixes and changes for making the code base python3 compatible, + many thanks to Benjamin Peterson for helping with this. + +* consolidate builtins implementation to be compatible with >=2.3, + add helpers to ease keeping 2 and 3k compatible code + +* deprecate py.compat.doctest|subprocess|textwrap|optparse + +* deprecate py.magic.autopath, remove py/magic directory + +* move pytest assertion handling to py/code and a pytest_assertion + plugin, add "--no-assert" option, deprecate py.magic namespaces + in favour of (less) py.code ones. + +* consolidate and cleanup py/code classes and files + +* cleanup py/misc, move tests to bin-for-dist + +* introduce delattr/delitem/delenv methods to py.test's monkeypatch funcarg + +* consolidate py.log implementation, remove old approach. + +* introduce py.io.TextIO and py.io.BytesIO for distinguishing between + text/unicode and byte-streams (uses underlying standard lib io.* + if available) + +* make py.unittest_convert helper script available which converts "unittest.py" + style files into the simpler assert/direct-test-classes py.test/nosetests + style. The script was written by Laura Creighton. + +* simplified internal localpath implementation + +Changes between 1.0.1 and 1.0.2 +------------------------------------------- + +* fixing packaging issues, triggered by fedora redhat packaging, + also added doc, examples and contrib dirs to the tarball. + +* added a documentation link to the new django plugin. + +Changes between 1.0.0 and 1.0.1 +------------------------------------------- + +* added a 'pytest_nose' plugin which handles nose.SkipTest, + nose-style function/method/generator setup/teardown and + tries to report functions correctly. + +* capturing of unicode writes or encoded strings to sys.stdout/err + work better, also terminalwriting was adapted and somewhat + unified between windows and linux. + +* improved documentation layout and content a lot + +* added a "--help-config" option to show conftest.py / ENV-var names for + all longopt cmdline options, and some special conftest.py variables. + renamed 'conf_capture' conftest setting to 'option_capture' accordingly. + +* fix issue #27: better reporting on non-collectable items given on commandline + (e.g. pyc files) + +* fix issue #33: added --version flag (thanks Benjamin Peterson) + +* fix issue #32: adding support for "incomplete" paths to wcpath.status() + +* "Test" prefixed classes are *not* collected by default anymore if they + have an __init__ method + +* monkeypatch setenv() now accepts a "prepend" parameter + +* improved reporting of collection error tracebacks + +* simplified multicall mechanism and plugin architecture, + renamed some internal methods and argnames + +Changes between 1.0.0b9 and 1.0.0 +------------------------------------------- + +* more terse reporting try to show filesystem path relatively to current dir +* improve xfail output a bit + +Changes between 1.0.0b8 and 1.0.0b9 +------------------------------------------- + +* cleanly handle and report final teardown of test setup + +* fix svn-1.6 compat issue with py.path.svnwc().versioned() + (thanks Wouter Vanden Hove) + +* setup/teardown or collection problems now show as ERRORs + or with big "E"'s in the progress lines. they are reported + and counted separately. + +* dist-testing: properly handle test items that get locally + collected but cannot be collected on the remote side - often + due to platform/dependency reasons + +* simplified py.test.mark API - see keyword plugin documentation + +* integrate better with logging: capturing now by default captures + test functions and their immediate setup/teardown in a single stream + +* capsys and capfd funcargs now have a readouterr() and a close() method + (underlyingly py.io.StdCapture/FD objects are used which grew a + readouterr() method as well to return snapshots of captured out/err) + +* make assert-reinterpretation work better with comparisons not + returning bools (reported with numpy from thanks maciej fijalkowski) + +* reworked per-test output capturing into the pytest_iocapture.py plugin + and thus removed capturing code from config object + +* item.repr_failure(excinfo) instead of item.repr_failure(excinfo, outerr) + + +Changes between 1.0.0b7 and 1.0.0b8 +------------------------------------------- + +* pytest_unittest-plugin is now enabled by default + +* introduced pytest_keyboardinterrupt hook and + refined pytest_sessionfinish hooked, added tests. + +* workaround a buggy logging module interaction ("closing already closed + files"). Thanks to Sridhar Ratnakumar for triggering. + +* if plugins use "py.test.importorskip" for importing + a dependency only a warning will be issued instead + of exiting the testing process. + +* many improvements to docs: + - refined funcargs doc , use the term "factory" instead of "provider" + - added a new talk/tutorial doc page + - better download page + - better plugin docstrings + - added new plugins page and automatic doc generation script + +* fixed teardown problem related to partially failing funcarg setups + (thanks MrTopf for reporting), "pytest_runtest_teardown" is now + always invoked even if the "pytest_runtest_setup" failed. + +* tweaked doctest output for docstrings in py modules, + thanks Radomir. + +Changes between 1.0.0b3 and 1.0.0b7 +------------------------------------------- + +* renamed py.test.xfail back to py.test.mark.xfail to avoid + two ways to decorate for xfail + +* re-added py.test.mark decorator for setting keywords on functions + (it was actually documented so removing it was not nice) + +* remove scope-argument from request.addfinalizer() because + request.cached_setup has the scope arg. TOOWTDI. + +* perform setup finalization before reporting failures + +* apply modified patches from Andreas Kloeckner to allow + test functions to have no func_code (#22) and to make + "-k" and function keywords work (#20) + +* apply patch from Daniel Peolzleithner (issue #23) + +* resolve issue #18, multiprocessing.Manager() and + redirection clash + +* make __name__ == "__channelexec__" for remote_exec code + +Changes between 1.0.0b1 and 1.0.0b3 +------------------------------------------- + +* plugin classes are removed: one now defines + hooks directly in conftest.py or global pytest_*.py + files. + +* added new pytest_namespace(config) hook that allows + to inject helpers directly to the py.test.* namespace. + +* documented and refined many hooks + +* added new style of generative tests via + pytest_generate_tests hook that integrates + well with function arguments. + + +Changes between 0.9.2 and 1.0.0b1 +------------------------------------------- + +* introduced new "funcarg" setup method, + see doc/test/funcarg.txt + +* introduced plugin architecuture and many + new py.test plugins, see + doc/test/plugins.txt + +* teardown_method is now guaranteed to get + called after a test method has run. + +* new method: py.test.importorskip(mod,minversion) + will either import or call py.test.skip() + +* completely revised internal py.test architecture + +* new py.process.ForkedFunc object allowing to + fork execution of a function to a sub process + and getting a result back. + +XXX lots of things missing here XXX + +Changes between 0.9.1 and 0.9.2 +------------------------------------------- + +* refined installation and metadata, created new setup.py, + now based on setuptools/ez_setup (thanks to Ralf Schmitt + for his support). + +* improved the way of making py.* scripts available in + windows environments, they are now added to the + Scripts directory as ".cmd" files. + +* py.path.svnwc.status() now is more complete and + uses xml output from the 'svn' command if available + (Guido Wesdorp) + +* fix for py.path.svn* to work with svn 1.5 + (Chris Lamb) + +* fix path.relto(otherpath) method on windows to + use normcase for checking if a path is relative. + +* py.test's traceback is better parseable from editors + (follows the filenames:LINENO: MSG convention) + (thanks to Osmo Salomaa) + +* fix to javascript-generation, "py.test --runbrowser" + should work more reliably now + +* removed previously accidentally added + py.test.broken and py.test.notimplemented helpers. + +* there now is a py.__version__ attribute + +Changes between 0.9.0 and 0.9.1 +------------------------------------------- + +This is a fairly complete list of changes between 0.9 and 0.9.1, which can +serve as a reference for developers. + +* allowing + signs in py.path.svn urls [39106] +* fixed support for Failed exceptions without excinfo in py.test [39340] +* added support for killing processes for Windows (as well as platforms that + support os.kill) in py.misc.killproc [39655] +* added setup/teardown for generative tests to py.test [40702] +* added detection of FAILED TO LOAD MODULE to py.test [40703, 40738, 40739] +* fixed problem with calling .remove() on wcpaths of non-versioned files in + py.path [44248] +* fixed some import and inheritance issues in py.test [41480, 44648, 44655] +* fail to run greenlet tests when pypy is available, but without stackless + [45294] +* small fixes in rsession tests [45295] +* fixed issue with 2.5 type representations in py.test [45483, 45484] +* made that internal reporting issues displaying is done atomically in py.test + [45518] +* made that non-existing files are igored by the py.lookup script [45519] +* improved exception name creation in py.test [45535] +* made that less threads are used in execnet [merge in 45539] +* removed lock required for atomical reporting issue displaying in py.test + [45545] +* removed globals from execnet [45541, 45547] +* refactored cleanup mechanics, made that setDaemon is set to 1 to make atexit + get called in 2.5 (py.execnet) [45548] +* fixed bug in joining threads in py.execnet's servemain [45549] +* refactored py.test.rsession tests to not rely on exact output format anymore + [45646] +* using repr() on test outcome [45647] +* added 'Reason' classes for py.test.skip() [45648, 45649] +* killed some unnecessary sanity check in py.test.collect [45655] +* avoid using os.tmpfile() in py.io.fdcapture because on Windows it's only + usable by Administrators [45901] +* added support for locking and non-recursive commits to py.path.svnwc [45994] +* locking files in py.execnet to prevent CPython from segfaulting [46010] +* added export() method to py.path.svnurl +* fixed -d -x in py.test [47277] +* fixed argument concatenation problem in py.path.svnwc [49423] +* restore py.test behaviour that it exits with code 1 when there are failures + [49974] +* don't fail on html files that don't have an accompanying .txt file [50606] +* fixed 'utestconvert.py < input' [50645] +* small fix for code indentation in py.code.source [50755] +* fix _docgen.py documentation building [51285] +* improved checks for source representation of code blocks in py.test [51292] +* added support for passing authentication to py.path.svn* objects [52000, + 52001] +* removed sorted() call for py.apigen tests in favour of [].sort() to support + Python 2.3 [52481] 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 Fri Feb 3 17:15:52 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Fri, 03 Feb 2012 16:15:52 -0000 Subject: [py-svn] commit/pytest: RonnyPfannschmidt: no longer check if indirect metafunc.parametrize params are funcarg names Message-ID: <20120203161552.6355.78101@bitbucket02.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/changeset/c60327d4ed28/ changeset: c60327d4ed28 user: RonnyPfannschmidt date: 2012-02-03 16:54:00 summary: no longer check if indirect metafunc.parametrize params are funcarg names affected #: 3 files diff -r 0abb489082fd4b6da3554c41c497d5bdbf9a80aa -r c60327d4ed285d589d8c0b7dfcf7b1f19b40aa63 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ - fix issue106: allow parametrize to be applied multiple times e.g. from module, class and at function level. - fix issue107: actually perform session scope finalization +- don't check in parametrize if indirect parameters are funcarg names - add chdir method to monkeypatch funcarg - fix crash resulting from calling monkeypatch undo a second time - extend reports accepting kwargs to set arbitrary additional attributes diff -r 0abb489082fd4b6da3554c41c497d5bdbf9a80aa -r c60327d4ed285d589d8c0b7dfcf7b1f19b40aa63 _pytest/python.py --- a/_pytest/python.py +++ b/_pytest/python.py @@ -629,9 +629,11 @@ if not isinstance(argnames, (tuple, list)): argnames = (argnames,) argvalues = [(val,) for val in argvalues] - for arg in argnames: - if arg not in self.funcargnames: - raise ValueError("%r has no argument %r" %(self.function, arg)) + if not indirect: + #XXX should we also check for the opposite case? + for arg in argnames: + if arg not in self.funcargnames: + raise ValueError("%r has no argument %r" %(self.function, arg)) valtype = indirect and "params" or "funcargs" if not ids: idmaker = IDMaker() diff -r 0abb489082fd4b6da3554c41c497d5bdbf9a80aa -r c60327d4ed285d589d8c0b7dfcf7b1f19b40aa63 testing/test_python.py --- a/testing/test_python.py +++ b/testing/test_python.py @@ -983,11 +983,12 @@ metafunc = funcargs.Metafunc(func) metafunc.parametrize('x', [1], indirect=True) metafunc.parametrize('y', [2,3], indirect=True) + metafunc.parametrize('unnamed', [1], indirect=True) assert len(metafunc._calls) == 2 assert metafunc._calls[0].funcargs == {} assert metafunc._calls[1].funcargs == {} - assert metafunc._calls[0].params == dict(x=1,y=2) - assert metafunc._calls[1].params == dict(x=1,y=3) + assert metafunc._calls[0].params == dict(x=1,y=2, unnamed=1) + assert metafunc._calls[1].params == dict(x=1,y=3, unnamed=1) def test_addcalls_and_parametrize_indirect(self): def func(x, y): pass 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 Feb 5 23:38:24 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Sun, 05 Feb 2012 22:38:24 -0000 Subject: [py-svn] commit/pytest: hpk42: preparing release 2.2.2 Message-ID: <20120205223824.27794.67702@bitbucket05.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/changeset/ebc6d7afeb7e/ changeset: ebc6d7afeb7e user: hpk42 date: 2012-02-05 23:32:01 summary: preparing release 2.2.2 affected #: 5 files diff -r c60327d4ed285d589d8c0b7dfcf7b1f19b40aa63 -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,6 @@ -Changes between 2.2.1 and 2.2.2.dev +Changes between 2.2.1 and 2.2.2 ---------------------------------------- -- make monkeypatch more robust against intermediate dict/env deletions -- use distribute_setup script defaulting to 0.6.24 if no setuptools is installed - fix issue101: wrong args to unittest.TestCase test function now produce better output - fix issue102: report more useful errors and hints for when a @@ -13,11 +11,12 @@ - don't check in parametrize if indirect parameters are funcarg names - add chdir method to monkeypatch funcarg - fix crash resulting from calling monkeypatch undo a second time -- extend reports accepting kwargs to set arbitrary additional attributes - this helps xdist serialization/deserialization of extended/customized reports -- fix issue115: make --collectonly robust against preparse failure +- fix issue115: make --collectonly robust against early failure (missing files/directories) -- more quit collectonly shows only files and the number of tests in them +- "-qq --collectonly" now shows only files and the number of tests in them +- "-q --collectonly" now shows test ids +- allow adding of attributes to test reports such that it also works + with distributed testing (no upgrade of pytest-xdist needed) Changes between 2.2.0 and 2.2.1 ---------------------------------------- diff -r c60327d4ed285d589d8c0b7dfcf7b1f19b40aa63 -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.2.2.dev7' +__version__ = '2.2.2' diff -r c60327d4ed285d589d8c0b7dfcf7b1f19b40aa63 -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 doc/announce/index.txt --- a/doc/announce/index.txt +++ b/doc/announce/index.txt @@ -5,6 +5,7 @@ .. toctree:: :maxdepth: 2 + release-2.2.2 release-2.2.1 release-2.2.0 release-2.1.3 diff -r c60327d4ed285d589d8c0b7dfcf7b1f19b40aa63 -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 doc/announce/release-2.2.2.txt --- /dev/null +++ b/doc/announce/release-2.2.2.txt @@ -0,0 +1,42 @@ +pytest-2.2.2: bug fixes +=========================================================================== + +pytest-2.2.2 is a minor backward-compatible release of the versatile py.test +testing tool. It contains bug fixes and a few refinements particularly +to reporting with "--collectonly", see below for betails. + +For general information see here: + + http://pytest.org/ + +To install or upgrade pytest: + + pip install -U pytest # or + easy_install -U pytest + +Special thanks for helping on this release to Ronny Pfannschmidt +and Ralf Schmitt and the contributors of issues. + +best, +holger krekel + + +Changes between 2.2.1 and 2.2.2 +---------------------------------------- + +- fix issue101: wrong args to unittest.TestCase test function now + produce better output +- fix issue102: report more useful errors and hints for when a + test directory was renamed and some pyc/__pycache__ remain +- fix issue106: allow parametrize to be applied multiple times + e.g. from module, class and at function level. +- fix issue107: actually perform session scope finalization +- don't check in parametrize if indirect parameters are funcarg names +- add chdir method to monkeypatch funcarg +- fix crash resulting from calling monkeypatch undo a second time +- fix issue115: make --collectonly robust against early failure + (missing files/directories) +- "-qq --collectonly" now shows only files and the number of tests in them +- "-q --collectonly" now shows test ids +- allow adding of attributes to test reports such that it also works + with distributed testing (no upgrade of pytest-xdist needed) diff -r c60327d4ed285d589d8c0b7dfcf7b1f19b40aa63 -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 setup.py --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.2.2.dev7', + version='2.2.2', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Mon Feb 6 00:33:42 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Sun, 05 Feb 2012 23:33:42 -0000 Subject: [py-svn] commit/pytest: hpk42: regen docs / examples for 2.2.2 Message-ID: <20120205233342.11928.9425@bitbucket01.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/changeset/92b916483c1e/ changeset: 92b916483c1e user: hpk42 date: 2012-02-06 00:33:04 summary: regen docs / examples for 2.2.2 affected #: 16 files diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/assert.txt --- a/doc/assert.txt +++ b/doc/assert.txt @@ -23,7 +23,7 @@ $ py.test test_assert1.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 1 items test_assert1.py F @@ -105,7 +105,7 @@ $ py.test test_assert2.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 1 items test_assert2.py F @@ -124,7 +124,7 @@ E '5' test_assert2.py:5: AssertionError - ========================= 1 failed in 0.02 seconds ========================= + ========================= 1 failed in 0.03 seconds ========================= Special comparisons are done for a number of cases: diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/builtin.txt --- a/doc/builtin.txt +++ b/doc/builtin.txt @@ -28,7 +28,7 @@ $ py.test --funcargs =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collected 0 items pytestconfig the pytest config object with access to command line opts. @@ -60,6 +60,7 @@ monkeypatch.setenv(name, value, prepend=False) monkeypatch.delenv(name, value, raising=True) monkeypatch.syspath_prepend(path) + monkeypatch.chdir(path) All modifications will be undone after the requesting test function has finished. The ``raising`` @@ -75,5 +76,7 @@ See http://docs.python.org/library/warnings.html for information on warning categories. + cov + A pytest funcarg that provides access to the underlying coverage object. - ============================= in 0.00 seconds ============================= + ============================= in 0.01 seconds ============================= diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/capture.txt --- a/doc/capture.txt +++ b/doc/capture.txt @@ -64,7 +64,7 @@ $ py.test =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 2 items test_module.py .F @@ -78,7 +78,7 @@ test_module.py:9: AssertionError ----------------------------- Captured stdout ------------------------------ - setting up + setting up ==================== 1 failed, 1 passed in 0.03 seconds ==================== Accessing captured output from a test function diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/doctest.txt --- a/doc/doctest.txt +++ b/doc/doctest.txt @@ -44,10 +44,10 @@ $ py.test =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 1 items mymodule.py . - ========================= 1 passed in 0.05 seconds ========================= + ========================= 1 passed in 0.51 seconds ========================= [?1034h \ No newline at end of file diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/example/markers.txt --- a/doc/example/markers.txt +++ b/doc/example/markers.txt @@ -25,26 +25,26 @@ You can then restrict a test run to only run tests marked with ``webtest``:: $ py.test -v -m webtest - ============================= test session starts ============================== - platform darwin -- Python 2.7.1 -- pytest-2.2.2.dev3 -- /Users/hpk/venv/1/bin/python + =========================== test session starts ============================ + platform darwin -- Python 2.7.1 -- pytest-2.2.2 -- /Users/hpk/venv/0/bin/python collecting ... collected 2 items test_server.py:3: test_send_http PASSED - ===================== 1 tests deselected by "-m 'webtest'" ===================== - ==================== 1 passed, 1 deselected in 0.03 seconds ==================== + =================== 1 tests deselected by "-m 'webtest'" =================== + ================== 1 passed, 1 deselected in 0.01 seconds ================== Or the inverse, running all tests except the webtest ones:: $ py.test -v -m "not webtest" - ============================= test session starts ============================== - platform darwin -- Python 2.7.1 -- pytest-2.2.2.dev3 -- /Users/hpk/venv/1/bin/python + =========================== test session starts ============================ + platform darwin -- Python 2.7.1 -- pytest-2.2.2 -- /Users/hpk/venv/0/bin/python collecting ... collected 2 items test_server.py:6: test_something_quick PASSED - =================== 1 tests deselected by "-m 'not webtest'" =================== - ==================== 1 passed, 1 deselected in 0.03 seconds ==================== + ================= 1 tests deselected by "-m 'not webtest'" ================= + ================== 1 passed, 1 deselected in 0.02 seconds ================== Registering markers ------------------------------------- @@ -142,39 +142,39 @@ the given argument:: $ py.test -k send_http # running with the above defined examples - ============================= test session starts ============================== - platform darwin -- Python 2.7.1 -- pytest-2.2.2.dev3 + =========================== test session starts ============================ + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 4 items test_server.py . - ===================== 3 tests deselected by '-ksend_http' ====================== - ==================== 1 passed, 3 deselected in 0.06 seconds ==================== + =================== 3 tests deselected by '-ksend_http' ==================== + ================== 1 passed, 3 deselected in 0.02 seconds ================== And you can also run all tests except the ones that match the keyword:: $ py.test -k-send_http - ============================= test session starts ============================== - platform darwin -- Python 2.7.1 -- pytest-2.2.2.dev3 + =========================== test session starts ============================ + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 4 items test_mark_classlevel.py .. test_server.py . - ===================== 1 tests deselected by '-k-send_http' ===================== - ==================== 3 passed, 1 deselected in 0.05 seconds ==================== + =================== 1 tests deselected by '-k-send_http' =================== + ================== 3 passed, 1 deselected in 0.03 seconds ================== Or to only select the class:: $ py.test -kTestClass - ============================= test session starts ============================== - platform darwin -- Python 2.7.1 -- pytest-2.2.2.dev3 + =========================== test session starts ============================ + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 4 items test_mark_classlevel.py .. - ===================== 2 tests deselected by '-kTestClass' ====================== - ==================== 2 passed, 2 deselected in 0.04 seconds ==================== + =================== 2 tests deselected by '-kTestClass' ==================== + ================== 2 passed, 2 deselected in 0.03 seconds ================== .. _`adding a custom marker from a plugin`: @@ -222,24 +222,24 @@ the test needs:: $ py.test -E stage2 - ============================= test session starts ============================== - platform darwin -- Python 2.7.1 -- pytest-2.2.2.dev3 + =========================== test session starts ============================ + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 1 items test_someenv.py s - ========================== 1 skipped in 0.03 seconds =========================== + ======================== 1 skipped in 0.02 seconds ========================= and here is one that specifies exactly the environment needed:: $ py.test -E stage1 - ============================= test session starts ============================== - platform darwin -- Python 2.7.1 -- pytest-2.2.2.dev3 + =========================== test session starts ============================ + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 1 items test_someenv.py . - =========================== 1 passed in 0.03 seconds =========================== + ========================= 1 passed in 0.02 seconds ========================= The ``--markers`` option always gives you a list of available markers:: @@ -291,7 +291,7 @@ $ py.test -q -s collecting ... collected 2 items .. - 2 passed in 0.04 seconds + 2 passed in 0.02 seconds glob args=('function',) kwargs={'x': 3} + glob args=('class',) kwargs={'x': 2} glob args=('module',) kwargs={'x': 1} - glob args=('class',) kwargs={'x': 2} diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/example/mysetup.txt --- a/doc/example/mysetup.txt +++ b/doc/example/mysetup.txt @@ -49,7 +49,7 @@ $ py.test test_sample.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 1 items test_sample.py F @@ -57,7 +57,7 @@ ================================= FAILURES ================================= _______________________________ test_answer ________________________________ - mysetup = + mysetup = def test_answer(mysetup): app = mysetup.myapp() @@ -66,7 +66,7 @@ E assert 54 == 42 test_sample.py:4: AssertionError - ========================= 1 failed in 0.02 seconds ========================= + ========================= 1 failed in 0.72 seconds ========================= This means that our ``mysetup`` object was successfully instantiated and ``mysetup.app()`` returned an initialized ``MyApp`` instance. @@ -122,12 +122,12 @@ $ py.test test_ssh.py -rs =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 1 items test_ssh.py s ========================= short test summary info ========================== - SKIP [1] /Users/hpk/tmp/doc-exec-44/conftest.py:22: specify ssh host with --ssh + SKIP [1] /Users/hpk/tmp/doc-exec-153/conftest.py:22: specify ssh host with --ssh ======================== 1 skipped in 0.02 seconds ========================= diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/example/nonpython.txt --- a/doc/example/nonpython.txt +++ b/doc/example/nonpython.txt @@ -27,7 +27,7 @@ nonpython $ py.test test_simple.yml =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 2 items test_simple.yml .F @@ -37,7 +37,7 @@ usecase execution failed spec failed: 'some': 'other' no further details known at this point. - ==================== 1 failed, 1 passed in 0.09 seconds ==================== + ==================== 1 failed, 1 passed in 0.48 seconds ==================== You get one dot for the passing ``sub1: sub1`` check and one failure. Obviously in the above ``conftest.py`` you'll want to implement a more @@ -56,7 +56,7 @@ nonpython $ py.test -v =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 -- /Users/hpk/venv/1/bin/python + platform darwin -- Python 2.7.1 -- pytest-2.2.2 -- /Users/hpk/venv/0/bin/python collecting ... collected 2 items test_simple.yml:1: usecase: ok PASSED @@ -67,17 +67,17 @@ usecase execution failed spec failed: 'some': 'other' no further details known at this point. - ==================== 1 failed, 1 passed in 0.09 seconds ==================== + ==================== 1 failed, 1 passed in 0.10 seconds ==================== While developing your custom test collection and execution it's also interesting to just look at the collection tree:: nonpython $ py.test --collectonly =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 2 items - ============================= in 0.08 seconds ============================= + ============================= in 0.18 seconds ============================= diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/example/parametrize.txt --- a/doc/example/parametrize.txt +++ b/doc/example/parametrize.txt @@ -96,7 +96,7 @@ $ py.test -q test_compute.py collecting ... collected 2 items .. - 2 passed in 0.02 seconds + 2 passed in 0.03 seconds We run only two computations, so we see two dots. let's run the full monty:: @@ -114,7 +114,7 @@ E assert 4 < 4 test_compute.py:3: AssertionError - 1 failed, 4 passed in 0.03 seconds + 1 failed, 4 passed in 0.05 seconds As expected when running the full range of ``param1`` values we'll get an error on the last one. @@ -154,7 +154,7 @@ $ py.test test_scenarios.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 2 items test_scenarios.py .. @@ -166,7 +166,7 @@ $ py.test --collectonly test_scenarios.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 2 items @@ -174,7 +174,7 @@ - ============================= in 0.01 seconds ============================= + ============================= in 0.05 seconds ============================= Deferring the setup of parametrized resources --------------------------------------------------- @@ -222,7 +222,7 @@ $ py.test test_backends.py --collectonly =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 2 items @@ -238,7 +238,7 @@ ================================= FAILURES ================================= _________________________ test_db_initialized[d2] __________________________ - db = + db = def test_db_initialized(db): # a dummy test @@ -247,7 +247,7 @@ E Failed: deliberately failing for demo purposes test_backends.py:6: Failed - 1 failed, 1 passed in 0.02 seconds + 1 failed, 1 passed in 0.03 seconds The first invocation with ``db == "DB1"`` passed while the second with ``db == "DB2"`` failed. Our ``pytest_funcarg__db`` factory has instantiated each of the DB values during the setup phase while the ``pytest_generate_tests`` generated two according calls to the ``test_db_initialized`` during the collection phase. @@ -295,7 +295,7 @@ ================================= FAILURES ================================= ________________________ TestClass.test_equals[1-2] ________________________ - self = , a = 1, b = 2 + self = , a = 1, b = 2 def test_equals(self, a, b): > assert a == b @@ -326,4 +326,4 @@ ========================= short test summary info ========================== SKIP [24] /Users/hpk/p/pytest/doc/example/multipython.py:36: 'python2.8' not found SKIP [24] /Users/hpk/p/pytest/doc/example/multipython.py:36: 'python2.4' not found - 27 passed, 48 skipped in 3.01 seconds + 27 passed, 48 skipped in 7.76 seconds diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/example/pythoncollection.txt --- a/doc/example/pythoncollection.txt +++ b/doc/example/pythoncollection.txt @@ -43,7 +43,7 @@ $ py.test --collectonly =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 2 items @@ -82,7 +82,7 @@ . $ py.test --collectonly pythoncollection.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 3 items diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/example/reportingdemo.txt --- a/doc/example/reportingdemo.txt +++ b/doc/example/reportingdemo.txt @@ -13,7 +13,7 @@ assertion $ py.test failure_demo.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 39 items failure_demo.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF @@ -30,7 +30,7 @@ failure_demo.py:15: AssertionError _________________________ TestFailing.test_simple __________________________ - self = + self = def test_simple(self): def f(): @@ -40,13 +40,13 @@ > assert f() == g() E assert 42 == 43 - E + where 42 = () - E + and 43 = () + E + where 42 = () + E + and 43 = () failure_demo.py:28: AssertionError ____________________ TestFailing.test_simple_multiline _____________________ - self = + self = def test_simple_multiline(self): otherfunc_multi( @@ -66,19 +66,19 @@ failure_demo.py:11: AssertionError ___________________________ TestFailing.test_not ___________________________ - self = + self = def test_not(self): def f(): return 42 > assert not f() E assert not 42 - E + where 42 = () + E + where 42 = () failure_demo.py:38: AssertionError _________________ TestSpecialisedExplanations.test_eq_text _________________ - self = + self = def test_eq_text(self): > assert 'spam' == 'eggs' @@ -89,7 +89,7 @@ failure_demo.py:42: AssertionError _____________ TestSpecialisedExplanations.test_eq_similar_text _____________ - self = + self = def test_eq_similar_text(self): > assert 'foo 1 bar' == 'foo 2 bar' @@ -102,7 +102,7 @@ failure_demo.py:45: AssertionError ____________ TestSpecialisedExplanations.test_eq_multiline_text ____________ - self = + self = def test_eq_multiline_text(self): > assert 'foo\nspam\nbar' == 'foo\neggs\nbar' @@ -115,7 +115,7 @@ failure_demo.py:48: AssertionError ______________ TestSpecialisedExplanations.test_eq_long_text _______________ - self = + self = def test_eq_long_text(self): a = '1'*100 + 'a' + '2'*100 @@ -132,7 +132,7 @@ failure_demo.py:53: AssertionError _________ TestSpecialisedExplanations.test_eq_long_text_multiline __________ - self = + self = def test_eq_long_text_multiline(self): a = '1\n'*100 + 'a' + '2\n'*100 @@ -156,7 +156,7 @@ failure_demo.py:58: AssertionError _________________ TestSpecialisedExplanations.test_eq_list _________________ - self = + self = def test_eq_list(self): > assert [0, 1, 2] == [0, 1, 3] @@ -166,7 +166,7 @@ failure_demo.py:61: AssertionError ______________ TestSpecialisedExplanations.test_eq_list_long _______________ - self = + self = def test_eq_list_long(self): a = [0]*100 + [1] + [3]*100 @@ -178,7 +178,7 @@ failure_demo.py:66: AssertionError _________________ TestSpecialisedExplanations.test_eq_dict _________________ - self = + self = def test_eq_dict(self): > assert {'a': 0, 'b': 1} == {'a': 0, 'b': 2} @@ -191,7 +191,7 @@ failure_demo.py:69: AssertionError _________________ TestSpecialisedExplanations.test_eq_set __________________ - self = + self = def test_eq_set(self): > assert set([0, 10, 11, 12]) == set([0, 20, 21]) @@ -207,7 +207,7 @@ failure_demo.py:72: AssertionError _____________ TestSpecialisedExplanations.test_eq_longer_list ______________ - self = + self = def test_eq_longer_list(self): > assert [1,2] == [1,2,3] @@ -217,7 +217,7 @@ failure_demo.py:75: AssertionError _________________ TestSpecialisedExplanations.test_in_list _________________ - self = + self = def test_in_list(self): > assert 1 in [0, 2, 3, 4, 5] @@ -226,7 +226,7 @@ failure_demo.py:78: AssertionError __________ TestSpecialisedExplanations.test_not_in_text_multiline __________ - self = + self = def test_not_in_text_multiline(self): text = 'some multiline\ntext\nwhich\nincludes foo\nand a\ntail' @@ -244,7 +244,7 @@ failure_demo.py:82: AssertionError ___________ TestSpecialisedExplanations.test_not_in_text_single ____________ - self = + self = def test_not_in_text_single(self): text = 'single foo line' @@ -257,7 +257,7 @@ failure_demo.py:86: AssertionError _________ TestSpecialisedExplanations.test_not_in_text_single_long _________ - self = + self = def test_not_in_text_single_long(self): text = 'head ' * 50 + 'foo ' + 'tail ' * 20 @@ -270,7 +270,7 @@ failure_demo.py:90: AssertionError ______ TestSpecialisedExplanations.test_not_in_text_single_long_term _______ - self = + self = def test_not_in_text_single_long_term(self): text = 'head ' * 50 + 'f'*70 + 'tail ' * 20 @@ -289,7 +289,7 @@ i = Foo() > assert i.b == 2 E assert 1 == 2 - E + where 1 = .b + E + where 1 = .b failure_demo.py:101: AssertionError _________________________ test_attribute_instance __________________________ @@ -299,8 +299,8 @@ b = 1 > assert Foo().b == 2 E assert 1 == 2 - E + where 1 = .b - E + where = () + E + where 1 = .b + E + where = () failure_demo.py:107: AssertionError __________________________ test_attribute_failure __________________________ @@ -316,7 +316,7 @@ failure_demo.py:116: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - self = + self = def _get_b(self): > raise Exception('Failed to get attrib') @@ -332,15 +332,15 @@ b = 2 > assert Foo().b == Bar().b E assert 1 == 2 - E + where 1 = .b - E + where = () - E + and 2 = .b - E + where = () + E + where 1 = .b + E + where = () + E + and 2 = .b + E + where = () failure_demo.py:124: AssertionError __________________________ TestRaises.test_raises __________________________ - self = + self = def test_raises(self): s = 'qwe' @@ -352,10 +352,10 @@ > int(s) E ValueError: invalid literal for int() with base 10: 'qwe' - <0-codegen /Users/hpk/p/pytest/_pytest/python.py:958>:1: ValueError + <0-codegen /Users/hpk/p/pytest/_pytest/python.py:976>:1: ValueError ______________________ TestRaises.test_raises_doesnt _______________________ - self = + self = def test_raises_doesnt(self): > raises(IOError, "int('3')") @@ -364,7 +364,7 @@ failure_demo.py:136: Failed __________________________ TestRaises.test_raise ___________________________ - self = + self = def test_raise(self): > raise ValueError("demo error") @@ -373,7 +373,7 @@ failure_demo.py:139: ValueError ________________________ TestRaises.test_tupleerror ________________________ - self = + self = def test_tupleerror(self): > a,b = [1] @@ -382,7 +382,7 @@ failure_demo.py:142: ValueError ______ TestRaises.test_reinterpret_fails_with_print_for_the_fun_of_it ______ - self = + self = def test_reinterpret_fails_with_print_for_the_fun_of_it(self): l = [1,2,3] @@ -395,7 +395,7 @@ l is [1, 2, 3] ________________________ TestRaises.test_some_error ________________________ - self = + self = def test_some_error(self): > if namenotexi: @@ -423,7 +423,7 @@ <2-codegen 'abc-123' /Users/hpk/p/pytest/doc/example/assertion/failure_demo.py:162>:2: AssertionError ____________________ TestMoreErrors.test_complex_error _____________________ - self = + self = def test_complex_error(self): def f(): @@ -452,7 +452,7 @@ failure_demo.py:5: AssertionError ___________________ TestMoreErrors.test_z1_unpack_error ____________________ - self = + self = def test_z1_unpack_error(self): l = [] @@ -462,7 +462,7 @@ failure_demo.py:179: ValueError ____________________ TestMoreErrors.test_z2_type_error _____________________ - self = + self = def test_z2_type_error(self): l = 3 @@ -472,19 +472,19 @@ failure_demo.py:183: TypeError ______________________ TestMoreErrors.test_startswith ______________________ - self = + self = def test_startswith(self): s = "123" g = "456" > assert s.startswith(g) - E assert ('456') - E + where = '123'.startswith + E assert ('456') + E + where = '123'.startswith failure_demo.py:188: AssertionError __________________ TestMoreErrors.test_startswith_nested ___________________ - self = + self = def test_startswith_nested(self): def f(): @@ -492,15 +492,15 @@ def g(): return "456" > assert f().startswith(g()) - E assert ('456') - E + where = '123'.startswith - E + where '123' = () - E + and '456' = () + E assert ('456') + E + where = '123'.startswith + E + where '123' = () + E + and '456' = () failure_demo.py:195: AssertionError _____________________ TestMoreErrors.test_global_func ______________________ - self = + self = def test_global_func(self): > assert isinstance(globf(42), float) @@ -510,18 +510,18 @@ failure_demo.py:198: AssertionError _______________________ TestMoreErrors.test_instance _______________________ - self = + self = def test_instance(self): self.x = 6*7 > assert self.x != 42 E assert 42 != 42 - E + where 42 = .x + E + where 42 = .x failure_demo.py:202: AssertionError _______________________ TestMoreErrors.test_compare ________________________ - self = + self = def test_compare(self): > assert globf(10) < 5 @@ -531,7 +531,7 @@ failure_demo.py:205: AssertionError _____________________ TestMoreErrors.test_try_finally ______________________ - self = + self = def test_try_finally(self): x = 1 @@ -540,4 +540,4 @@ E assert 1 == 0 failure_demo.py:210: AssertionError - ======================== 39 failed in 0.41 seconds ========================= + ======================== 39 failed in 1.05 seconds ========================= diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/example/simple.txt --- a/doc/example/simple.txt +++ b/doc/example/simple.txt @@ -53,7 +53,7 @@ test_sample.py:6: AssertionError ----------------------------- Captured stdout ------------------------------ first - 1 failed in 0.02 seconds + 1 failed in 0.50 seconds And now with supplying a command line option:: @@ -109,13 +109,13 @@ $ py.test =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 gw0 I gw0 [0] scheduling tests via LoadScheduling - ============================= in 0.54 seconds ============================= + ============================= in 5.12 seconds ============================= .. _`excontrolskip`: @@ -156,20 +156,20 @@ $ py.test -rs # "-rs" means report details on the little 's' =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 2 items test_module.py .s ========================= short test summary info ========================== - SKIP [1] /Users/hpk/tmp/doc-exec-49/conftest.py:9: need --runslow option to run + SKIP [1] /Users/hpk/tmp/doc-exec-158/conftest.py:9: need --runslow option to run - =================== 1 passed, 1 skipped in 0.02 seconds ==================== + =================== 1 passed, 1 skipped in 0.09 seconds ==================== Or run it including the ``slow`` marked test:: $ py.test --runslow =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 2 items test_module.py .. @@ -213,7 +213,7 @@ E Failed: not configured: 42 test_checkconfig.py:8: Failed - 1 failed in 0.02 seconds + 1 failed in 0.07 seconds Detect if running from within a py.test run -------------------------------------------------------------- @@ -261,11 +261,11 @@ $ py.test =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 project deps: mylib-1.1 collecting ... collected 0 items - ============================= in 0.00 seconds ============================= + ============================= in 0.01 seconds ============================= .. regendoc:wipe @@ -284,21 +284,21 @@ $ py.test -v =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 -- /Users/hpk/venv/1/bin/python + platform darwin -- Python 2.7.1 -- pytest-2.2.2 -- /Users/hpk/venv/0/bin/python info1: did you know that ... did you? collecting ... collected 0 items - ============================= in 0.00 seconds ============================= + ============================= in 0.03 seconds ============================= and nothing when run plainly:: $ py.test =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 0 items - ============================= in 0.00 seconds ============================= + ============================= in 0.01 seconds ============================= profiling test duration -------------------------- @@ -327,7 +327,7 @@ $ py.test --durations=3 =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 3 items test_some_are_slow.py ... @@ -335,5 +335,5 @@ ========================= slowest 3 test durations ========================= 0.20s call test_some_are_slow.py::test_funcslow2 0.10s call test_some_are_slow.py::test_funcslow1 - 0.00s setup test_some_are_slow.py::test_funcfast - ========================= 3 passed in 0.32 seconds ========================= + 0.00s call test_some_are_slow.py::test_funcfast + ========================= 3 passed in 0.33 seconds ========================= diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/funcargs.txt --- a/doc/funcargs.txt +++ b/doc/funcargs.txt @@ -62,7 +62,7 @@ $ py.test test_simplefactory.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 1 items test_simplefactory.py F @@ -77,7 +77,7 @@ E assert 42 == 17 test_simplefactory.py:5: AssertionError - ========================= 1 failed in 0.02 seconds ========================= + ========================= 1 failed in 0.03 seconds ========================= This means that indeed the test function was called with a ``myfuncarg`` argument value of ``42`` and the assert fails. Here is how py.test @@ -167,7 +167,7 @@ $ py.test test_example.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 10 items test_example.py .........F @@ -182,7 +182,7 @@ E assert 9 < 9 test_example.py:6: AssertionError - ==================== 1 failed, 9 passed in 0.05 seconds ==================== + ==================== 1 failed, 9 passed in 0.07 seconds ==================== Obviously, only when ``numiter`` has the value of ``9`` does the test fail. Note that the ``pytest_generate_tests(metafunc)`` hook is called during the test collection phase which is separate from the actual test running. @@ -190,7 +190,7 @@ $ py.test --collectonly test_example.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 10 items @@ -210,13 +210,13 @@ $ py.test -v -k 7 test_example.py # or -k test_func[7] =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 -- /Users/hpk/venv/1/bin/python + platform darwin -- Python 2.7.1 -- pytest-2.2.2 -- /Users/hpk/venv/0/bin/python collecting ... collected 10 items test_example.py:5: test_func[7] PASSED ======================= 9 tests deselected by '-k7' ======================== - ================== 1 passed, 9 deselected in 0.02 seconds ================== + ================== 1 passed, 9 deselected in 0.01 seconds ================== You might want to look at :ref:`more parametrization examples `. diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/getting-started.txt --- a/doc/getting-started.txt +++ b/doc/getting-started.txt @@ -22,9 +22,10 @@ To check your installation has installed the correct version:: $ py.test --version - This is py.test version 2.2.1, imported from /Users/hpk/p/pytest/pytest.pyc + This is py.test version 2.2.2, imported from /Users/hpk/p/pytest/pytest.pyc setuptools registered plugins: - pytest-xdist-1.8.dev2 at /Users/hpk/p/pytest-xdist/xdist/plugin.pyc + pytest-xdist-1.8 at /Users/hpk/p/pytest-xdist/xdist/plugin.pyc + pytest-cov-1.4 at /Users/hpk/venv/0/lib/python2.7/site-packages/pytest_cov.pyc If you get an error checkout :ref:`installation issues`. @@ -46,7 +47,7 @@ $ py.test =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 1 items test_sample.py F @@ -126,7 +127,7 @@ ================================= FAILURES ================================= ____________________________ TestClass.test_two ____________________________ - self = + self = def test_two(self): x = "hello" @@ -163,7 +164,7 @@ ================================= FAILURES ================================= _____________________________ test_needsfiles ______________________________ - tmpdir = local('/Users/hpk/tmp/pytest-679/test_needsfiles0') + tmpdir = local('/Users/hpk/tmp/pytest-20/test_needsfiles0') def test_needsfiles(tmpdir): print tmpdir @@ -172,8 +173,8 @@ test_tmpdir.py:3: AssertionError ----------------------------- Captured stdout ------------------------------ - /Users/hpk/tmp/pytest-679/test_needsfiles0 - 1 failed in 0.16 seconds + /Users/hpk/tmp/pytest-20/test_needsfiles0 + 1 failed in 0.11 seconds Before the test runs, a unique-per-test-invocation temporary directory was created. More info at :ref:`tmpdir handling`. diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/skipping.txt --- a/doc/skipping.txt +++ b/doc/skipping.txt @@ -130,7 +130,7 @@ example $ py.test -rx xfail_demo.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 6 items xfail_demo.py xxxxxx @@ -147,7 +147,7 @@ XFAIL xfail_demo.py::test_hello6 reason: reason - ======================== 6 xfailed in 0.08 seconds ========================= + ======================== 6 xfailed in 0.16 seconds ========================= .. _`evaluation of skipif/xfail conditions`: diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/tmpdir.txt --- a/doc/tmpdir.txt +++ b/doc/tmpdir.txt @@ -28,7 +28,7 @@ $ py.test test_tmpdir.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 1 items test_tmpdir.py F @@ -36,7 +36,7 @@ ================================= FAILURES ================================= _____________________________ test_create_file _____________________________ - tmpdir = local('/Users/hpk/tmp/pytest-680/test_create_file0') + tmpdir = local('/Users/hpk/tmp/pytest-21/test_create_file0') def test_create_file(tmpdir): p = tmpdir.mkdir("sub").join("hello.txt") @@ -47,7 +47,7 @@ E assert 0 test_tmpdir.py:7: AssertionError - ========================= 1 failed in 0.17 seconds ========================= + ========================= 1 failed in 0.07 seconds ========================= .. _`base temporary directory`: diff -r ebc6d7afeb7eda9b42fb50713723d6b299d98bf6 -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d doc/unittest.txt --- a/doc/unittest.txt +++ b/doc/unittest.txt @@ -24,7 +24,7 @@ $ py.test test_unittest.py =========================== test session starts ============================ - platform darwin -- Python 2.7.1 -- pytest-2.2.1 + platform darwin -- Python 2.7.1 -- pytest-2.2.2 collecting ... collected 1 items test_unittest.py F @@ -42,7 +42,7 @@ test_unittest.py:8: AssertionError ----------------------------- Captured stdout ------------------------------ hello - ========================= 1 failed in 0.04 seconds ========================= + ========================= 1 failed in 0.15 seconds ========================= .. _`unittest.py style`: http://docs.python.org/library/unittest.html 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 Feb 6 00:37:46 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Sun, 05 Feb 2012 23:37:46 -0000 Subject: [py-svn] commit/pytest: hpk42: Added tag 2.2.2 for changeset 92b916483c1e Message-ID: <20120205233746.20297.20821@bitbucket02.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/changeset/8eabbf4f3b6a/ changeset: 8eabbf4f3b6a user: hpk42 date: 2012-02-06 00:37:31 summary: Added tag 2.2.2 for changeset 92b916483c1e affected #: 1 file diff -r 92b916483c1e65a80dc80e3f7816b39e84b36a4d -r 8eabbf4f3b6ae82aa2827a79621e893e080056e5 .hgtags --- a/.hgtags +++ b/.hgtags @@ -46,3 +46,4 @@ 12a05d59249f80276e25fd8b96e8e545b1332b7a 2.1.3 1522710369337d96bf9568569d5f0ca9b38a74e0 2.2.0 3da8cec6c5326ed27c144c9b6d7a64a648370005 2.2.1 +92b916483c1e65a80dc80e3f7816b39e84b36a4d 2.2.2 Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Mon Feb 6 05:39:09 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Mon, 06 Feb 2012 04:39:09 -0000 Subject: [py-svn] commit/pytest: 2 new changesets Message-ID: <20120206043909.7522.20729@bitbucket03.managed.contegix.com> 2 new commits in pytest: https://bitbucket.org/hpk42/pytest/changeset/3c11c5c9776f/ changeset: 3c11c5c9776f user: hpk42 date: 2012-02-06 05:38:31 summary: release 2.2.3 to fix package contents (2.2.2 contained too many files) affected #: 3 files diff -r 8eabbf4f3b6ae82aa2827a79621e893e080056e5 -r 3c11c5c9776f3c678719161e96cc0a08169c1cb8 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +Changes between 2.2.2 and 2.2.3 +---------------------------------------- + +- fix uploaded package to only include neccesary files + Changes between 2.2.1 and 2.2.2 ---------------------------------------- diff -r 8eabbf4f3b6ae82aa2827a79621e893e080056e5 -r 3c11c5c9776f3c678719161e96cc0a08169c1cb8 _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.2.2' +__version__ = '2.2.3' diff -r 8eabbf4f3b6ae82aa2827a79621e893e080056e5 -r 3c11c5c9776f3c678719161e96cc0a08169c1cb8 setup.py --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.2.2', + version='2.2.3', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], https://bitbucket.org/hpk42/pytest/changeset/a21a2f07a7bb/ changeset: a21a2f07a7bb user: hpk42 date: 2012-02-06 05:39:00 summary: Added tag 2.2.3 for changeset 3c11c5c9776f affected #: 1 file diff -r 3c11c5c9776f3c678719161e96cc0a08169c1cb8 -r a21a2f07a7bbcf14c972c8ecc5425059b41db43a .hgtags --- a/.hgtags +++ b/.hgtags @@ -47,3 +47,4 @@ 1522710369337d96bf9568569d5f0ca9b38a74e0 2.2.0 3da8cec6c5326ed27c144c9b6d7a64a648370005 2.2.1 92b916483c1e65a80dc80e3f7816b39e84b36a4d 2.2.2 +3c11c5c9776f3c678719161e96cc0a08169c1cb8 2.2.3 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 Feb 6 05:54:30 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Mon, 06 Feb 2012 04:54:30 -0000 Subject: [py-svn] commit/pytest: hpk42: mention 2.2.3 in 2.2.2 release announce Message-ID: <20120206045430.20296.51223@bitbucket02.managed.contegix.com> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/changeset/7acac2f3fa41/ changeset: 7acac2f3fa41 user: hpk42 date: 2012-02-06 05:54:20 summary: mention 2.2.3 in 2.2.2 release announce affected #: 1 file diff -r a21a2f07a7bbcf14c972c8ecc5425059b41db43a -r 7acac2f3fa415682a7f9354fc71cbbbf45d91954 doc/announce/release-2.2.2.txt --- a/doc/announce/release-2.2.2.txt +++ b/doc/announce/release-2.2.2.txt @@ -1,9 +1,10 @@ pytest-2.2.2: bug fixes =========================================================================== -pytest-2.2.2 is a minor backward-compatible release of the versatile py.test -testing tool. It contains bug fixes and a few refinements particularly -to reporting with "--collectonly", see below for betails. +pytest-2.2.2 (updated to 2.2.3 to fix packaging issues) is a minor +backward-compatible release of the versatile py.test testing tool. It +contains bug fixes and a few refinements particularly to reporting with +"--collectonly", see below for betails. For general information see here: 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 Feb 6 13:38:40 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Mon, 06 Feb 2012 12:38:40 -0000 Subject: [py-svn] commit/py: hpk42: fix py3 bug and refine lastlinelen handling Message-ID: <20120206123840.11930.3238@bitbucket01.managed.contegix.com> 1 new commit in py: https://bitbucket.org/hpk42/py/changeset/5aa472a410ed/ changeset: 5aa472a410ed user: hpk42 date: 2012-02-06 13:38:02 summary: fix py3 bug and refine lastlinelen handling affected #: 3 files diff -r e97d7c933a74e34f45e704e8b129c67424cd11ce -r 5aa472a410edfaee7b89c0f6c7fd80d14dacc6a8 py/__init__.py --- a/py/__init__.py +++ b/py/__init__.py @@ -8,7 +8,7 @@ (c) Holger Krekel and others, 2004-2010 """ -__version__ = '1.4.7.dev3' +__version__ = '1.4.7.dev4' from py import _apipkg diff -r e97d7c933a74e34f45e704e8b129c67424cd11ce -r 5aa472a410edfaee7b89c0f6c7fd80d14dacc6a8 py/_io/terminalwriter.py --- a/py/_io/terminalwriter.py +++ b/py/_io/terminalwriter.py @@ -194,10 +194,17 @@ if not self._newline: self.write("\r") self.write(line, **opts) - lastlen = getattr(self, '_lastlinelen', None) - self._lastlinelen = lenlastline = len(line) - if lenlastline < lastlen: - self.write(" " * (lastlen - lenlastline + 1)) + # see if we need to fill up some spaces at the end + # xxx have a more exact lastlinelen working from self.write? + lenline = len(line) + try: + lastlen = self._lastlinelen + except AttributeError: + pass + else: + if lenline < lastlen: + self.write(" " * (lastlen - lenline + 1)) + self._lastlinelen = lenline self._newline = False diff -r e97d7c933a74e34f45e704e8b129c67424cd11ce -r 5aa472a410edfaee7b89c0f6c7fd80d14dacc6a8 setup.py --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ name='py', description='library with cross-python path, ini-parsing, io, code, log facilities', long_description = open('README.txt').read(), - version='1.4.7.dev3', + version='1.4.7.dev4', url='http://pylib.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], 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 Feb 6 13:43:42 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Mon, 06 Feb 2012 12:43:42 -0000 Subject: [py-svn] commit/py: 2 new changesets Message-ID: <20120206124342.11929.36002@bitbucket01.managed.contegix.com> 2 new commits in py: https://bitbucket.org/hpk42/py/changeset/f15726f9e5a6/ changeset: f15726f9e5a6 user: hpk42 date: 2012-02-06 13:42:31 summary: bump version to 1.4.7 affected #: 3 files diff -r 5aa472a410edfaee7b89c0f6c7fd80d14dacc6a8 -r f15726f9e5a67cc6221c499affa4840e9d591763 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -Changes between 1.4.6 and NEXT +Changes between 1.4.6 and 1.4.7 ================================================== - fix issue11 - own test failure with python3.3 / Thanks Benjamin Peterson diff -r 5aa472a410edfaee7b89c0f6c7fd80d14dacc6a8 -r f15726f9e5a67cc6221c499affa4840e9d591763 py/__init__.py --- a/py/__init__.py +++ b/py/__init__.py @@ -8,7 +8,7 @@ (c) Holger Krekel and others, 2004-2010 """ -__version__ = '1.4.7.dev4' +__version__ = '1.4.7' from py import _apipkg diff -r 5aa472a410edfaee7b89c0f6c7fd80d14dacc6a8 -r f15726f9e5a67cc6221c499affa4840e9d591763 setup.py --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ name='py', description='library with cross-python path, ini-parsing, io, code, log facilities', long_description = open('README.txt').read(), - version='1.4.7.dev4', + version='1.4.7', url='http://pylib.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], https://bitbucket.org/hpk42/py/changeset/6973aa47321b/ changeset: 6973aa47321b user: hpk42 date: 2012-02-06 13:42:35 summary: Added tag 1.4.7 for changeset f15726f9e5a6 affected #: 1 file diff -r f15726f9e5a67cc6221c499affa4840e9d591763 -r 6973aa47321b31e691c3b8a4e13d34ceaea30f8f .hgtags --- a/.hgtags +++ b/.hgtags @@ -37,3 +37,4 @@ 9950bf9d684a984d511795013421c89c5cf88bef 1.4.3 d9951e3bdbc765e73835ae13012f6a074d13d8bf 1.4.4 b827dd156a36753e32c7f3f15ce82d6fe9e356c8 1.4.6 +f15726f9e5a67cc6221c499affa4840e9d591763 1.4.7 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 Fri Feb 17 12:02:25 2012 From: commits-noreply at bitbucket.org (Bitbucket) Date: Fri, 17 Feb 2012 11:02:25 -0000 Subject: [py-svn] commit/py: RonnyPfannschmidt: terminalwriter: apply mattip's ctypes argtype declarations for winapi from pypy e16f0468532b Message-ID: <20120217110225.15431.41367@bitbucket05.managed.contegix.com> 1 new commit in py: https://bitbucket.org/hpk42/py/changeset/b418f117d16a/ changeset: b418f117d16a user: RonnyPfannschmidt date: 2012-02-17 12:01:07 summary: terminalwriter: apply mattip's ctypes argtype declarations for winapi from pypy e16f0468532b affected #: 1 file diff -r 6973aa47321b31e691c3b8a4e13d34ceaea30f8f -r b418f117d16a960b5c276f06b51b4fe2d4ff3e80 py/_io/terminalwriter.py --- a/py/_io/terminalwriter.py +++ b/py/_io/terminalwriter.py @@ -294,16 +294,24 @@ ('srWindow', SMALL_RECT), ('dwMaximumWindowSize', COORD)] + _GetStdHandle = ctypes.windll.kernel32.GetStdHandle + _GetStdHandle.argtypes = [wintypes.DWORD] + _GetStdHandle.restype = wintypes.HANDLE def GetStdHandle(kind): - return ctypes.windll.kernel32.GetStdHandle(kind) + return _GetStdHandle(kind) - SetConsoleTextAttribute = \ - ctypes.windll.kernel32.SetConsoleTextAttribute + SetConsoleTextAttribute = ctypes.windll.kernel32.SetConsoleTextAttribute + SetConsoleTextAttribute.argtypes = [wintypes.HANDLE, wintypes.WORD] + SetConsoleTextAttribute.restype = wintypes.BOOL + _GetConsoleScreenBufferInfo = \ + ctypes.windll.kernel32.GetConsoleScreenBufferInfo + _GetConsoleScreenBufferInfo.argtypes = [wintypes.HANDLE, + ctypes.POINTER(CONSOLE_SCREEN_BUFFER_INFO)] + _GetConsoleScreenBufferInfo.restype = wintypes.BOOL def GetConsoleInfo(handle): info = CONSOLE_SCREEN_BUFFER_INFO() - ctypes.windll.kernel32.GetConsoleScreenBufferInfo(\ - handle, ctypes.byref(info)) + _GetConsoleScreenBufferInfo(handle, ctypes.byref(info)) return info def _getdimensions(): 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.