Merge pull request #3732 from nicoddemus/merge-master-into-features

Merge master into features
This commit is contained in:
Bruno Oliveira 2018-07-30 07:26:19 -03:00 committed by GitHub
commit 8af78f417f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 105 additions and 56 deletions

View File

@ -25,6 +25,10 @@ repos:
rev: v1.2.0
hooks:
- id: pyupgrade
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.0.0
hooks:
- id: rst-backticks
- repo: local
hooks:
- id: rst
@ -34,8 +38,3 @@ repos:
language: python
additional_dependencies: [pygments, restructuredtext_lint]
python_version: python3.6
- id: rst-backticks
name: rst ``code`` is two backticks
entry: ' `[^`]+[^_]`([^_]|$)'
language: pygrep
types: [rst]

View File

@ -8,7 +8,34 @@
.. towncrier release notes start
Pytest 3.6.3 (2018-07-04)
pytest 3.6.4 (2018-07-28)
=========================
Bug Fixes
---------
- Invoke pytest using ``-mpytest`` so ``sys.path`` does not get polluted by packages installed in ``site-packages``. (`#742 <https://github.com/pytest-dev/pytest/issues/742>`_)
Improved Documentation
----------------------
- Use ``smtp_connection`` instead of ``smtp`` in fixtures documentation to avoid possible confusion. (`#3592 <https://github.com/pytest-dev/pytest/issues/3592>`_)
Trivial/Internal Changes
------------------------
- Remove obsolete ``__future__`` imports. (`#2319 <https://github.com/pytest-dev/pytest/issues/2319>`_)
- Add CITATION to provide information on how to formally cite pytest. (`#3402 <https://github.com/pytest-dev/pytest/issues/3402>`_)
- Replace broken type annotations with type comments. (`#3635 <https://github.com/pytest-dev/pytest/issues/3635>`_)
- Pin ``pluggy`` to ``<0.8``. (`#3727 <https://github.com/pytest-dev/pytest/issues/3727>`_)
pytest 3.6.3 (2018-07-04)
=========================
Bug Fixes
@ -54,7 +81,7 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/3653>`_)
Pytest 3.6.2 (2018-06-20)
pytest 3.6.2 (2018-06-20)
=========================
Bug Fixes
@ -100,7 +127,7 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/3567>`_)
Pytest 3.6.1 (2018-06-05)
pytest 3.6.1 (2018-06-05)
=========================
Bug Fixes
@ -144,7 +171,7 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/3529>`_)
Pytest 3.6.0 (2018-05-23)
pytest 3.6.0 (2018-05-23)
=========================
Features
@ -230,7 +257,7 @@ Trivial/Internal Changes
3.7 or newer. (`#3497 <https://github.com/pytest-dev/pytest/issues/3497>`_)
Pytest 3.5.1 (2018-04-23)
pytest 3.5.1 (2018-04-23)
=========================
@ -282,7 +309,7 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/3398>`_)
Pytest 3.5.0 (2018-03-21)
pytest 3.5.0 (2018-03-21)
=========================
Deprecations and Removals
@ -434,7 +461,7 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/3308>`_)
Pytest 3.4.2 (2018-03-04)
pytest 3.4.2 (2018-03-04)
=========================
Bug Fixes
@ -471,7 +498,7 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/3259>`_)
Pytest 3.4.1 (2018-02-20)
pytest 3.4.1 (2018-02-20)
=========================
Bug Fixes
@ -532,7 +559,7 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/985>`_)
Pytest 3.4.0 (2018-01-30)
pytest 3.4.0 (2018-01-30)
=========================
Deprecations and Removals
@ -664,7 +691,7 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/3129>`_)
Pytest 3.3.2 (2017-12-25)
pytest 3.3.2 (2017-12-25)
=========================
Bug Fixes
@ -701,7 +728,7 @@ Trivial/Internal Changes
(`#3018 <https://github.com/pytest-dev/pytest/issues/3018>`_)
Pytest 3.3.1 (2017-12-05)
pytest 3.3.1 (2017-12-05)
=========================
Bug Fixes
@ -743,13 +770,13 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/2949>`_)
Pytest 3.3.0 (2017-11-23)
pytest 3.3.0 (2017-11-23)
=========================
Deprecations and Removals
-------------------------
- Pytest no longer supports Python **2.6** and **3.3**. Those Python versions
- pytest no longer supports Python **2.6** and **3.3**. Those Python versions
are EOL for some time now and incur maintenance and compatibility costs on
the pytest core team, and following up with the rest of the community we
decided that they will no longer be supported starting on this version. Users
@ -803,7 +830,7 @@ Features
- Match ``warns`` signature to ``raises`` by adding ``match`` keyword. (`#2708
<https://github.com/pytest-dev/pytest/issues/2708>`_)
- Pytest now captures and displays output from the standard ``logging`` module.
- pytest now captures and displays output from the standard ``logging`` module.
The user can control the logging level to be captured by specifying options
in ``pytest.ini``, the command line and also during individual tests using
markers. Also, a ``caplog`` fixture is available that enables users to test
@ -868,7 +895,7 @@ Bug Fixes
avoids a number of potential problems. (`#2751
<https://github.com/pytest-dev/pytest/issues/2751>`_)
- Pytest no longer complains about warnings with unicode messages being
- pytest no longer complains about warnings with unicode messages being
non-ascii compatible even for ascii-compatible messages. As a result of this,
warnings with unicode messages are converted first to an ascii representation
for safety. (`#2809 <https://github.com/pytest-dev/pytest/issues/2809>`_)
@ -920,7 +947,7 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/2922>`_)
Pytest 3.2.5 (2017-11-15)
pytest 3.2.5 (2017-11-15)
=========================
Bug Fixes
@ -931,7 +958,7 @@ Bug Fixes
<https://github.com/pytest-dev/pytest/issues/2926>`_)
Pytest 3.2.4 (2017-11-13)
pytest 3.2.4 (2017-11-13)
=========================
Bug Fixes
@ -980,7 +1007,7 @@ Improved Documentation
<https://github.com/pytest-dev/pytest/issues/911>`_)
Pytest 3.2.3 (2017-10-03)
pytest 3.2.3 (2017-10-03)
=========================
Bug Fixes
@ -1020,7 +1047,7 @@ Trivial/Internal Changes
(`#2765 <https://github.com/pytest-dev/pytest/issues/2765>`_)
Pytest 3.2.2 (2017-09-06)
pytest 3.2.2 (2017-09-06)
=========================
Bug Fixes
@ -1067,7 +1094,7 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/2739>`_)
Pytest 3.2.1 (2017-08-08)
pytest 3.2.1 (2017-08-08)
=========================
Bug Fixes
@ -1097,7 +1124,7 @@ Improved Documentation
<https://github.com/pytest-dev/pytest/issues/2626>`_)
Pytest 3.2.0 (2017-07-30)
pytest 3.2.0 (2017-07-30)
=========================
Deprecations and Removals
@ -1263,7 +1290,7 @@ Trivial/Internal Changes
<https://github.com/pytest-dev/pytest/issues/2620>`_)
Pytest 3.1.3 (2017-07-03)
pytest 3.1.3 (2017-07-03)
=========================
Bug Fixes
@ -1309,7 +1336,7 @@ Trivial/Internal Changes
(`#2499 <https://github.com/pytest-dev/pytest/issues/2499>`_)
Pytest 3.1.2 (2017-06-08)
pytest 3.1.2 (2017-06-08)
=========================
Bug Fixes
@ -1341,7 +1368,7 @@ Improved Documentation
and improve overall flow of the ``skipping`` docs. (#810)
Pytest 3.1.1 (2017-05-30)
pytest 3.1.1 (2017-05-30)
=========================
Bug Fixes

View File

@ -1 +0,0 @@
Remove obsolete ``__future__`` imports.

View File

@ -1 +0,0 @@
Add CITATION to provide information on how to formally cite pytest.

View File

@ -1 +0,0 @@
Use ``smtp_connection`` instead of ``smtp`` in fixtures documentation to avoid possible confusion.

View File

@ -1 +0,0 @@
Replace broken type annotations with type comments.

View File

@ -1 +0,0 @@
Invoke pytest using ``-mpytest`` so ``sys.path`` does not get polluted by packages installed in ``site-packages``.

View File

@ -6,6 +6,7 @@ Release announcements
:maxdepth: 2
release-3.6.4
release-3.6.3
release-3.6.2
release-3.6.1

View File

@ -0,0 +1,24 @@
pytest-3.6.4
=======================================
pytest 3.6.4 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 http://doc.pytest.org/en/latest/changelog.html.
Thanks to all who contributed to this release, among them:
* Anthony Sottile
* Bernhard M. Wiedemann
* Bruno Oliveira
* Drew
* E Hershey
* Hugo Martins
* Vlad Shcherbina
Happy testing,
The pytest Development Team

View File

@ -65,7 +65,7 @@ master_doc = "contents"
# General information about the project.
project = u"pytest"
year = datetime.datetime.utcnow().year
copyright = u"2015{} , holger krekel and pytest-dev team".format(year)
copyright = u"20152018 , holger krekel and pytest-dev team"
# The language for content autogenerated by Sphinx. Refer to documentation

View File

@ -139,7 +139,7 @@ line options while the environment is in use::
Here's how the command-line is built in the presence of ``addopts`` or the environment variable::
<pytest.ini:addopts> $PYTEST_ADDOTPS <extra command-line arguments>
<pytest.ini:addopts> $PYTEST_ADDOPTS <extra command-line arguments>
So if the user executes in the command-line::

View File

@ -411,8 +411,10 @@ is to be run with different sets of arguments for its three arguments:
Running it results in some skips if we don't have all the python interpreters installed and otherwise runs all combinations (5 interpreters times 5 interpreters times 3 objects to serialize/deserialize)::
. $ pytest -rs -q multipython.py
........................... [100%]
27 passed in 0.12 seconds
...sss...sssssssss...sss... [100%]
========================= short test summary info ==========================
SKIP [15] $REGENDOC_TMPDIR/CWD/multipython.py:28: 'python3.4' not found
12 passed, 15 skipped in 0.12 seconds
Indirect parametrization of optional implementations/imports
--------------------------------------------------------------------

View File

@ -416,7 +416,7 @@ Now we can profile which test functions execute the slowest::
========================= slowest 3 test durations =========================
0.30s call test_some_are_slow.py::test_funcslow2
0.20s call test_some_are_slow.py::test_funcslow1
0.13s call test_some_are_slow.py::test_funcfast
0.10s call test_some_are_slow.py::test_funcfast
========================= 3 passed in 0.12 seconds =========================
incremental testing - test steps

View File

@ -552,7 +552,7 @@ Parametrizing fixtures
Fixture functions can be parametrized in which case they will be called
multiple times, each time executing the set of dependent tests, i. e. the
tests that depend on this fixture. Test functions do usually not need
tests that depend on this fixture. Test functions usually do not need
to be aware of their re-running. Fixture parametrization helps to
write exhaustive functional tests for components which themselves can be
configured in multiple ways.
@ -779,10 +779,10 @@ Here we declare an ``app`` fixture which receives the previously defined
========================= 2 passed in 0.12 seconds =========================
Due to the parametrization of ``smtp_connection`` the test will run twice with two
Due to the parametrization of ``smtp_connection``, the test will run twice with two
different ``App`` instances and respective smtp servers. There is no
need for the ``app`` fixture to be aware of the ``smtp_connection``
parametrization as pytest will fully analyse the fixture dependency graph.
parametrization because pytest will fully analyse the fixture dependency graph.
Note, that the ``app`` fixture has a scope of ``module`` and uses a
module-scoped ``smtp_connection`` fixture. The example would still work if
@ -805,7 +805,7 @@ first execute with one instance and then finalizers are called
before the next fixture instance is created. Among other things,
this eases testing of applications which create and use global state.
The following example uses two parametrized fixture, one of which is
The following example uses two parametrized fixtures, one of which is
scoped on a per-module basis, and all the functions perform ``print`` calls
to show the setup/teardown flow::

View File

@ -57,15 +57,15 @@ Marker revamp and iteration
.. versionadded:: 3.6
pytest's marker implementation traditionally worked by simply updating the ``__dict__`` attribute of functions to add markers, in a cumulative manner. As a result of the this, markers would unintendely be passed along class hierarchies in surprising ways plus the API for retriving them was inconsistent, as markers from parameterization would be stored differently than markers applied using the ``@pytest.mark`` decorator and markers added via ``node.add_marker``.
pytest's marker implementation traditionally worked by simply updating the ``__dict__`` attribute of functions to cumulatively add markers. As a result, markers would unintentionally be passed along class hierarchies in surprising ways. Further, the API for retrieving them was inconsistent, as markers from parameterization would be stored differently than markers applied using the ``@pytest.mark`` decorator and markers added via ``node.add_marker``.
This state of things made it technically next to impossible to use data from markers correctly without having a deep understanding of the internals, leading to subtle and hard to understand bugs in more advanced usages.
Depending on how a marker got declared/changed one would get either a ``MarkerInfo`` which might contain markers from sibling classes,
``MarkDecorators`` when marks came from parameterization or from a ``node.add_marker`` call, discarding prior marks. Also ``MarkerInfo`` acts like a single mark, when it in fact represents a merged view on multiple marks with the same name.
On top of that markers where not accessible the same way for modules, classes, and functions/methods,
in fact, markers where only accessible in functions, even if they where declared on classes/modules.
On top of that markers were not accessible the same way for modules, classes, and functions/methods.
In fact, markers were only accessible in functions, even if they were declared on classes/modules.
A new API to access markers has been introduced in pytest 3.6 in order to solve the problems with the initial design, providing :func:`_pytest.nodes.Node.iter_markers` method to iterate over markers in a consistent manner and reworking the internals, which solved great deal of problems with the initial design.
@ -83,7 +83,7 @@ In general there are two scenarios on how markers should be handled:
1. Marks overwrite each other. Order matters but you only want to think of your mark as a single item. E.g.
``log_level('info')`` at a module level can be overwritten by ``log_level('debug')`` for a specific test.
In this case replace use ``Node.get_closest_marker(name)``:
In this case, use ``Node.get_closest_marker(name)``:
.. code-block:: python
@ -97,7 +97,7 @@ In general there are two scenarios on how markers should be handled:
if marker:
level = marker.args[0]
2. Marks compose additive. E.g. ``skipif(condition)`` marks means you just want to evaluate all of them,
2. Marks compose in an additive manner. E.g. ``skipif(condition)`` marks mean you just want to evaluate all of them,
order doesn't even matter. You probably want to think of your marks as a set here.
In this case iterate over each mark and handle their ``*args`` and ``**kwargs`` individually.
@ -127,27 +127,27 @@ Here is a non-exhaustive list of issues fixed by the new implementation:
* Marks don't pick up nested classes (`#199 <https://github.com/pytest-dev/pytest/issues/199>`_).
* markers stains on all related classes (`#568 <https://github.com/pytest-dev/pytest/issues/568>`_).
* Markers stain on all related classes (`#568 <https://github.com/pytest-dev/pytest/issues/568>`_).
* combining marks - args and kwargs calculation (`#2897 <https://github.com/pytest-dev/pytest/issues/2897>`_).
* Combining marks - args and kwargs calculation (`#2897 <https://github.com/pytest-dev/pytest/issues/2897>`_).
* ``request.node.get_marker('name')`` returns ``None`` for markers applied in classes (`#902 <https://github.com/pytest-dev/pytest/issues/902>`_).
* marks applied in parametrize are stored as markdecorator (`#2400 <https://github.com/pytest-dev/pytest/issues/2400>`_).
* Marks applied in parametrize are stored as markdecorator (`#2400 <https://github.com/pytest-dev/pytest/issues/2400>`_).
* fix marker interaction in a backward incompatible way (`#1670 <https://github.com/pytest-dev/pytest/issues/1670>`_).
* Fix marker interaction in a backward incompatible way (`#1670 <https://github.com/pytest-dev/pytest/issues/1670>`_).
* Refactor marks to get rid of the current "marks transfer" mechanism (`#2363 <https://github.com/pytest-dev/pytest/issues/2363>`_).
* Introduce FunctionDefinition node, use it in generate_tests (`#2522 <https://github.com/pytest-dev/pytest/issues/2522>`_).
* remove named marker attributes and collect markers in items (`#891 <https://github.com/pytest-dev/pytest/issues/891>`_).
* Remove named marker attributes and collect markers in items (`#891 <https://github.com/pytest-dev/pytest/issues/891>`_).
* skipif mark from parametrize hides module level skipif mark (`#1540 <https://github.com/pytest-dev/pytest/issues/1540>`_).
* skipif + parametrize not skipping tests (`#1296 <https://github.com/pytest-dev/pytest/issues/1296>`_).
* marker transfer incompatible with inheritance (`#535 <https://github.com/pytest-dev/pytest/issues/535>`_).
* Marker transfer incompatible with inheritance (`#535 <https://github.com/pytest-dev/pytest/issues/535>`_).
More details can be found in the `original PR <https://github.com/pytest-dev/pytest/pull/3317>`_.

View File

@ -787,7 +787,7 @@ TestReport
_Result
~~~~~~~
.. autoclass:: pluggy._Result
.. autoclass:: pluggy.callers._Result
:members:
Special Variables

View File

@ -10,6 +10,7 @@ package = "pytest"
package_dir = "src"
filename = "CHANGELOG.rst"
directory = "changelog/"
title_format = "pytest {version} ({project_date})"
template = "changelog/_template.rst"
[[tool.towncrier.type]]

View File

@ -69,7 +69,7 @@ def main():
# if _PYTEST_SETUP_SKIP_PLUGGY_DEP is set, skip installing pluggy;
# used by tox.ini to test with pluggy master
if "_PYTEST_SETUP_SKIP_PLUGGY_DEP" not in os.environ:
install_requires.append("pluggy>=0.5,<0.7")
install_requires.append("pluggy>=0.5,<0.8")
environment_marker_support_level = get_environment_marker_support_level()
if environment_marker_support_level >= 2:
install_requires.append('funcsigs;python_version<"3.0"')