Skip to content

Merge master into features #5248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ repos:
- id: rst
name: rst
entry: rst-lint --encoding utf-8
files: ^(CHANGELOG.rst|HOWTORELEASE.rst|README.rst|changelog/.*)$
files: ^(CHANGELOG.rst|HOWTORELEASE.rst|README.rst|TIDELIFT.rst|changelog/.*)$
language: python
additional_dependencies: [pygments, restructuredtext_lint]
- id: changelogs-rst
Expand Down
133 changes: 133 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,139 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start

pytest 4.5.0 (2019-05-11)
=========================

Features
--------

- `#4826 <https://github.com/pytest-dev/pytest/issues/4826>`_: A warning is now emitted when unknown marks are used as a decorator.
This is often due to a typo, which can lead to silently broken tests.


- `#4907 <https://github.com/pytest-dev/pytest/issues/4907>`_: Show XFail reason as part of JUnitXML message field.


- `#5013 <https://github.com/pytest-dev/pytest/issues/5013>`_: Messages from crash reports are displayed within test summaries now, truncated to the terminal width.


- `#5023 <https://github.com/pytest-dev/pytest/issues/5023>`_: New flag ``--strict-markers`` that triggers an error when unknown markers (e.g. those not registered using the `markers option`_ in the configuration file) are used in the test suite.

The existing ``--strict`` option has the same behavior currently, but can be augmented in the future for additional checks.

.. _`markers option`: https://docs.pytest.org/en/latest/reference.html#confval-markers


- `#5026 <https://github.com/pytest-dev/pytest/issues/5026>`_: Assertion failure messages for sequences and dicts contain the number of different items now.


- `#5034 <https://github.com/pytest-dev/pytest/issues/5034>`_: Improve reporting with ``--lf`` and ``--ff`` (run-last-failure).


- `#5035 <https://github.com/pytest-dev/pytest/issues/5035>`_: The ``--cache-show`` option/action accepts an optional glob to show only matching cache entries.


- `#5059 <https://github.com/pytest-dev/pytest/issues/5059>`_: Standard input (stdin) can be given to pytester's ``Testdir.run()`` and ``Testdir.popen()``.


- `#5068 <https://github.com/pytest-dev/pytest/issues/5068>`_: The ``-r`` option learnt about ``A`` to display all reports (including passed ones) in the short test summary.


- `#5108 <https://github.com/pytest-dev/pytest/issues/5108>`_: The short test summary is displayed after passes with output (``-rP``).


- `#5172 <https://github.com/pytest-dev/pytest/issues/5172>`_: The ``--last-failed`` (``--lf``) option got smarter and will now skip entire files if all tests
of that test file have passed in previous runs, greatly speeding up collection.


- `#5177 <https://github.com/pytest-dev/pytest/issues/5177>`_: Introduce new specific warning ``PytestWarning`` subclasses to make it easier to filter warnings based on the class, rather than on the message. The new subclasses are:


* ``PytestAssertRewriteWarning``

* ``PytestCacheWarning``

* ``PytestCollectionWarning``

* ``PytestConfigWarning``

* ``PytestUnhandledCoroutineWarning``

* ``PytestUnknownMarkWarning``


- `#5202 <https://github.com/pytest-dev/pytest/issues/5202>`_: New ``record_testsuite_property`` session-scoped fixture allows users to log ``<property>`` tags at the ``testsuite``
level with the ``junitxml`` plugin.

The generated XML is compatible with the latest xunit standard, contrary to
the properties recorded by ``record_property`` and ``record_xml_attribute``.


- `#5214 <https://github.com/pytest-dev/pytest/issues/5214>`_: The default logging format has been changed to improve readability. Here is an
example of a previous logging message::

test_log_cli_enabled_disabled.py 3 CRITICAL critical message logged by test

This has now become::

CRITICAL root:test_log_cli_enabled_disabled.py:3 critical message logged by test

