Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
84a9f7a
Add pytest Quick Start Guide to the books section in the docs
nicoddemus Aug 30, 2018
29c5ac7
improve line width estimate
wimglenn Aug 30, 2018
ed4b94a
add changelog entry
wimglenn Aug 30, 2018
c18a5b5
try to be backwards compat
wimglenn Aug 31, 2018
96aad29
Move code to get width of current line to a function
nicoddemus Aug 31, 2018
19fa01b
Tweak changelog
nicoddemus Aug 31, 2018
019e33e
Merge pull request #3915 from nicoddemus/quickstart-book-docs
RonnyPfannschmidt Aug 31, 2018
95881c8
T3566,T3546: added a blurb in usage.rst for usage of flag -r
dhirensr Aug 31, 2018
d53e449
Improve performance of assertion rewriting. Fixes #3918
fabioz Aug 31, 2018
cbbb36f
tests/CI: enable branch coverage
blueyed Aug 31, 2018
75d29ac
Fix reference to inter-sphinx objects database
nicoddemus Sep 1, 2018
f3b0caf
Improve docs for summary report and move it further up in the doc
nicoddemus Sep 1, 2018
8d8e68c
Merge pull request #3911 from wimglenn/i18n_width
nicoddemus Sep 1, 2018
495b441
Merge pull request #3917 from dhirensr/docs_for_detailed_info
nicoddemus Sep 1, 2018
4675912
Add tests for early rewrite bailout code and handle patterns with sub…
nicoddemus Sep 1, 2018
885b8a3
Fix linting
nicoddemus Sep 1, 2018
f3b9b21
Merge pull request #3920 from blueyed/branch
blueyed Sep 1, 2018
90c00df
Use EXIT_USAGEERROR instead of magic number
nicoddemus Sep 1, 2018
dfa7131
Merge pull request #3921 from nicoddemus/use-constant
nicoddemus Sep 1, 2018
a13c6a8
Mention explicitly when pytest.skip and pytest.xfail can be called
nicoddemus Sep 2, 2018
dc13f0b
Reenable pypy now that scandir can be installed without a compiler
nicoddemus Sep 2, 2018
f7dc9b9
Merge pull request #3922 from nicoddemus/skip-xfail-docs-3219
nicoddemus Sep 2, 2018
15ede8a
Merge pull request #3924 from nicoddemus/enable-pypy
RonnyPfannschmidt Sep 2, 2018
eec7081
Make AssertionRewritingrHook use imp_find_module
nicoddemus Sep 3, 2018
410d576
Merge pull request #3919 from fabioz/master
RonnyPfannschmidt Sep 5, 2018
69b34f7
Merge remote-tracking branch 'upstream/master' into release-3.8.0
nicoddemus Sep 5, 2018
1f20626
Preparing release version 3.8.0
nicoddemus Sep 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[run]
source = _pytest,testing
parallel = 1
branch = 1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ env/
.ropeproject
.idea
.hypothesis
.pydevproject
.project
.settings
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Endre Galaczi
Eric Hunsberger
Eric Siegerman
Erik M. Bray
Fabio Zadrozny
Feng Ma
Florian Bruhin
Floris Bruynooghe
Expand Down
84 changes: 84 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,90 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start

pytest 3.8.0 (2018-09-05)
=========================

Deprecations and Removals
-------------------------

- `#2452 <https://github.com/pytest-dev/pytest/issues/2452>`_: ``Config.warn`` has been deprecated, it should be replaced by calls to the standard ``warnings.warn``.

``Node.warn`` now supports two signatures:

* ``node.warn(PytestWarning("some message"))``: is now the recommended way to call this function. The warning
instance must be a ``PytestWarning`` or subclass instance.

* ``node.warn("CI", "some message")``: this code/message form is now deprecated and should be converted to
the warning instance form above.

``RemovedInPytest4Warning`` and ``PytestExperimentalApiWarning`` are now part of the public API and should be accessed
using ``pytest.RemovedInPytest4Warning`` and ``pytest.PytestExperimentalApiWarning``.


- `#3936 <https://github.com/pytest-dev/pytest/issues/3936>`_: ``@pytest.mark.filterwarnings`` second parameter is no longer regex-escaped,
making it possible to actually use regular expressions to check the warning message.

**Note**: regex-escaping the match string was an implementation oversight that might break test suites which depend
on the old behavior.



Features
--------

- `#2452 <https://github.com/pytest-dev/pytest/issues/2452>`_: Internal pytest warnings are now issued using the standard ``warnings`` module, making it possible to use
the standard warnings filters to manage those warnings. This introduces ``PytestWarning``,
``PytestDeprecationWarning`` and ``RemovedInPytest4Warning`` warning types as part of the public API.

