<div dir="ltr">Hi all,<div><br></div><div>pytest 2.8 has been released to pypi, with significant bug-fixes and features.</div><div><br></div><div><div>In case you wonder, pytest is a widely used mature test runner both for</div><div>unit and functional test purposes in python.  See <a href="http://pytest.org">http://pytest.org</a> for</div><div>documentation and examples.</div></div><div><br></div><div>Here&#39;s the changelog for this version:</div><div><br></div><div><div>- new ``--lf`` and ``-ff`` options to run only the last failing tests or</div><div>  &quot;failing tests first&quot; from the last run.  This functionality is provided </div><div>  through porting the formerly external pytest-cache plugin into pytest core.</div><div>  BACKWARD INCOMPAT: if you used pytest-cache&#39;s functionality to persist</div><div>  data between test runs be aware that we don&#39;t serialize sets anymore.</div><div>  Thanks Ronny Pfannschmidt for most of the merging work.</div><div><br></div><div>- &quot;-r&quot; option now accepts &quot;a&quot; to include all possible reports, similar</div><div>  to passing &quot;fEsxXw&quot; explicitly (isse960).</div><div>  Thanks Abhijeet Kasurde for the PR.</div><div><br></div><div>- avoid python3.5 deprecation warnings by introducing version</div><div>  specific inspection helpers, thanks Michael Droettboom.</div><div><br></div><div>- fix issue562: @nose.tools.istest now fully respected.</div><div><br></div><div>- fix issue934: when string comparison fails and a diff is too large to display</div><div>  without passing -vv, still show a few lines of the diff.</div><div>  Thanks Florian Bruhin for the report and Bruno Oliveira for the PR.</div><div><br></div><div>- fix issue736: Fix a bug where fixture params would be discarded when combined</div><div>  with parametrization markers.</div><div>  Thanks to Markus Unterwaditzer for the PR.</div><div><br></div><div>- fix issue710: introduce ALLOW_UNICODE doctest option: when enabled, the</div><div>  ``u`` prefix is stripped from unicode strings in expected doctest output. This</div><div>  allows doctests which use unicode to run in Python 2 and 3 unchanged.</div><div>  Thanks Jason R. Coombs for the report and Bruno Oliveira for the PR.</div><div><br></div><div>- parametrize now also generates meaningful test IDs for enum, regex and class</div><div>  objects (as opposed to class instances).</div><div>  Thanks to Florian Bruhin for the PR.</div><div><br></div><div>- Add &#39;warns&#39; to assert that warnings are thrown (like &#39;raises&#39;).</div><div>  Thanks to Eric Hunsberger for the PR.</div><div><br></div><div>- Fix issue683: Do not apply an already applied mark.  Thanks ojake for the PR.</div><div><br></div><div>- Deal with capturing failures better so fewer exceptions get lost to</div><div>  /dev/null.  Thanks David Szotten for the PR.</div><div><br></div><div>- fix issue730: deprecate and warn about the --genscript option.</div><div>  Thanks Ronny Pfannschmidt for the report and Christian Pommranz for the PR.</div><div><br></div><div>- fix issue751: multiple parametrize with ids bug if it parametrizes class with</div><div>  two or more test methods. Thanks Sergey Chipiga for reporting and Jan</div><div>  Bednarik for PR.</div><div><br></div><div>- fix issue82: avoid loading conftest files from setup.cfg/pytest.ini/tox.ini</div><div>  files and upwards by default (--confcutdir can still be set to override this).</div><div>  Thanks Bruno Oliveira for the PR.</div><div><br></div><div>- fix issue768: docstrings found in python modules were not setting up session</div><div>  fixtures. Thanks Jason R. Coombs for reporting and Bruno Oliveira for the PR.</div><div><br></div><div>- added `tmpdir_factory`, a session-scoped fixture that can be used to create</div><div>  directories under the base temporary directory. Previously this object was</div><div>  installed as a `_tmpdirhandler` attribute of the `config` object, but now it</div><div>  is part of the official API and using `config._tmpdirhandler` is</div><div>  deprecated.</div><div>  Thanks Bruno Oliveira for the PR.</div><div><br></div><div>- fix issue808: pytest&#39;s internal assertion rewrite hook now implements the</div><div>  optional PEP302 get_data API so tests can access data files next to them.</div><div>  Thanks xmo-odoo for request and example and Bruno Oliveira for</div><div>  the PR.</div><div><br></div><div>- rootdir and inifile are now displayed during usage errors to help</div><div>  users diagnose problems such as unexpected ini files which add</div><div>  unknown options being picked up by pytest. Thanks to Pavel Savchenko for</div><div>  bringing the problem to attention in #821 and Bruno Oliveira for the PR.</div><div><br></div><div>- Summary bar now is colored yellow for warning</div><div>  situations such as: all tests either were skipped or xpass/xfailed,</div><div>  or no tests were run at all (this is a partial fix for issue500).</div><div><br></div><div>- fix issue812: pytest now exits with status code 5 in situations where no</div><div>  tests were run at all, such as the directory given in the command line does</div><div>  not contain any tests or as result of a command line option filters</div><div>  all out all tests (-k for example).</div><div>  Thanks Eric Siegerman (issue812) and Bruno Oliveira for the PR.</div><div><br></div><div>- Summary bar now is colored yellow for warning</div><div>  situations such as: all tests either were skipped or xpass/xfailed,</div><div>  or no tests were run at all (related to issue500).</div><div>  Thanks Eric Siegerman.</div><div><br></div><div>- New `testpaths` ini option: list of directories to search for tests</div><div>  when executing pytest from the root directory. This can be used</div><div>  to speed up test collection when a project has well specified directories</div><div>  for tests, being usually more practical than configuring norecursedirs for</div><div>  all directories that do not contain tests.</div><div>  Thanks to Adrian for idea (#694) and Bruno Oliveira for the PR.</div><div><br></div><div>- fix issue713: JUnit XML reports for doctest failures.</div><div>  Thanks Punyashloka Biswal.</div><div><br></div><div>- fix issue970: internal pytest warnings now appear as &quot;pytest-warnings&quot; in</div><div>  the terminal instead of &quot;warnings&quot;, so it is clear for users that those</div><div>  warnings are from pytest and not from the builtin &quot;warnings&quot; module.</div><div>  Thanks Bruno Oliveira.</div><div><br></div><div>- Include setup and teardown in junitxml test durations.</div><div>  Thanks Janne Vanhala.</div><div><br></div><div>- fix issue735: assertion failures on debug versions of Python 3.4+</div><div><br></div><div>- new option ``--import-mode`` to allow to change test module importing </div><div>  behaviour to append to sys.path instead of prepending.  This better allows </div><div>  to run test modules against installated versions of a package even if the </div><div>  package under test has the same import root.  In this example::</div><div><br></div><div>        testing/__init__.py</div><div>        testing/test_pkg_under_test.py</div><div>        pkg_under_test/</div><div><br></div><div>  the tests will run against the installed version</div><div>  of pkg_under_test when ``--import-mode=append`` is used whereas </div><div>  by default they would always pick up the local version.  Thanks Holger Krekel.</div><div><br></div><div>- pytester: add method ``TmpTestdir.delete_loaded_modules()``, and call it</div><div>  from ``inline_run()`` to allow temporary modules to be reloaded.</div><div>  Thanks Eduardo Schettino.</div><div><br></div><div>- internally refactor pluginmanager API and code so that there</div><div>  is a clear distinction between a pytest-agnostic rather simple</div><div>  pluginmanager and the PytestPluginManager which adds a lot of</div><div>  behaviour, among it handling of the local conftest files.</div><div>  In terms of documented methods this is a backward compatible</div><div>  change but it might still break 3rd party plugins which relied on</div><div>  details like especially the pluginmanager.add_shutdown() API.</div><div>  Thanks Holger Krekel.</div><div><br></div><div>- pluginmanagement: introduce ``pytest.hookimpl`` and</div><div>  ``pytest.hookspec`` decorators for setting impl/spec</div><div>  specific parameters.  This substitutes the previous</div><div>  now deprecated use of ``pytest.mark`` which is meant to</div><div>  contain markers for test functions only.</div><div><br></div><div>- write/refine docs for &quot;writing plugins&quot; which now have their</div><div>  own page and are separate from the &quot;using/installing plugins`` page.</div><div><br></div><div>- fix issue732: properly unregister plugins from any hook calling</div><div>  sites allowing to have temporary plugins during test execution.</div><div><br></div><div>- deprecate and warn about ``__multicall__`` argument in hook</div><div>  implementations.  Use the ``hookwrapper`` mechanism instead already</div><div>  introduced with pytest-2.7.</div><div><br></div><div>- speed up pytest&#39;s own test suite considerably by using inprocess</div><div>  tests by default (testrun can be modified with --runpytest=subprocess</div><div>  to create subprocesses in many places instead).  The main</div><div>  APIs to run pytest in a test is &quot;runpytest()&quot; or &quot;runpytest_subprocess&quot;</div><div>  and &quot;runpytest_inprocess&quot; if you need a particular way of running</div><div>  the test.  In all cases you get back a RunResult but the inprocess</div><div>  one will also have a &quot;reprec&quot; attribute with the recorded events/reports.</div><div><br></div><div>- fix monkeypatch.setattr(&quot;x.y&quot;, raising=False) to actually not raise</div><div>  if &quot;y&quot; is not a pre-existing attribute. Thanks Florian Bruhin.</div><div><br></div><div>- fix issue741: make running output from testdir.run copy/pasteable</div><div>  Thanks Bruno Oliveira.</div><div><br></div><div>- add a new ``--noconftest`` argument which ignores all ``conftest.py`` files.</div><div><br></div><div>- add ``file`` and ``line`` attributes to JUnit-XML output.</div><div><br></div><div>- fix issue890: changed extension of all documentation files from ``txt`` to</div><div>  ``rst``. Thanks to Abhijeet for the PR.</div><div><br></div><div>- fix issue714: add ability to apply indirect=True parameter on particular argnames.</div><div>  Thanks Elizaveta239.</div><div><br></div><div>- fix issue714: add ability to apply indirect=True parameter on particular argnames.</div><div><br></div><div>- fix issue890: changed extension of all documentation files from ``txt`` to</div><div>  ``rst``. Thanks to Abhijeet for the PR.</div><div><br></div><div>- fix issue957: &quot;# doctest: SKIP&quot; option will now register doctests as SKIPPED</div><div>  rather than PASSED.</div><div>  Thanks Thomas Grainger for the report and Bruno Oliveira for the PR.</div><div><br></div><div>- issue951: add new record_xml_property fixture, that supports logging</div><div>  additional information on xml output. Thanks David Diaz for the PR.</div><div><br></div><div>- issue949: paths after normal options (for example `-s`, `-v`, etc) are now</div><div>  properly used to discover `rootdir` and `ini` files.</div><div>  Thanks Peter Lauri for the report and Bruno Oliveira for the PR.</div></div><div><br></div><div><br></div></div>