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.1.0 #50

Merged
merged 1 commit into from
Jan 7, 2019
Merged

Conversation

pyup-bot
Copy link
Collaborator

@pyup-bot pyup-bot commented Jan 7, 2019

This PR updates pytest from 3.10.0 to 4.1.0.

Changelog

4.1.0

=========================

Removals
--------

- `2169 <https://github.com/pytest-dev/pytest/issues/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 <https://github.com/pytest-dev/pytest/issues/3078>`_: Remove legacy internal warnings system: ``config.warn``, ``Node.warn``. The ``pytest_logwarning`` now issues a warning when implemented.

See our `docs <https://docs.pytest.org/en/latest/deprecations.htmlconfig-warn-and-node-warn>`__ on information on how to update your code.


- `3079 <https://github.com/pytest-dev/pytest/issues/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 <https://docs.pytest.org/en/latest/deprecations.htmlyield-tests>`__ on information on how to update your code.


- `3082 <https://github.com/pytest-dev/pytest/issues/3082>`_: Removed support for applying marks directly to values in ``pytest.mark.parametrize``. Use ``pytest.param`` instead.

See our `docs <https://docs.pytest.org/en/latest/deprecations.htmlmarks-in-pytest-mark-parametrize>`__ on information on how to update your code.


- `3083 <https://github.com/pytest-dev/pytest/issues/3083>`_: Removed ``Metafunc.addcall``. This was the predecessor mechanism to ``pytest.mark.parametrize``.

See our `docs <https://docs.pytest.org/en/latest/deprecations.htmlmetafunc-addcall>`__ on information on how to update your code.


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

See our `docs <https://docs.pytest.org/en/latest/deprecations.htmlpassing-command-line-string-to-pytest-main>`__ on information on how to update your code.


- `3086 <https://github.com/pytest-dev/pytest/issues/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 <https://github.com/pytest-dev/pytest/issues/3616>`_: Removed the deprecated compat properties for ``node.Class/Function/Module`` - use ``pytest.Class/Function/Module`` now.

See our `docs <https://docs.pytest.org/en/latest/deprecations.htmlinternal-classes-accessed-through-node>`__ on information on how to update your code.


- `4421 <https://github.com/pytest-dev/pytest/issues/4421>`_: Removed the implementation of the ``pytest_namespace`` hook.

See our `docs <https://docs.pytest.org/en/latest/deprecations.htmlpytest-namespace>`__ on information on how to update your code.


- `4489 <https://github.com/pytest-dev/pytest/issues/4489>`_: Removed ``request.cached_setup``. This was the predecessor mechanism to modern fixtures.

See our `docs <https://docs.pytest.org/en/latest/deprecations.htmlcached-setup>`__ on information on how to update your code.


- `4535 <https://github.com/pytest-dev/pytest/issues/4535>`_: Removed the deprecated ``PyCollector.makeitem`` method. This method was made public by mistake a long time ago.


- `4543 <https://github.com/pytest-dev/pytest/issues/4543>`_: Removed support to define fixtures using the ``pytest_funcarg__`` prefix. Use the ``pytest.fixture`` decorator instead.

See our `docs <https://docs.pytest.org/en/latest/deprecations.htmlpytest-funcarg-prefix>`__ on information on how to update your code.


- `4545 <https://github.com/pytest-dev/pytest/issues/4545>`_: Calling fixtures directly is now always an error instead of a warning.

See our `docs <https://docs.pytest.org/en/latest/deprecations.htmlcalling-fixtures-directly>`__ on information on how to update your code.


- `4546 <https://github.com/pytest-dev/pytest/issues/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 <https://github.com/pytest-dev/pytest/issues/4547>`_: The deprecated ``record_xml_property`` fixture has been removed, use the more generic ``record_property`` instead.

See our `docs <https://docs.pytest.org/en/latest/deprecations.htmlrecord-xml-property>`__ for more information.


- `4548 <https://github.com/pytest-dev/pytest/issues/4548>`_: An error is now raised if the ``pytest_plugins`` variable is defined in a non-top-level ``conftest.py`` file (i.e., not residing in the ``rootdir``).

See our `docs <https://docs.pytest.org/en/latest/deprecations.htmlpytest-plugins-in-non-top-level-conftest-files>`__ for more information.


- `891 <https://github.com/pytest-dev/pytest/issues/891>`_: Remove ``testfunction.markername`` attributes - use ``Node.iter_markers(name=None)`` to iterate them.



Deprecations
------------

- `3050 <https://github.com/pytest-dev/pytest/issues/3050>`_: Deprecated the ``pytest.config`` global.

See https://docs.pytest.org/en/latest/deprecations.htmlpytest-config-global for rationale.


- `3974 <https://github.com/pytest-dev/pytest/issues/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 <https://github.com/pytest-dev/pytest/issues/3974>`__.


