Skip to content

Commit

Permalink
Merge #54
Browse files Browse the repository at this point in the history
54: Update pytest to 4.1.1 r=rehandalal a=pyup-bot


This PR updates [pytest](https://pypi.org/project/pytest) from **4.0.2** to **4.1.1**.



<details>
  <summary>Changelog</summary>
  
  
   ### 4.1.1
   ```
   =========================

Bug Fixes
---------

- `2256 &lt;https://github.com/pytest-dev/pytest/issues/2256&gt;`_: Show full repr with ``assert a==b`` and ``-vv``.


- `3456 &lt;https://github.com/pytest-dev/pytest/issues/3456&gt;`_: Extend Doctest-modules to ignore mock objects.


- `4617 &lt;https://github.com/pytest-dev/pytest/issues/4617&gt;`_: Fixed ``pytest.warns`` bug when context manager is reused (e.g. multiple parametrization).


- `4631 &lt;https://github.com/pytest-dev/pytest/issues/4631&gt;`_: Don&#39;t rewrite assertion when ``__getattr__`` is broken



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

- `3375 &lt;https://github.com/pytest-dev/pytest/issues/3375&gt;`_: 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 &lt;https://github.com/pytest-dev/pytest/issues/4602&gt;`_: Uninstall ``hypothesis`` in regen tox env.
   ```
   
  
  
   ### 4.1.0
   ```
   =========================

Removals
--------

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

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


- `3079 &lt;https://github.com/pytest-dev/pytest/issues/3079&gt;`_: Removed support for yield tests - they are fundamentally broken because they don&#39;t support fixtures properly since collection and test execution were separated.

  See our `docs &lt;https://docs.pytest.org/en/latest/deprecations.htmlyield-tests&gt;`__ on information on how to update your code.


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

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


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

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


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

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


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

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


- `4421 &lt;https://github.com/pytest-dev/pytest/issues/4421&gt;`_: Removed the implementation of the ``pytest_namespace`` hook.

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


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

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


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


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

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


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

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


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

  See our `docs &lt;https://docs.pytest.org/en/latest/deprecations.htmlrecord-xml-property&gt;`__ for more information.


- `4548 &lt;https://github.com/pytest-dev/pytest/issues/4548&gt;`_: 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 &lt;https://docs.pytest.org/en/latest/deprecations.htmlpytest-plugins-in-non-top-level-conftest-files&gt;`__ for more information.


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



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

- `3050 &lt;https://github.com/pytest-dev/pytest/issues/3050&gt;`_: Deprecated the ``pytest.config`` global.

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


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


- `4435 &lt;https://github.com/pytest-dev/pytest/issues/4435&gt;`_: Deprecated ``raises(..., &#39;code(as_a_string)&#39;)`` and ``warns(..., &#39;code(as_a_string)&#39;)``.

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



Features
--------

- `3191 &lt;https://github.com/pytest-dev/pytest/issues/3191&gt;`_: 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=&quot;value&quot;)

  When they should write:

  .. code-block:: python

      mocked_object.assert_called_with(3, 4, 5, key=&quot;value&quot;)

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


- `4278 &lt;https://github.com/pytest-dev/pytest/issues/4278&gt;`_: ``CACHEDIR.TAG`` files are now created inside cache directories.

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


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


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


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


- `4416 &lt;https://github.com/pytest-dev/pytest/issues/4416&gt;`_: 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__(&quot;pdb&quot;).set_trace(skip=[&quot;foo.*&quot;])``.


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



Bug Fixes
---------

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


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


- `4397 &lt;https://github.com/pytest-dev/pytest/issues/4397&gt;`_: Ensure that node ids are printable.


- `4435 &lt;https://github.com/pytest-dev/pytest/issues/4435&gt;`_: Fixed ``raises(..., &#39;code(string)&#39;)`` frame filename.


- `4458 &lt;https://github.com/pytest-dev/pytest/issues/4458&gt;`_: Display actual test ids in ``--collect-only``.



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

- `4557 &lt;https://github.com/pytest-dev/pytest/issues/4557&gt;`_: Markers example documentation page updated to support latest pytest version.


- `4558 &lt;https://github.com/pytest-dev/pytest/issues/4558&gt;`_: Update cache documentation example to correctly show cache hit and miss.


- `4580 &lt;https://github.com/pytest-dev/pytest/issues/4580&gt;`_: Improved detailed summary report documentation.



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

- `4447 &lt;https://github.com/pytest-dev/pytest/issues/4447&gt;`_: Changed the deprecation type of ``--result-log`` to ``PytestDeprecationWarning``.

  It was decided to remove this feature at the next major revision.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytest
  - Changelog: https://pyup.io/changelogs/pytest/
  - Homepage: https://docs.pytest.org/en/latest/
</details>



Co-authored-by: pyup-bot <github-bot@pyup.io>
  • Loading branch information
bors[bot] and pyup-bot committed Jan 13, 2019
2 parents 236e7f4 + 9b790de commit 7e66e7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion requirements-dev.txt
@@ -1,4 +1,4 @@
-r requirements.txt
flake8==3.6.0
pytest==4.0.2
pytest==4.1.1
pytest-cov==2.6.1

0 comments on commit 7e66e7f

Please sign in to comment.