Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into robholt/fixture-c…
Browse files Browse the repository at this point in the history
…lass-instance
  • Loading branch information
nicoddemus committed Aug 30, 2019
2 parents 3ddbc7f + 01082fe commit 955dc6d
Show file tree
Hide file tree
Showing 48 changed files with 624 additions and 418 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
hooks:
- id: flake8
language_version: python3
additional_dependencies: [flake8-typing-imports]
additional_dependencies: [flake8-typing-imports==1.3.0]
- repo: https://github.com/asottile/reorder_python_imports
rev: v1.4.0
hooks:
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ jobs:
python: 'pypy3'

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

# Coverage for:
# - pytester's LsofFdLeakChecker
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Charnjit SiNGH (CCSJ)
Chris Lamb
Christian Boelsen
Christian Fetzer
Christian Neumüller
Christian Theunert
Christian Tismer
Christopher Gilling
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ with advance notice in the **Deprecations** section of releases.
.. towncrier release notes start
pytest 5.1.1 (2019-08-20)
=========================

Bug Fixes
---------

- `#5751 <https://github.com/pytest-dev/pytest/issues/5751>`_: Fixed ``TypeError`` when importing pytest on Python 3.5.0 and 3.5.1.


pytest 5.1.0 (2019-08-15)
=========================

Expand Down
1 change: 1 addition & 0 deletions changelog/5782.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix decoding error when printing an error response from ``--pastebin``.
2 changes: 2 additions & 0 deletions changelog/5786.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Chained exceptions in test and collection reports are now correctly serialized, allowing plugins like
``pytest-xdist`` to display them properly.
3 changes: 3 additions & 0 deletions changelog/5792.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
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``).
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.1
release-5.1.0
release-5.0.1
release-5.0.0
Expand Down
24 changes: 24 additions & 0 deletions doc/en/announce/release-5.1.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
pytest-5.1.1
=======================================

pytest 5.1.1 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:

* Anthony Sottile
* Bruno Oliveira
* Daniel Hahler
* Florian Bruhin
* Hugo van Kemenade
* Ran Benita
* Ronny Pfannschmidt


Happy testing,
The pytest Development Team
6 changes: 3 additions & 3 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.05s =============================
============================ 1 failed in 0.02s =============================
``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.05s =============================
============================ 1 failed in 0.02s =============================
Special comparisons are done for a number of cases:

Expand Down Expand Up @@ -279,7 +279,7 @@ the conftest file:
E vals: 1 != 2
test_foocompare.py:12: AssertionError
1 failed in 0.05s
1 failed in 0.02s
.. _assert-details:
.. _`assert introspection`:
Expand Down
2 changes: 1 addition & 1 deletion doc/en/builtin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
in python < 3.6 this is a pathlib2.Path
no tests ran in 0.01s
no tests ran in 0.00s
You can also interactively ask for help, e.g. by typing on the Python interactive prompt something like:

Expand Down
12 changes: 6 additions & 6 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.16s
2 failed, 48 passed in 0.08s
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.07s =====================
===================== 2 failed, 48 deselected in 0.02s =====================
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.15s =======================
======================= 2 failed, 48 passed in 0.07s =======================
.. _`config.cache`:

Expand Down Expand Up @@ -230,7 +230,7 @@ If you run this command for the first time, you can see the print statement:
test_caching.py:20: AssertionError
-------------------------- Captured stdout setup ---------------------------
running expensive computation...
1 failed in 0.05s
1 failed in 0.02s
If you run it a second time, the value will be retrieved from
the cache and nothing will be printed:
Expand All @@ -249,7 +249,7 @@ the cache and nothing will be printed:
E assert 42 == 23
test_caching.py:20: AssertionError
1 failed in 0.05s
1 failed in 0.02s
See the :ref:`cache-api` for more details.

Expand Down Expand Up @@ -300,7 +300,7 @@ filtering:
example/value contains:
42
========================== no tests ran in 0.01s ===========================
========================== no tests ran in 0.00s ===========================
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.05s ========================
======================= 1 failed, 1 passed in 0.02s ========================
Accessing captured output from a test function
---------------------------------------------------
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.02s =============================
============================ 1 passed in 0.01s =============================
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.03s =============================
============================ 2 passed in 0.01s =============================
You can make these changes permanent in your project by
putting them into a pytest.ini file like this:
Expand Down
18 changes: 9 additions & 9 deletions doc/en/example/markers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.02s ======================
===================== 3 passed, 1 deselected in 0.01s ======================
Selecting tests based on their node ID
--------------------------------------
Expand Down Expand Up @@ -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.02s =============================
============================ 2 passed in 0.01s =============================
.. _node-id:

Expand Down Expand Up @@ -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.02s ======================
===================== 3 passed, 1 deselected in 0.01s ======================
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.02s ======================
===================== 2 passed, 2 deselected in 0.01s ======================
.. note::

Expand Down Expand Up @@ -413,7 +413,7 @@ the test needs:
test_someenv.py s [100%]
============================ 1 skipped in 0.01s ============================
============================ 1 skipped in 0.00s ============================
and here is one that specifies exactly the environment needed:

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.01s
1 passed in 0.00s
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 @@ -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.02s =======================
======================= 2 passed, 2 skipped in 0.01s =======================
Note that if you specify a platform via the marker-command line option like this:

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.07s ======================
===================== 2 failed, 2 deselected in 0.02s ======================
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.07s ======================
===================== 3 failed, 1 deselected in 0.03s ======================
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.06s ========================
======================= 1 failed, 1 passed in 0.02s ========================
.. 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.07s ========================
======================= 1 failed, 1 passed in 0.02s ========================
.. 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.05s ===========================
========================== no tests ran in 0.02s ===========================
Loading

0 comments on commit 955dc6d

Please sign in to comment.