The formatting can be changed through the `log_format <https://docs.pytest.org/en/latest/reference.html#confval-log_format>`__ configuration option.


- `#5220 <https://github.com/pytest-dev/pytest/issues/5220>`_: ``--fixtures`` now also shows fixture scope for scopes other than ``"function"``.



Bug Fixes
---------

- `#5113 <https://github.com/pytest-dev/pytest/issues/5113>`_: Deselected items from plugins using ``pytest_collect_modifyitems`` as a hookwrapper are correctly reported now.


- `#5144 <https://github.com/pytest-dev/pytest/issues/5144>`_: With usage errors ``exitstatus`` is set to ``EXIT_USAGEERROR`` in the ``pytest_sessionfinish`` hook now as expected.


- `#5235 <https://github.com/pytest-dev/pytest/issues/5235>`_: ``outcome.exit`` is not used with ``EOF`` in the pdb wrapper anymore, but only with ``quit``.



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

- `#4935 <https://github.com/pytest-dev/pytest/issues/4935>`_: Expand docs on registering marks and the effect of ``--strict``.



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

- `#4942 <https://github.com/pytest-dev/pytest/issues/4942>`_: ``logging.raiseExceptions`` is not set to ``False`` anymore.


- `#5013 <https://github.com/pytest-dev/pytest/issues/5013>`_: pytest now depends on `wcwidth <https://pypi.org/project/wcwidth>`__ to properly track unicode character sizes for more precise terminal output.


- `#5059 <https://github.com/pytest-dev/pytest/issues/5059>`_: pytester's ``Testdir.popen()`` uses ``stdout`` and ``stderr`` via keyword arguments with defaults now (``subprocess.PIPE``).


- `#5069 <https://github.com/pytest-dev/pytest/issues/5069>`_: The code for the short test summary in the terminal was moved to the terminal plugin.


- `#5082 <https://github.com/pytest-dev/pytest/issues/5082>`_: Improved validation of kwargs for various methods in the pytester plugin.


- `#5202 <https://github.com/pytest-dev/pytest/issues/5202>`_: ``record_property`` now emits a ``PytestWarning`` when used with ``junit_family=xunit2``: the fixture generates
``property`` tags as children of ``testcase``, which is not permitted according to the most
`recent schema <https://github.com/jenkinsci/xunit-plugin/blob/master/
src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd>`__.


- `#5239 <https://github.com/pytest-dev/pytest/issues/5239>`_: Pin ``pluggy`` to ``< 1.0`` so we don't update to ``1.0`` automatically when
it gets released: there are planned breaking changes, and we want to ensure
pytest properly supports ``pluggy 1.0``.


pytest 4.4.2 (2019-05-08)
=========================

Expand Down
20 changes: 20 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,26 @@ Changelog
Consult the `Changelog <https://docs.pytest.org/en/latest/changelog.html>`__ page for fixes and enhancements of each version.


Support pytest
--------------

You can support pytest by obtaining a `Tideflift subscription`_.

Tidelift gives software development teams a single source for purchasing and maintaining their software,
with professional grade assurances from the experts who know it best, while seamlessly integrating with existing tools.


.. _`Tideflift subscription`: https://tidelift.com/subscription/pkg/pypi-pytest?utm_source=pypi-pytest&utm_medium=referral&utm_campaign=readme


Security
^^^^^^^^

pytest has never been associated with a security vunerability, but in any case, to report a
security vulnerability please use the `Tidelift security contact <https://tidelift.com/security>`_.
Tidelift will coordinate the fix and disclosure.


License
-------

Expand Down
57 changes: 57 additions & 0 deletions TIDELIFT.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
========
Tidelift
========

pytest is a member of `Tidelift`_. This document describes how the core team manages
Tidelift-related activities.

What is it
==========

Tidelift aims to make Open Source sustainable by offering subscriptions to companies which rely
on Open Source packages. This subscription allows it to pay maintainers of those Open Source
packages to aid sustainability of the work.

