Skip to content
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

Update pytest to 4.3.1 #98

wants to merge 1 commit into
base: master


None yet
1 participant
Copy link

pyup-bot commented Mar 12, 2019

This PR updates pytest from 4.0.1 to 4.3.1.





- `4724 <>`_: ``pytest.warns()`` now emits a warning when it receives unknown keyword arguments.

This will be changed into an error in the future.


- `2753 <>`_: Usage errors from argparse are mapped to pytest's ``UsageError``.

- `3711 <>`_: Add the ``--ignore-glob`` parameter to exclude test-modules with Unix shell-style wildcards.
Add the ``collect_ignore_glob`` for ```` to exclude test-modules with Unix shell-style wildcards.

- `4698 <>`_: The warning about Python 2.7 and 3.4 not being supported in pytest 5.0 has been removed.

In the end it was considered to be more
of a nuisance than actual utility and users of those Python versions shouldn't have problems as ``pip`` will not
install pytest 5.0 on those interpreters.

- `4707 <>`_: With the help of new ``set_log_path()`` method there is a way to set ``log_file`` paths from hooks.

Bug Fixes

- `4651 <>`_: ``--help`` and ``--version`` are handled with ``UsageError``.

- `4782 <>`_: Fix ``AssertionError`` with collection of broken symlinks with packages.



Bug Fixes

- `2895 <>`_: The ``pytest_report_collectionfinish`` hook now is also called with ``--collect-only``.

- `3899 <>`_: Do not raise ``UsageError`` when an imported package has a ```` child module.

- `4347 <>`_: Fix output capturing when using pdb++ with recursive debugging.

- `4592 <>`_: Fix handling of ``collect_ignore`` via parent ````.

- `4700 <>`_: Fix regression where ``setUpClass`` would always be called in subclasses even if all tests
were skipped by a ``unittest.skip()`` decorator applied in the subclass.

- `4739 <>`_: Fix ``parametrize(... ids=<function>)`` when the function returns non-strings.

- `4745 <>`_: Fix/improve collection of args when passing in ```` and a test file.

- `4770 <>`_: ``more_itertools`` is now constrained to <6.0.0 when required for Python 2.7 compatibility.

- `526 <>`_: Fix "ValueError: Plugin already registered" exceptions when running in build directories that symlink to actual source.

Improved Documentation

- `3899 <>`_: Add note to ``plugins.rst`` that ``pytest_plugins`` should not be used as a name for a user module containing plugins.

- `4324 <>`_: Document how to use ``raises`` and ``does_not_raise`` to write parametrized tests with conditional raises.

- `4709 <>`_: Document how to customize test failure messages when using

Trivial/Internal Changes

- `4741 <>`_: Some verbosity related attributes of the TerminalReporter plugin are now
read only properties.




- `3094 <>`_: `Classic xunit-style <>`__ functions and methods
now obey the scope of *autouse* fixtures.

This fixes a number of surprising issues like ``setup_method`` being called before session-scoped
autouse fixtures (see `517 <>`__ for an example).

- `4627 <>`_: Display a message at the end of the test session when running under Python 2.7 and 3.4 that pytest 5.0 will no longer
support those Python versions.

- `4660 <>`_: The number of *selected* tests now are also displayed when the ``-k`` or ``-m`` flags are used.

- `4688 <>`_: ``pytest_report_teststatus`` hook now can also receive a ``config`` parameter.

- `4691 <>`_: ``pytest_terminal_summary`` hook now can also receive a ``config`` parameter.

Bug Fixes

- `3547 <>`_: ``--junitxml`` can emit XML compatible with Jenkins xUnit.
``junit_family`` INI option accepts ``legacy|xunit1``, which produces old style output, and ``xunit2`` that conforms more strictly to

- `4280 <>`_: Improve quitting from pdb, especially with ``--trace``.

Using ``q[quit]`` after ``pdb.set_trace()`` will quit pytest also.

- `4402 <>`_: Warning summary now groups warnings by message instead of by test id.

This makes the output more compact and better conveys the general idea of how much code is
actually generating warnings, instead of how many tests call that code.

- `4536 <>`_: ``monkeypatch.delattr`` handles class descriptors like ``staticmethod``/``classmethod``.

- `4649 <>`_: Restore marks being considered keywords for keyword expressions.

- `4653 <>`_: ``tmp_path`` fixture and other related ones provides resolved path (a.k.a real path)

- `4667 <>`_: ``pytest_terminal_summary`` uses result from ``pytest_report_teststatus`` hook, rather than hardcoded strings.

- `4669 <>`_: Correctly handle ``unittest.SkipTest`` exception containing non-ascii characters on Python 2.

- `4680 <>`_: Ensure the ``tmpdir`` and the ``tmp_path`` fixtures are the same folder.

