Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6238112
Fix self reference in function scoped fixtures
robholt Aug 19, 2019
3c82b1c
Refactor report serialization/deserialization code
nicoddemus Aug 26, 2019
7a69365
Move TWMock class to a fixture
nicoddemus Aug 26, 2019
505c334
Fix pytest with mixed up filename casing.
Oberon00 Aug 26, 2019
1aac645
black formatting.
Oberon00 Aug 27, 2019
a98270e
Document the bugfix.
Oberon00 Aug 27, 2019
29bb0ed
Move _uniquepath to pathlib as unique_path.
Oberon00 Aug 28, 2019
955e542
Merge pull request #5792 from dynatrace-oss-contrib/bugfix/badcase
nicoddemus Aug 28, 2019
487659d
Fix the scope behavior with indirect fixtures.
aklajnert Aug 28, 2019
a511b98
Serialize/deserialize chained exceptions
nicoddemus Aug 26, 2019
01082fe
Serialize/deserialize chained exceptions (#5787)
nicoddemus Aug 30, 2019
35b3b10
Improve CHANGELOG and make test easier to understand for #570
nicoddemus Aug 30, 2019
bb60736
Run py35 without xdist on Travis
nicoddemus Aug 30, 2019
3ddbc7f
Improve CHANGELOG and add some comments
nicoddemus Aug 30, 2019
955dc6d
Merge remote-tracking branch 'upstream/master' into robholt/fixture-c…
nicoddemus Aug 30, 2019
4e59455
Merge pull request #5798 from aklajnert/570-indirect-fixtures
nicoddemus Aug 30, 2019
667c646
Merge pull request #5803 from nicoddemus/flaky-5795
nicoddemus Aug 30, 2019
bd57307
Merge pull request #5768 from robholt/fixture-class-instance
nicoddemus Aug 30, 2019
f9cc704
Replace session duration to a fix value in regendoc
nicoddemus Aug 30, 2019
e56544c
Preparing release version 5.1.2
nicoddemus Aug 30, 2019
8c8809e
Merge pull request #5805 from nicoddemus/release-5.1.2
nicoddemus Aug 30, 2019
bc16360
Fix anchor link from Good Practices to Pythonpath doc
gene1wood Sep 4, 2019
ca3884d
Add Gene Wood to authors
gene1wood Sep 4, 2019
8ee557f
Fix pythonpath anchor (#5817)
nicoddemus Sep 5, 2019
d049b35
Fix for Python 4: replace unsafe PY3 with PY2
hugovk Sep 5, 2019
2bb8d93
Fix for Python 4: replace unsafe PY3 with PY2 (#5820)
nicoddemus Sep 5, 2019
f1b605c
ci: Travis: do not test with 3.5.0
blueyed Sep 6, 2019
333e9d5
Merge pull request #5824 from blueyed/revert-py350
nicoddemus Sep 6, 2019
9d7b919
Fix pypy3.6 on windows
asottile Sep 7, 2019
6c8bcf6
Fix pypy3.6 on windows (#5828)
nicoddemus Sep 8, 2019
f0d5383
Update doc regarding pytest.raises
gene1wood Sep 9, 2019
23102a7
Update doc regarding pytest.raises (#5834)
nicoddemus Sep 9, 2019
8f2f51b
Clarify docs by showing tox.ini considered before setup.cfg
asottile Sep 11, 2019
73c5b7f
Clarify docs by showing tox.ini considered before setup.cfg (#5839)
nicoddemus Sep 12, 2019
cf5b544
Revert "Merge pull request #5792 from dynatrace-oss-contrib/bugfix/ba…
nicoddemus Sep 11, 2019
b48f51e
Use Path() objects to store conftest files
nicoddemus Sep 11, 2019
05850d7
Re-introduce Christian Neumüller to AUTHORS
Oberon00 Aug 27, 2019
5c3b4a6
Add CHANGELOG entry for #5792
nicoddemus Sep 12, 2019
9422e10
Fix regression due to different cases on Windows (#5840)
nicoddemus Sep 13, 2019
f832ac3
Handle --fulltrace with pytest.raises
blueyed Sep 1, 2019
702acdb
Merge pull request #5811 from blueyed/fulltrace-pytest-raises
blueyed Sep 14, 2019
450409d
Merge master into features
blueyed Sep 17, 2019
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
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ jobs:
python: 'pypy3'

- env: TOXENV=py35-xdist
dist: trusty
python: '3.5.0'
python: '3.5'

# Coverage for:
# - pytester's LsofFdLeakChecker
Expand Down
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Andras Tim
Andrea Cimatoribus
Andreas Zeidler
Andrey Paramonov
Andrzej Klajnert
Andrzej Ostrowski
Andy Freeland
Anthon van der Neut
Expand Down Expand Up @@ -55,6 +56,7 @@ Charnjit SiNGH (CCSJ)
Chris Lamb
Christian Boelsen
Christian Fetzer
Christian Neumüller
Christian Theunert
Christian Tismer
Christopher Gilling
Expand Down Expand Up @@ -96,6 +98,7 @@ Feng Ma
Florian Bruhin
Floris Bruynooghe
Gabriel Reis
Gene Wood
George Kussumoto
Georgy Dyuldin
Graham Horler
Expand Down Expand Up @@ -210,6 +213,7 @@ Raphael Castaneda
Raphael Pierzina
Raquel Alegre
Ravi Chandra
Robert Holt
Roberto Polli
Roland Puntaier
Romain Dorgueil
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,32 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start

pytest 5.1.2 (2019-08-30)
=========================

Bug Fixes
---------

- `#2270 <https://github.com/pytest-dev/pytest/issues/2270>`_: Fixed ``self`` reference in function-scoped fixtures defined plugin classes: previously ``self``
would be a reference to a *test* class, not the *plugin* class.


- `#570 <https://github.com/pytest-dev/pytest/issues/570>`_: Fixed long standing issue where fixture scope was not respected when indirect fixtures were used during
parametrization.


- `#5782 <https://github.com/pytest-dev/pytest/issues/5782>`_: Fix decoding error when printing an error response from ``--pastebin``.


- `#5786 <https://github.com/pytest-dev/pytest/issues/5786>`_: Chained exceptions in test and collection reports are now correctly serialized, allowing plugins like
``pytest-xdist`` to display them properly.


- `#5792 <https://github.com/pytest-dev/pytest/issues/5792>`_: Windows: Fix error that occurs in certain circumstances when loading
``conftest.py`` from a working directory that has casing other than the one stored
in the filesystem (e.g., ``c:\test`` instead of ``C:\test``).


pytest 5.1.1 (2019-08-20)
=========================

Expand Down
1 change: 0 additions & 1 deletion changelog/5782.bugfix.rst

This file was deleted.

1 change: 1 addition & 0 deletions changelog/5807.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix pypy3.6 (nightly) on windows.
1 change: 1 addition & 0 deletions changelog/5811.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Handle ``--fulltrace`` correctly with ``pytest.raises``.
2 changes: 2 additions & 0 deletions changelog/5819.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Windows: Fix regression with conftest whose qualified name contains uppercase
characters (introduced by #5792).
2 changes: 1 addition & 1 deletion doc/en/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ REGENDOC_ARGS := \
--normalize "/[ \t]+\n/\n/" \
--normalize "~\$$REGENDOC_TMPDIR~/home/sweet/project~" \
--normalize "~/path/to/example~/home/sweet/project~" \
--normalize "/in \d+.\d+ seconds/in 0.12 seconds/" \
--normalize "/in \d+.\d+s ==/in 0.12s ==/" \
--normalize "@/tmp/pytest-of-.*/pytest-\d+@PYTEST_TMPDIR@" \
--normalize "@pytest-(\d+)\\.[^ ,]+@pytest-\1.x.y@" \
--normalize "@(This is pytest version )(\d+)\\.[^ ,]+@\1\2.x.y@" \
Expand Down
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-5.1.2
release-5.1.1
release-5.1.0
release-5.0.1
Expand Down
23 changes: 23 additions & 0 deletions doc/en/announce/release-5.1.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pytest-5.1.2
=======================================

pytest 5.1.2 has just been released to PyPI.

This is a bug-fix release, being a drop-in replacement. To upgrade::

pip install --upgrade pytest

The full changelog is available at https://docs.pytest.org/en/latest/changelog.html.

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

* Andrzej Klajnert
* Anthony Sottile
* Bruno Oliveira
* Christian Neumüller
* Robert Holt
* linchiwei123


Happy testing,
The pytest Development Team
4 changes: 2 additions & 2 deletions doc/en/assert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ you will see the return value of the function call:
E + where 3 = f()

test_assert1.py:6: AssertionError
============================ 1 failed in 0.02s =============================
============================ 1 failed in 0.12s =============================

``pytest`` has support for showing the values of the most common subexpressions
including calls, attributes, comparisons, and binary and unary
Expand Down Expand Up @@ -208,7 +208,7 @@ if you run this module:
E Use -v to get the full diff

test_assert2.py:6: AssertionError
============================ 1 failed in 0.02s =============================
============================ 1 failed in 0.12s =============================

Special comparisons are done for a number of cases:

Expand Down
10 changes: 5 additions & 5 deletions doc/en/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ If you run this for the first time you will see two failures:
E Failed: bad luck

test_50.py:7: Failed
2 failed, 48 passed in 0.08s
2 failed, 48 passed in 0.07s

If you then run it with ``--lf``:

Expand Down Expand Up @@ -114,7 +114,7 @@ If you then run it with ``--lf``:
E Failed: bad luck

test_50.py:7: Failed
===================== 2 failed, 48 deselected in 0.02s =====================
===================== 2 failed, 48 deselected in 0.12s =====================

You have run only the two failing tests from the last run, while the 48 passing
tests have not been run ("deselected").
Expand Down Expand Up @@ -158,7 +158,7 @@ of ``FF`` and dots):
E Failed: bad luck

test_50.py:7: Failed
======================= 2 failed, 48 passed in 0.07s =======================
======================= 2 failed, 48 passed in 0.12s =======================

.. _`config.cache`:

Expand Down Expand Up @@ -283,7 +283,7 @@ You can always peek at the content of the cache using the
example/value contains:
42

========================== no tests ran in 0.00s ===========================
========================== no tests ran in 0.12s ===========================

``--cache-show`` takes an optional argument to specify a glob pattern for
filtering:
Expand All @@ -300,7 +300,7 @@ filtering:
example/value contains:
42

========================== no tests ran in 0.00s ===========================
========================== no tests ran in 0.12s ===========================

Clearing Cache content
----------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/en/capture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ of the failing function and hide the other one:
test_module.py:12: AssertionError
-------------------------- Captured stdout setup ---------------------------
setting up <function test_func2 at 0xdeadbeef>
======================= 1 failed, 1 passed in 0.02s ========================
======================= 1 failed, 1 passed in 0.12s ========================

Accessing captured output from a test function
---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/en/customize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ check for ini-files as follows:

# first look for pytest.ini files
path/pytest.ini
path/setup.cfg # must also contain [tool:pytest] section to match
path/tox.ini # must also contain [pytest] section to match
path/setup.cfg # must also contain [tool:pytest] section to match
pytest.ini
... # all the way down to the root

Expand Down
4 changes: 2 additions & 2 deletions doc/en/doctest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ then you can just invoke ``pytest`` directly:

test_example.txt . [100%]

============================ 1 passed in 0.01s =============================
============================ 1 passed in 0.12s =============================

By default, pytest will collect ``test*.txt`` files looking for doctest directives, but you
can pass additional globs using the ``--doctest-glob`` option (multi-allowed).
Expand Down Expand Up @@ -66,7 +66,7 @@ and functions, including from test modules:
mymodule.py . [ 50%]
test_example.txt . [100%]

============================ 2 passed in 0.01s =============================
============================ 2 passed in 0.12s =============================

You can make these changes permanent in your project by
putting them into a pytest.ini file like this:
Expand Down
32 changes: 16 additions & 16 deletions doc/en/example/markers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ You can then restrict a test run to only run tests marked with ``webtest``:

test_server.py::test_send_http PASSED [100%]

===================== 1 passed, 3 deselected in 0.01s ======================
===================== 1 passed, 3 deselected in 0.12s ======================

Or the inverse, running all tests except the webtest ones:

Expand All @@ -69,7 +69,7 @@ Or the inverse, running all tests except the webtest ones:
test_server.py::test_another PASSED [ 66%]
test_server.py::TestClass::test_method PASSED [100%]

===================== 3 passed, 1 deselected in 0.01s ======================
===================== 3 passed, 1 deselected in 0.12s ======================

Selecting tests based on their node ID
--------------------------------------
Expand All @@ -89,7 +89,7 @@ tests based on their module, class, method, or function name:

test_server.py::TestClass::test_method PASSED [100%]

============================ 1 passed in 0.01s =============================
============================ 1 passed in 0.12s =============================

You can also select on the class:

Expand All @@ -104,7 +104,7 @@ You can also select on the class:

test_server.py::TestClass::test_method PASSED [100%]

============================ 1 passed in 0.01s =============================
============================ 1 passed in 0.12s =============================

Or select multiple nodes:

Expand All @@ -120,7 +120,7 @@ Or select multiple nodes:
test_server.py::TestClass::test_method PASSED [ 50%]
test_server.py::test_send_http PASSED [100%]

============================ 2 passed in 0.01s =============================
============================ 2 passed in 0.12s =============================

.. _node-id:

Expand Down Expand Up @@ -159,7 +159,7 @@ select tests based on their names:

test_server.py::test_send_http PASSED [100%]

===================== 1 passed, 3 deselected in 0.01s ======================
===================== 1 passed, 3 deselected in 0.12s ======================

And you can also run all tests except the ones that match the keyword:

Expand All @@ -176,7 +176,7 @@ And you can also run all tests except the ones that match the keyword:
test_server.py::test_another PASSED [ 66%]
test_server.py::TestClass::test_method PASSED [100%]

===================== 3 passed, 1 deselected in 0.01s ======================
===================== 3 passed, 1 deselected in 0.12s ======================

Or to select "http" and "quick" tests:

Expand All @@ -192,7 +192,7 @@ Or to select "http" and "quick" tests:
test_server.py::test_send_http PASSED [ 50%]
test_server.py::test_something_quick PASSED [100%]

===================== 2 passed, 2 deselected in 0.01s ======================
===================== 2 passed, 2 deselected in 0.12s ======================

.. note::

Expand Down Expand Up @@ -413,7 +413,7 @@ the test needs:

test_someenv.py s [100%]

============================ 1 skipped in 0.00s ============================
============================ 1 skipped in 0.12s ============================

and here is one that specifies exactly the environment needed:

Expand All @@ -428,7 +428,7 @@ and here is one that specifies exactly the environment needed:

test_someenv.py . [100%]

============================ 1 passed in 0.01s =============================
============================ 1 passed in 0.12s =============================

The ``--markers`` option always gives you a list of available markers:

Expand Down Expand Up @@ -499,7 +499,7 @@ The output is as follows:
$ pytest -q -s
Mark(name='my_marker', args=(<function hello_world at 0xdeadbeef>,), kwargs={})
.
1 passed in 0.00s
1 passed in 0.01s

We can see that the custom marker has its argument set extended with the function ``hello_world``. This is the key difference between creating a custom marker as a callable, which invokes ``__call__`` behind the scenes, and using ``with_args``.

Expand Down Expand Up @@ -551,7 +551,7 @@ Let's run this without capturing output and see what we get:
glob args=('class',) kwargs={'x': 2}
glob args=('module',) kwargs={'x': 1}
.
1 passed in 0.01s
1 passed in 0.02s

marking platform specific tests with pytest
--------------------------------------------------------------
Expand Down Expand Up @@ -623,7 +623,7 @@ then you will see two tests skipped and two executed tests as expected:

========================= short test summary info ==========================
SKIPPED [2] $REGENDOC_TMPDIR/conftest.py:13: cannot run on platform linux
======================= 2 passed, 2 skipped in 0.01s =======================
======================= 2 passed, 2 skipped in 0.12s =======================

Note that if you specify a platform via the marker-command line option like this:

Expand All @@ -638,7 +638,7 @@ Note that if you specify a platform via the marker-command line option like this

test_plat.py . [100%]

===================== 1 passed, 3 deselected in 0.01s ======================
===================== 1 passed, 3 deselected in 0.12s ======================

then the unmarked-tests will not be run. It is thus a way to restrict the run to the specific tests.

Expand Down Expand Up @@ -711,7 +711,7 @@ We can now use the ``-m option`` to select one set:
test_module.py:8: in test_interface_complex
assert 0
E assert 0
===================== 2 failed, 2 deselected in 0.02s ======================
===================== 2 failed, 2 deselected in 0.12s ======================

or to select both "event" and "interface" tests:

Expand Down Expand Up @@ -739,4 +739,4 @@ or to select both "event" and "interface" tests:
test_module.py:12: in test_event_simple
assert 0
E assert 0
===================== 3 failed, 1 deselected in 0.03s ======================
===================== 3 failed, 1 deselected in 0.12s ======================
6 changes: 3 additions & 3 deletions doc/en/example/nonpython.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ now execute the test specification:
usecase execution failed
spec failed: 'some': 'other'
no further details known at this point.
======================= 1 failed, 1 passed in 0.02s ========================
======================= 1 failed, 1 passed in 0.12s ========================

.. regendoc:wipe

Expand Down Expand Up @@ -77,7 +77,7 @@ consulted when reporting in ``verbose`` mode:
usecase execution failed
spec failed: 'some': 'other'
no further details known at this point.
======================= 1 failed, 1 passed in 0.02s ========================
======================= 1 failed, 1 passed in 0.12s ========================

.. regendoc:wipe

Expand All @@ -97,4 +97,4 @@ interesting to just look at the collection tree:
<YamlItem hello>
<YamlItem ok>

========================== no tests ran in 0.02s ===========================
========================== no tests ran in 0.12s ===========================
Loading