Consult `the documentation <https://docs.pytest.org/en/latest/warnings.html#internal-pytest-warnings>`_ for more info.


- `#2908 <https://github.com/pytest-dev/pytest/issues/2908>`_: ``DeprecationWarning`` and ``PendingDeprecationWarning`` are now shown by default if no other warning filter is
configured. This makes pytest more compliant with
`PEP-0506 <https://www.python.org/dev/peps/pep-0565/#recommended-filter-settings-for-test-runners>`_. See
`the docs <https://docs.pytest.org/en/latest/warnings.html#deprecationwarning-and-pendingdeprecationwarning>`_ for
more info.


- `#3784 <https://github.com/pytest-dev/pytest/issues/3784>`_: Add option to disable plugin auto-loading.


- `#3829 <https://github.com/pytest-dev/pytest/issues/3829>`_: Added the ``count`` option to ``console_output_style`` to enable displaying the progress as a count instead of a percentage.


- `#3837 <https://github.com/pytest-dev/pytest/issues/3837>`_: Added support for 'xfailed' and 'xpassed' outcomes to the ``pytester.RunResult.assert_outcomes`` signature.



Bug Fixes
---------

- `#3911 <https://github.com/pytest-dev/pytest/issues/3911>`_: Terminal writer now takes into account unicode character width when writing out progress.


- `#3913 <https://github.com/pytest-dev/pytest/issues/3913>`_: Pytest now returns with correct exit code (EXIT_USAGEERROR, 4) when called with unknown arguments.


- `#3918 <https://github.com/pytest-dev/pytest/issues/3918>`_: Improve performance of assertion rewriting.



Improved Documentation
----------------------

- `#3566 <https://github.com/pytest-dev/pytest/issues/3566>`_: Added a blurb in usage.rst for the usage of -r flag which is used to show an extra test summary info.


- `#3907 <https://github.com/pytest-dev/pytest/issues/3907>`_: Corrected type of the exceptions collection passed to ``xfail``: ``raises`` argument accepts a ``tuple`` instead of ``list``.



Trivial/Internal Changes
------------------------

- `#3853 <https://github.com/pytest-dev/pytest/issues/3853>`_: Removed ``"run all (no recorded failures)"`` message printed with ``--failed-first`` and ``--last-failed`` when there are no failed tests.


pytest 3.7.4 (2018-08-29)
=========================

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ environment:
- TOXENV: "py35"
- TOXENV: "py36"
- TOXENV: "py37"
# - TOXENV: "pypy" reenable when we are able to provide a scandir wheel or build scandir
- TOXENV: "pypy"
- TOXENV: "py27-pexpect"
- TOXENV: "py27-xdist"
- TOXENV: "py27-trial"
Expand Down
5 changes: 0 additions & 5 deletions changelog/2452.feature.rst

This file was deleted.

12 changes: 0 additions & 12 deletions changelog/2452.removal.rst

This file was deleted.

5 changes: 0 additions & 5 deletions changelog/2908.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3784.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3829.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3837.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3853.trivial.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3907.doc.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3913.bugfix.rst

This file was deleted.

5 changes: 0 additions & 5 deletions changelog/3936.removal.rst

This file was deleted.

1 change: 1 addition & 0 deletions doc/en/announce/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release announcements
:maxdepth: 2


release-3.8.0
release-3.7.4
release-3.7.3
release-3.7.2
Expand Down
38 changes: 38 additions & 0 deletions doc/en/announce/release-3.8.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
pytest-3.8.0
=======================================

The pytest team is proud to announce the 3.8.0 release!

pytest is a mature Python testing tool with more than a 2000 tests
against itself, passing on many different interpreters and platforms.

This release contains a number of bugs fixes and improvements, so users are encouraged
to take a look at the CHANGELOG:

https://docs.pytest.org/en/latest/changelog.html

For complete documentation, please visit:

https://docs.pytest.org/en/latest/

As usual, you can upgrade from pypi via:

pip install -U pytest

Thanks to all who contributed to this release, among them:

* Anthony Sottile
* Bruno Oliveira
* CrazyMerlyn
* Daniel Hahler
* Fabio Zadrozny
* Jeffrey Rackauckas
* Ronny Pfannschmidt
* Virgil Dupras
* dhirensr
* hoefling
* wim glenn


Happy testing,
The Pytest Development Team
2 changes: 1 addition & 1 deletion doc/en/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"python": ("http://docs.python.org/3", None)}
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}


def setup(app):
Expand Down
6 changes: 3 additions & 3 deletions doc/en/example/reportingdemo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,9 @@ get on the terminal - we are working on that)::