Funds
=====

It was decided in the `mailing list`_ that the Tidelift contribution will be split evenly between
members of the `contributors team`_ interested in receiving funding.

The current list of contributors receiving funding are:

* `@asottile`_
* `@blueyed`_
* `@nicoddemus`_

Contributors interested in receiving a part of the funds just need to submit a PR adding their
name to the list. Contributors that want to stop receiving the funds should also submit a PR
in the same way.

The PR should mention `@pytest-dev/tidelift-admins`_ so appropriate changes
can be made in the Tidelift platform.

After the PR has been accepted and merged, the contributor should register in the `Tidelift`_
platform and follow the instructions there, including signing an `agreement`_.

Admins
======

A few people have admin access to the Tidelift dashboard to make changes. Those people
are part of the `@pytest-dev/tidelift-admins`_ team.

`Core contributors`_ interested in helping out with Tidelift maintenance are welcome! We don't
expect much work here other than the occasional adding/removal of a contributor from receiving
funds. Just drop a line to one of the `@pytest-dev/tidelift-admins`_ or use the mailing list.


.. _`Tidelift`: https://tidelift.com
.. _`mailing list`: https://mail.python.org/pipermail/pytest-dev/2019-May/004716.html
.. _`contributors team`: https://github.com/orgs/pytest-dev/teams/contributors
.. _`core contributors`: https://github.com/orgs/pytest-dev/teams/core/members
.. _`@pytest-dev/tidelift-admins`: https://github.com/orgs/pytest-dev/teams/tidelift-admins/members
.. _`agreement`: https://tidelift.com/docs/lifting/agreement

.. _`@asottile`: https://github.com/asottile
.. _`@blueyed`: https://github.com/blueyed
.. _`@nicoddemus`: https://github.com/nicoddemus
2 changes: 0 additions & 2 deletions changelog/4826.feature.rst

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/5172.feature.rst

This file was deleted.

14 changes: 0 additions & 14 deletions changelog/5177.feature.rst

This file was deleted.

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

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/5202.trivial.rst

This file was deleted.

10 changes: 0 additions & 10 deletions changelog/5214.feature.rst

This file was deleted.

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

This file was deleted.

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

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/5239.trivial.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-4.5.0
release-4.4.2
release-4.4.1
release-4.4.0
Expand Down
35 changes: 35 additions & 0 deletions doc/en/announce/release-4.5.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
pytest-4.5.0
=======================================

The pytest team is proud to announce the 4.5.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
* Daniel Hahler
* Floris Bruynooghe
* Pulkit Goyal
* Samuel Searles-Bryant
* Zac Hatfield-Dodds
* Zac-HD


Happy testing,
The Pytest Development Team
14 changes: 14 additions & 0 deletions doc/en/builtin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,20 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
The fixture is callable with ``(name, value)``, with value being
automatically xml-encoded

record_testsuite_property [session scope]
Records a new ``<property>`` tag as child of the root ``<testsuite>``. This is suitable to
writing global information regarding the entire test suite, and is compatible with ``xunit2`` JUnit family.

This is a ``session``-scoped fixture which is called with ``(name, value)``. Example:

.. code-block:: python

def test_foo(record_testsuite_property):
record_testsuite_property("ARCH", "PPC")
record_testsuite_property("STORAGE_TYPE", "CEPH")

``name`` must be a string, ``value`` will be converted to a string and properly xml-escaped.

caplog
Access and control log capturing.

Expand Down
2 changes: 1 addition & 1 deletion doc/en/example/simple.rst
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ We can run this:
file $REGENDOC_TMPDIR/b/test_error.py, line 1
def test_root(db): # no db here, will error out
E fixture 'db' not found
> available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
> available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
> use 'pytest --fixtures [testpath]' for help on them.

$REGENDOC_TMPDIR/b/test_error.py:1
Expand Down