- `4681 <>`_: Ensure ``tmp_path`` is always a real path.

Trivial/Internal Changes

- `4643 <>`_: Use ``a.item()`` instead of the deprecated ``np.asscalar(a)`` in ``pytest.approx``.

``np.asscalar`` has been `deprecated <>`__ in ``numpy 1.16.``.

- `4657 <>`_: Copy saferepr from pylib

- `4668 <>`_: The verbose word for expected failures in the teststatus report changes from ``xfail`` to ``XFAIL`` to be consistent with other test outcomes.



Bug Fixes

- `2256 <>`_: Show full repr with ``assert a==b`` and ``-vv``.

- `3456 <>`_: Extend Doctest-modules to ignore mock objects.

- `4617 <>`_: Fixed ``pytest.warns`` bug when context manager is reused (e.g. multiple parametrization).

- `4631 <>`_: Don't rewrite assertion when ``__getattr__`` is broken

Improved Documentation

- `3375 <>`_: Document that using ``setup.cfg`` may crash other tools or cause hard to track down problems because it uses a different parser than ``pytest.ini`` or ``tox.ini`` files.

Trivial/Internal Changes

- `4602 <>`_: Uninstall ``hypothesis`` in regen tox env.




- `2169 <>`_: ``pytest.mark.parametrize``: in previous versions, errors raised by id functions were suppressed and changed into warnings. Now the exceptions are propagated, along with a pytest message informing the node, parameter value and index where the exception occurred.

- `3078 <>`_: Remove legacy internal warnings system: ``config.warn``, ``Node.warn``. The ``pytest_logwarning`` now issues a warning when implemented.

See our `docs <>`__ on information on how to update your code.

- `3079 <>`_: Removed support for yield tests - they are fundamentally broken because they don't support fixtures properly since collection and test execution were separated.

See our `docs <>`__ on information on how to update your code.

- `3082 <>`_: Removed support for applying marks directly to values in ``pytest.mark.parametrize``. Use ``pytest.param`` instead.

See our `docs <>`__ on information on how to update your code.

- `3083 <>`_: Removed ``Metafunc.addcall``. This was the predecessor mechanism to ``pytest.mark.parametrize``.

See our `docs <>`__ on information on how to update your code.

- `3085 <>`_: Removed support for passing strings to ``pytest.main``. Now, always pass a list of strings instead.

See our `docs <>`__ on information on how to update your code.

- `3086 <>`_: ``[pytest]`` section in **setup.cfg** files is not longer supported, use ``[tool:pytest]`` instead. ``setup.cfg`` files
are meant for use with ``distutils``, and a section named ``pytest`` has notoriously been a source of conflicts and bugs.

Note that for **pytest.ini** and **tox.ini** files the section remains ``[pytest]``.

- `3616 <>`_: Removed the deprecated compat properties for ``node.Class/Function/Module`` - use ``pytest.Class/Function/Module`` now.

See our `docs <>`__ on information on how to update your code.

- `4421 <>`_: Removed the implementation of the ``pytest_namespace`` hook.

See our `docs <>`__ on information on how to update your code.

- `4489 <>`_: Removed ``request.cached_setup``. This was the predecessor mechanism to modern fixtures.

See our `docs <>`__ on information on how to update your code.

- `4535 <>`_: Removed the deprecated ``PyCollector.makeitem`` method. This method was made public by mistake a long time ago.

- `4543 <>`_: Removed support to define fixtures using the ``pytest_funcarg__`` prefix. Use the ``pytest.fixture`` decorator instead.

See our `docs <>`__ on information on how to update your code.

- `4545 <>`_: Calling fixtures directly is now always an error instead of a warning.

See our `docs <>`__ on information on how to update your code.

- `4546 <>`_: Remove ``Node.get_marker(name)`` the return value was not usable for more than a existence check.

Use ``Node.get_closest_marker(name)`` as a replacement.

- `4547 <>`_: The deprecated ``record_xml_property`` fixture has been removed, use the more generic ``record_property`` instead.

See our `docs <>`__ for more information.

- `4548 <>`_: An error is now raised if the ``pytest_plugins`` variable is defined in a non-top-level ```` file (i.e., not residing in the ``rootdir``).

See our `docs <>`__ for more information.

- `891 <>`_: Remove ``testfunction.markername`` attributes - use ``Node.iter_markers(name=None)`` to iterate them.


- `3050 <>`_: Deprecated the ``pytest.config`` global.

See for rationale.

- `3974 <>`_: Passing the ``message`` parameter of ``pytest.raises`` now issues a ``DeprecationWarning``.

It is a common mistake to think this parameter will match the exception message, while in fact
it only serves to provide a custom message in case the ``pytest.raises`` check fails. To avoid this
mistake and because it is believed to be little used, pytest is deprecating it without providing
an alternative for the moment.

If you have concerns about this, please comment on `issue 3974 <>`__.

- `4435 <>`_: Deprecated ``raises(..., 'code(as_a_string)')`` and ``warns(..., 'code(as_a_string)')``.

See for rationale and examples.


- `3191 <>`_: A warning is now issued when assertions are made for ``None``.

This is a common source of confusion among new users, which write:

.. code-block:: python

   assert mocked_object.assert_called_with(3, 4, 5, key="value")

When they should write:

.. code-block:: python

   mocked_object.assert_called_with(3, 4, 5, key="value")

Because the ``assert_called_with`` method of mock objects already executes an assertion.

This warning will not be issued when ``None`` is explicitly checked. An assertion like:

.. code-block:: python

   assert variable is None

will not issue the warning.

- `3632 <>`_: Richer equality comparison introspection on ``AssertionError`` for objects created using `attrs <>`__ or `dataclasses <>`_ (Python 3.7+, `backported to 3.6 <>`__).

- `4278 <>`_: ``CACHEDIR.TAG`` files are now created inside cache directories.

Those files are part of the `Cache Directory Tagging Standard <>`__, and can
be used by backup or synchronization programs to identify pytest's cache directory as such.

- `4292 <>`_: ``pytest.outcomes.Exit`` is derived from ``SystemExit`` instead of ``KeyboardInterrupt``. This allows us to better handle ``pdb`` exiting.

- `4371 <>`_: Updated the ``--collect-only`` option to display test descriptions when ran using ``--verbose``.

- `4386 <>`_: Restructured ``ExceptionInfo`` object construction and ensure incomplete instances have a ``repr``/``str``.

- `4416 <>`_: pdb: added support for keyword arguments with ``pdb.set_trace``.

It handles ``header`` similar to Python 3.7 does it, and forwards any
other keyword arguments to the ``Pdb`` constructor.

This allows for ``__import__("pdb").set_trace(skip=["foo.*"])``.

- `4483 <>`_: Added ini parameter ``junit_duration_report`` to optionally report test call durations, excluding setup and teardown times.

The JUnit XML specification and the default pytest behavior is to include setup and teardown times in the test duration
report. You can include just the call durations instead (excluding setup and teardown) by adding this to your ``pytest.ini`` file:

.. code-block:: ini

   junit_duration_report = call

- `4532 <>`_: ``-ra`` now will show errors and failures last, instead of as the first items in the summary.

This makes it easier to obtain a list of errors and failures to run tests selectively.

- `4599 <>`_: ``pytest.importorskip`` now supports a ``reason`` parameter, which will be shown when the
requested module cannot be imported.

Bug Fixes

- `3532 <>`_: ``-p`` now accepts its argument without a space between the value, for example ``-pmyplugin``.

- `4327 <>`_: ``approx`` again works with more generic containers, more precisely instances of ``Iterable`` and ``Sized`` instead of more restrictive ``Sequence``.

- `4397 <>`_: Ensure that node ids are printable.

- `4435 <>`_: Fixed ``raises(..., 'code(string)')`` frame filename.

- `4458 <>`_: Display actual test ids in ``--collect-only``.

Improved Documentation

- `4557 <>`_: Markers example documentation page updated to support latest pytest version.

- `4558 <>`_: Update cache documentation example to correctly show cache hit and miss.

- `4580 <>`_: Improved detailed summary report documentation.

Trivial/Internal Changes

- `4447 <>`_: Changed the deprecation type of ``--result-log`` to ``PytestDeprecationWarning``.

It was decided to remove this feature at the next major revision.



Bug Fixes

- `4265 <>`_: Validate arguments from the ``PYTEST_ADDOPTS`` environment variable and the ``addopts`` ini option separately.

- `4435 <>`_: Fix ``raises(..., 'code(string)')`` frame filename.

- `4500 <>`_: When a fixture yields and a log call is made after the test runs, and, if the test is interrupted, capture attributes are ``None``.

- `4538 <>`_: Raise ``TypeError`` for ``with raises(..., match=<non-None falsey value>)``.

Improved Documentation

- `1495 <>`_: Document common doctest fixture directory tree structure pitfalls

@pyup-bot pyup-bot referenced this pull request Mar 12, 2019


Update pytest to 4.3.0 #93


This comment has been minimized.

Copy link

codecov bot commented Mar 12, 2019

Codecov Report

Merging #98 into master will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #98      +/-   ##
- Coverage   81.87%   81.81%   -0.06%     
  Files          45       45              
  Lines        1848     1848              
- Hits         1513     1512       -1     
- Misses        335      336       +1
Impacted Files Coverage Δ
honeycomb/servicemanager/ 58.91% <0%> (-0.78%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 33ea91b...cf98d06. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.