failure_demo.py:261: AssertionError
============================= warnings summary =============================
<undetermined location>
Metafunc.addcall is deprecated and scheduled to be removed in pytest 4.0.
Please use Metafunc.parametrize instead.
$REGENDOC_TMPDIR/assertion/failure_demo.py:24: RemovedInPytest4Warning: Metafunc.addcall is deprecated and scheduled to be removed in pytest 4.0.
Please use Metafunc.parametrize instead.
metafunc.addcall(funcargs=dict(param1=3, param2=6))

-- Docs: https://docs.pytest.org/en/latest/warnings.html
================== 42 failed, 1 warnings in 0.12 seconds ===================
3 changes: 3 additions & 0 deletions doc/en/talks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Talks and Tutorials
Books
---------------------------------------------

- `pytest Quick Start Guide, by Bruno Oliveira (2018)
<https://www.packtpub.com/web-development/pytest-quick-start-guide>`_.

- `Python Testing with pytest, by Brian Okken (2017)
<https://pragprog.com/book/bopytest/python-testing-with-pytest>`_.

Expand Down
43 changes: 43 additions & 0 deletions doc/en/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,49 @@ will be shown (because KeyboardInterrupt is caught by pytest). By using this
option you make sure a trace is shown.


.. _`pytest.detailed_failed_tests_usage`:

Detailed summary report
-----------------------

.. versionadded:: 2.9

The ``-r`` flag can be used to display test results summary at the end of the test session,
making it easy in large test suites to get a clear picture of all failures, skips, xfails, etc.

Example::

$ pytest -ra
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
rootdir: $REGENDOC_TMPDIR, inifile:
collected 0 items

======================= no tests ran in 0.12 seconds =======================

The ``-r`` options accepts a number of characters after it, with ``a`` used above meaning "all except passes".

Here is the full list of available characters that can be used:

- ``f`` - failed
- ``E`` - error
- ``s`` - skipped
- ``x`` - xfailed
- ``X`` - xpassed
- ``p`` - passed
- ``P`` - passed with output
- ``a`` - all except ``pP``

More than one character can be used, so for example to only see failed and skipped tests, you can execute::

$ pytest -rfs
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
rootdir: $REGENDOC_TMPDIR, inifile:
collected 0 items

======================= no tests ran in 0.12 seconds =======================

.. _pdb-option:

Dropping to PDB_ (Python Debugger) on failures
Expand Down
17 changes: 7 additions & 10 deletions doc/en/warnings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ Running pytest now produces this output::
test_show_warnings.py . [100%]

============================= warnings summary =============================
test_show_warnings.py::test_one
$REGENDOC_TMPDIR/test_show_warnings.py:4: UserWarning: api v1, should use functions from v2
warnings.warn(UserWarning("api v1, should use functions from v2"))
$REGENDOC_TMPDIR/test_show_warnings.py:4: UserWarning: api v1, should use functions from v2
warnings.warn(UserWarning("api v1, should use functions from v2"))

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=================== 1 passed, 1 warnings in 0.12 seconds ===================
Expand Down Expand Up @@ -354,15 +353,13 @@ defines an ``__init__`` constructor, as this prevents the class from being insta
::

$ pytest test_pytest_warnings.py -q
======================================== warnings summary =========================================
test_pytest_warnings.py:1
$REGENDOC_TMPDIR/test_pytest_warnings.py:1: PytestWarning: cannot collect test class 'Test' because it has a __init__ constructor
class Test:

-- Docs: http://doc.pytest.org/en/latest/warnings.html
1 warnings in 0.01 seconds

============================= warnings summary =============================
$REGENDOC_TMPDIR/test_pytest_warnings.py:1: PytestWarning: cannot collect test class 'Test' because it has a __init__ constructor
class Test:

-- Docs: https://docs.pytest.org/en/latest/warnings.html
1 warnings in 0.12 seconds

These warnings might be filtered using the same builtin mechanisms used to filter other types of warnings.

Expand Down
5 changes: 2 additions & 3 deletions doc/en/writing_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,8 @@ additionally it is possible to copy examples for a example folder before running
test_example.py .. [100%]

============================= warnings summary =============================
test_example.py::test_plugin
$REGENDOC_TMPDIR/test_example.py:4: PytestExperimentalApiWarning: testdir.copy_example is an experimental api that may change over time
testdir.copy_example("test_example.py")
$REGENDOC_TMPDIR/test_example.py:4: PytestExperimentalApiWarning: testdir.copy_example is an experimental api that may change over time
testdir.copy_example("test_example.py")

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=================== 2 passed, 1 warnings in 0.12 seconds ===================
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_environment_marker_support_level():
def main():
extras_require = {}
install_requires = [
"py>=1.5.0",
"py>=1.5.0", # if py gets upgrade to >=1.6, remove _width_of_current_line in terminal.py
"six>=1.10.0",
"setuptools",
"attrs>=17.4.0",
Expand Down
Loading