- `4435 <https://github.com/pytest-dev/pytest/issues/4435>`_: Deprecated ``raises(..., 'code(as_a_string)')`` and ``warns(..., 'code(as_a_string)')``.

See https://docs.pytest.org/en/latest/deprecations.htmlraises-warns-exec for rationale and examples.



Features
--------

- `3191 <https://github.com/pytest-dev/pytest/issues/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 <https://github.com/pytest-dev/pytest/issues/3632>`_: Richer equality comparison introspection on ``AssertionError`` for objects created using `attrs <http://www.attrs.org/en/stable/>`__ or `dataclasses <https://docs.python.org/3/library/dataclasses.html>`_ (Python 3.7+, `backported to 3.6 <https://pypi.org/project/dataclasses>`__).


- `4278 <https://github.com/pytest-dev/pytest/issues/4278>`_: ``CACHEDIR.TAG`` files are now created inside cache directories.

Those files are part of the `Cache Directory Tagging Standard <http://www.bford.info/cachedir/spec.html>`__, and can
be used by backup or synchronization programs to identify pytest's cache directory as such.


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


- `4371 <https://github.com/pytest-dev/pytest/issues/4371>`_: Updated the ``--collect-only`` option to display test descriptions when ran using ``--verbose``.


- `4386 <https://github.com/pytest-dev/pytest/issues/4386>`_: Restructured ``ExceptionInfo`` object construction and ensure incomplete instances have a ``repr``/``str``.


- `4416 <https://github.com/pytest-dev/pytest/issues/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 <https://github.com/pytest-dev/pytest/issues/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

   [pytest]
   junit_duration_report = call


- `4532 <https://github.com/pytest-dev/pytest/issues/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 <https://github.com/pytest-dev/pytest/issues/4599>`_: ``pytest.importorskip`` now supports a ``reason`` parameter, which will be shown when the
requested module cannot be imported.



Bug Fixes
---------

- `3532 <https://github.com/pytest-dev/pytest/issues/3532>`_: ``-p`` now accepts its argument without a space between the value, for example ``-pmyplugin``.


- `4327 <https://github.com/pytest-dev/pytest/issues/4327>`_: ``approx`` again works with more generic containers, more precisely instances of ``Iterable`` and ``Sized`` instead of more restrictive ``Sequence``.


- `4397 <https://github.com/pytest-dev/pytest/issues/4397>`_: Ensure that node ids are printable.


- `4435 <https://github.com/pytest-dev/pytest/issues/4435>`_: Fixed ``raises(..., 'code(string)')`` frame filename.


- `4458 <https://github.com/pytest-dev/pytest/issues/4458>`_: Display actual test ids in ``--collect-only``.



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

- `4557 <https://github.com/pytest-dev/pytest/issues/4557>`_: Markers example documentation page updated to support latest pytest version.


- `4558 <https://github.com/pytest-dev/pytest/issues/4558>`_: Update cache documentation example to correctly show cache hit and miss.


- `4580 <https://github.com/pytest-dev/pytest/issues/4580>`_: Improved detailed summary report documentation.



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

- `4447 <https://github.com/pytest-dev/pytest/issues/4447>`_: Changed the deprecation type of ``--result-log`` to ``PytestDeprecationWarning``.

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

4.0.2

=========================

Bug Fixes
---------

- `4265 <https://github.com/pytest-dev/pytest/issues/4265>`_: Validate arguments from the ``PYTEST_ADDOPTS`` environment variable and the ``addopts`` ini option separately.


- `4435 <https://github.com/pytest-dev/pytest/issues/4435>`_: Fix ``raises(..., 'code(string)')`` frame filename.


- `4500 <https://github.com/pytest-dev/pytest/issues/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 <https://github.com/pytest-dev/pytest/issues/4538>`_: Raise ``TypeError`` for ``with raises(..., match=<non-None falsey value>)``.



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

- `1495 <https://github.com/pytest-dev/pytest/issues/1495>`_: Document common doctest fixture directory tree structure pitfalls

4.0.1

=========================

Bug Fixes
---------

- `3952 <https://github.com/pytest-dev/pytest/issues/3952>`_: Display warnings before "short test summary info" again, but still later warnings in the end.


- `4386 <https://github.com/pytest-dev/pytest/issues/4386>`_: Handle uninitialized exceptioninfo in repr/str.


- `4393 <https://github.com/pytest-dev/pytest/issues/4393>`_: Do not create ``.gitignore``/``README.md`` files in existing cache directories.


- `4400 <https://github.com/pytest-dev/pytest/issues/4400>`_: Rearrange warning handling for the yield test errors so the opt-out in 4.0.x correctly works.


- `4405 <https://github.com/pytest-dev/pytest/issues/4405>`_: Fix collection of testpaths with ``--pyargs``.


- `4412 <https://github.com/pytest-dev/pytest/issues/4412>`_: Fix assertion rewriting involving ``Starred`` + side-effects.


- `4425 <https://github.com/pytest-dev/pytest/issues/4425>`_: Ensure we resolve the absolute path when the given ``--basetemp`` is a relative path.



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

- `4315 <https://github.com/pytest-dev/pytest/issues/4315>`_: Use ``pkg_resources.parse_version`` instead of ``LooseVersion`` in minversion check.


- `4440 <https://github.com/pytest-dev/pytest/issues/4440>`_: Adjust the stack level of some internal pytest warnings.

4.0.0

=========================

Removals
--------

- `3737 <https://github.com/pytest-dev/pytest/issues/3737>`_: **RemovedInPytest4Warnings are now errors by default.**

Following our plan to remove deprecated features with as little disruption as
possible, all warnings of type ``RemovedInPytest4Warnings`` now generate errors
instead of warning messages.

**The affected features will be effectively removed in pytest 4.1**, so please consult the
`Deprecations and Removals <https://docs.pytest.org/en/latest/deprecations.html>`__
section in the docs for directions on how to update existing code.

In the pytest ``4.0.X`` series, it is possible to change the errors back into warnings as a stop
gap measure by adding this to your ``pytest.ini`` file:

.. code-block:: ini

   [pytest]
   filterwarnings =
       ignore::pytest.RemovedInPytest4Warning

But this will stop working when pytest ``4.1`` is released.

**If you have concerns** about the removal of a specific feature, please add a
comment to `4348 <https://github.com/pytest-dev/pytest/issues/4348>`__.


- `4358 <https://github.com/pytest-dev/pytest/issues/4358>`_: Remove the ``::()`` notation to denote a test class instance in node ids.

Previously, node ids that contain test instances would use ``::()`` to denote the instance like this::

   test_foo.py::Test::()::test_bar

The extra ``::()`` was puzzling to most users and has been removed, so that the test id becomes now::

   test_foo.py::Test::test_bar

This change could not accompany a deprecation period as is usual when user-facing functionality changes because
it was not really possible to detect when the functionality was being used explicitly.

The extra ``::()`` might have been removed in some places internally already,
which then led to confusion in places where it was expected, e.g. with
``--deselect`` (`4127 <https://github.com/pytest-dev/pytest/issues/4127>`_).

Test class instances are also not listed with ``--collect-only`` anymore.



Features
--------

- `4270 <https://github.com/pytest-dev/pytest/issues/4270>`_: The ``cache_dir`` option uses ``$TOX_ENV_DIR`` as prefix (if set in the environment).

This uses a different cache per tox environment by default.



Bug Fixes
---------

- `3554 <https://github.com/pytest-dev/pytest/issues/3554>`_: Fix ``CallInfo.__repr__`` for when the call is not finished yet.

3.10.1

==========================

Bug Fixes
---------

- `4287 <https://github.com/pytest-dev/pytest/issues/4287>`_: Fix nested usage of debugging plugin (pdb), e.g. with pytester's ``testdir.runpytest``.


- `4304 <https://github.com/pytest-dev/pytest/issues/4304>`_: Block the ``stepwise`` plugin if ``cacheprovider`` is also blocked, as one depends on the other.


- `4306 <https://github.com/pytest-dev/pytest/issues/4306>`_: Parse ``minversion`` as an actual version and not as dot-separated strings.


- `4310 <https://github.com/pytest-dev/pytest/issues/4310>`_: Fix duplicate collection due to multiple args matching the same packages.


- `4321 <https://github.com/pytest-dev/pytest/issues/4321>`_: Fix ``item.nodeid`` with resolved symlinks.


- `4325 <https://github.com/pytest-dev/pytest/issues/4325>`_: Fix collection of direct symlinked files, where the target does not match ``python_files``.


- `4329 <https://github.com/pytest-dev/pytest/issues/4329>`_: Fix TypeError in report_collect with _collect_report_last_write.



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

- `4305 <https://github.com/pytest-dev/pytest/issues/4305>`_: Replace byte/unicode helpers in test_capture with python level syntax.
Links

@pyup-bot pyup-bot mentioned this pull request Jan 7, 2019
@coveralls
Copy link

coveralls commented Jan 7, 2019

Pull Request Test Coverage Report for Build 197

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 73.006%

Totals Coverage Status
Change from base Build 175: 0.0%
Covered Lines: 787
Relevant Lines: 1078

💛 - Coveralls

@jpoullet2000 jpoullet2000 merged commit 0d5519b into master Jan 7, 2019
@jpoullet2000 jpoullet2000 deleted the pyup-update-pytest-3.10.0-to-4.1.0 branch April 4, 2019 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants