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

doctest: Add +NUMBER option to ignore irrelevant floating-point differences #5576

Merged
merged 5 commits into from Jul 11, 2019

Conversation

@drothlis
Copy link
Contributor

commented Jul 8, 2019

When enabled, floating-point numbers only need to match as far as the
precision you have written in the expected doctest output. This avoids
false positives caused by limited floating-point precision, like this:

Expected:
    0.233
Got:
    0.23300000000000001

This is inspired by Sébastien Boisgérault's numtest but the
implementation is a bit different:

  • This implementation edits the literals that are in the "got"
    string (the actual output from the expression being tested), and then
    proceeds to compare the strings literally. This is similar to pytest's
    existing ALLOW_UNICODE and ALLOW_BYTES implementation.

  • This implementation only compares floats against floats, not ints
    against floats. That is, the following doctest will fail with pytest
    whereas it would pass with numtest:

    >>> math.py  # doctest: +NUMBER
    3
    

    This behaviour should be less surprising (less false negatives) when
    you enable NUMBER globally in pytest.ini.

Advantages of this implementation compared to numtest:

  • Doesn't require import numtest at the top level of the file.
  • Works with pytest (if you try to use pytest & numtest together, pytest
    raises "TypeError: unbound method check_output() must be called with
    NumTestOutputChecker instance as first argument (got
    LiteralsOutputChecker instance instead)").
  • Works with Python 3.
drothlis added 2 commits Jul 8, 2019
doctest: Add +NUMBER option to ignore irrelevant floating-point diffe…
…rences

When enabled, floating-point numbers only need to match as far as the
precision you have written in the expected doctest output. This avoids
false positives caused by limited floating-point precision, like this:

    Expected:
        0.233
    Got:
        0.23300000000000001

This is inspired by Sébastien Boisgérault's [numtest] but the
implementation is a bit different:

* This implementation edits the literals that are in the "got"
  string (the actual output from the expression being tested), and then
  proceeds to compare the strings literally. This is similar to pytest's
  existing ALLOW_UNICODE and ALLOW_BYTES implementation.

* This implementation only compares floats against floats, not ints
  against floats. That is, the following doctest will fail with pytest
  whereas it would pass with numtest:

      >>> math.py  # doctest: +NUMBER
      3

  This behaviour should be less surprising (less false negatives) when
  you enable NUMBER globally in pytest.ini.

Advantages of this implementation compared to numtest:

* Doesn't require `import numtest` at the top level of the file.
* Works with pytest (if you try to use pytest & numtest together, pytest
  raises "TypeError: unbound method check_output() must be called with
  NumTestOutputChecker instance as first argument (got
  LiteralsOutputChecker instance instead)").
* Works with Python 3.

[numtest]: https://github.com/boisgera/numtest
docs: Tidy up doctest options section
* Move the parts about "how to configure it" (pytest.ini vs. inline
  comment) together.
* Move `--doctest-continue-on-failure` into its own sub-heading, as it
  isn't related to the doctest optionflags.
@codecov

This comment has been minimized.

Copy link

commented Jul 8, 2019

Codecov Report

Merging #5576 into features will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##           features    #5576      +/-   ##
============================================
- Coverage      96.1%   96.06%   -0.05%     
============================================
  Files           117      117              
  Lines         25698    25645      -53     
  Branches       2494     2502       +8     
============================================
- Hits          24697    24635      -62     
- Misses          696      704       +8     
- Partials        305      306       +1
Impacted Files Coverage Δ
testing/test_doctest.py 100% <100%> (ø) ⬆️
src/_pytest/doctest.py 97.02% <100%> (+0.4%) ⬆️
testing/test_warnings.py 94.54% <0%> (-5.46%) ⬇️
src/_pytest/warning_types.py 96.29% <0%> (-3.71%) ⬇️
src/_pytest/warnings.py 86.36% <0%> (-0.6%) ⬇️
src/_pytest/recwarn.py 97.67% <0%> (-0.35%) ⬇️
src/_pytest/python_api.py 97.04% <0%> (-0.29%) ⬇️
src/_pytest/config/__init__.py 94.41% <0%> (-0.21%) ⬇️
src/_pytest/mark/structures.py 92.44% <0%> (-0.13%) ⬇️
src/_pytest/config/findpaths.py 94.94% <0%> (-0.06%) ⬇️
... and 30 more

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 60a358f...a740ef2. Read the comment docs.

@thisch

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

https://github.com/astropy/pytest-doctestplus already has support for this kind of handling of floating point comparisons in doctests.

@drothlis

This comment has been minimized.

Copy link
Contributor Author

commented Jul 8, 2019

Ha, that would have saved me half a day. :-) Thanks for pointing it out!

It might be worth merging this anyway? Here are the advantages of this pull
request compared to pytest-doctestplus, based on a quick inspection of the latter:

  • The precision is set by the literal that you put in the expected doctest
    output. For example, if you write this:

    >>> some_function()
    3.14
    

    ...then it checks that the actual output matches to 2 decimal places.

    If you write this:

    >>> some_function()
    3.1416
    

    ...then it checks to 4 decimal places. etc.

    In pytest-doctestplus you can only configure atol & rtol globally.

  • You can enable NUMBER and ELLIPSIS at the same time. In pytest-doctestplus you
    can't, at least according to https://github.com/astropy/pytest-doctestplus/blob/720266f/tests/test_doctestplus.py#L106

  • This implementation is less invasive (it doesn't replicate so much of
    doctest.OutputChecker.check_output) so it interacts better with other options (ELLIPSIS, ALLOW_UNICODE, etc).

  • More tests.

There may be disadvantages of this implementation, of course, that I may have missed. :-)

@thisch

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

Great! Thx for comparing your implementation with the one from doctest-plus! IIRC there were some discussions about merging pytest-doctestplus into pytest-core or merging pytest's doctest plugin into pytest-doctestplus. Maybe @nicoddemus or @RonnyPfannschmidt can help me find the relevant tickets where this was discussed.

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Jul 8, 2019

Maybe @nicoddemus or @RonnyPfannschmidt can help me find the relevant tickets where this was discussed.

Hmmm what comes to mind was perhaps adding a note to the docs suggesting pytest-doctestplus as an alternative to the builtin functionality instead?

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Jul 8, 2019

Hi @drothlis,

Thanks for the patch! It is very well written, both in terms of code clarity, tests and docs, so congratulations! 🎉

I plan to review this more thoroughly this week. Thanks again.

testing/test_doctest.py Outdated Show resolved Hide resolved
@nicoddemus
Copy link
Member

left a comment

@drothlis please take a look at my suggestion of a new test.

Other than that looks great! Thanks again.

@drothlis

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2019

Can we also check against strings?

The implementation is going to have to be a lot smarter -- currently it just uses a regex to find anything that looks like a number within the output. I'll try to do it using tokenize -- it might take me a week or 2.

Thanks for the prompt review!

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

The implementation is going to have to be a lot smarter -- currently it just uses a regex to find anything that looks like a number within the output. I'll try to do it using tokenize -- it might take me a week or 2.

Changing to use tokenize might make it more robust, but if that fails, I'm OK with adding a warning to the docs mentioning this known issue.

Thanks!

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

Alternatively, would you like to add a note to the docs about how the matching is made, and merge this now? Then you can follow up with a refactoring to use tokenize later.

drothlis added 2 commits Jul 11, 2019
Fix test_doctest.test_number_non_matches
These doctests were expected to fail, but they were failing because of a
silly bug (I forgot to replace "{expression}" with the actual expression
to be tested), not because of the thing they were meant to be testing.

Then I had to fix one of the testcases because it was actually matching:

    >>> 3.0 #doctest: +NUMBER
    2.99

The doctest is saying that the actual output should match to 2 decimal
places, i.e. within 0.01 -- which it is, so it passes. I changed the
expected output to 2.98 and now it doesn't match (as we expect).
docs: Document doctest +NUMBER limitation with strings
Also added an "xfail" testcase for the same.
@drothlis

This comment has been minimized.

Copy link
Contributor Author

commented Jul 11, 2019

would you like to add a note to the docs about how the matching is made, and merge this now? Then you can follow up with a refactoring to use tokenize later.

I'm a big fan of this approach of incremental improvement. :-) I have pushed a commit clarifying the documentation, and with an "xfail" testcase. I also fixed a silly bug in one of my unit tests.

@nicoddemus
Copy link
Member

left a comment

Awesome, great work!

After thinking a bit more about this, I believe we can wait and see if people are tripped by the "float inside string" issue. I suspect this will be very rare, if ever, given how doctests are usually written. 😄

Thanks again for the outstanding work!

@nicoddemus nicoddemus merged commit 666acc9 into pytest-dev:features Jul 11, 2019

5 checks passed

WIP Ready for review
Details
codecov/patch 100% of diff hit (target 96.1%)
Details
codecov/project Absolute coverage decreased by -0.04% but relative coverage increased by +3.89% compared to 60a358f
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
pytest-CI #20190711.1 succeeded
Details

@drothlis drothlis deleted the drothlis:doctest-number branch Jul 11, 2019

@drothlis

This comment has been minimized.

Copy link
Contributor Author

commented Jul 11, 2019

Thanks very much for the quick review & merge!

Will this be backported to pytest 4.6? Let me know if you want me to raise a pull request with the backport.

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

Will this be backported to pytest 4.6?

@drothlis 4.6 is for bug-fixes only, and as this is a new feature it won't require a backport. Thanks for the offer! 👍

bors bot added a commit to rehandalal/therapist that referenced this pull request Aug 19, 2019
Merge #90
90: Update pytest to 5.1.0 r=rehandalal a=pyup-bot


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



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

Removals
--------

- `5180 &lt;https://github.com/pytest-dev/pytest/issues/5180&gt;`_: As per our policy, the following features have been deprecated in the 4.X series and are now
  removed:

  * ``Request.getfuncargvalue``: use ``Request.getfixturevalue`` instead.

  * ``pytest.raises`` and ``pytest.warns`` no longer support strings as the second argument.

  * ``message`` parameter of ``pytest.raises``.

  * ``pytest.raises``, ``pytest.warns`` and ``ParameterSet.param`` now use native keyword-only
    syntax. This might change the exception message from previous versions, but they still raise
    ``TypeError`` on unknown keyword arguments as before.

  * ``pytest.config`` global variable.

  * ``tmpdir_factory.ensuretemp`` method.

  * ``pytest_logwarning`` hook.

  * ``RemovedInPytest4Warning`` warning type.

  * ``request`` is now a reserved name for fixtures.


  For more information consult
  `Deprecations and Removals &lt;https://docs.pytest.org/en/latest/deprecations.html&gt;`__ in the docs.


- `5565 &lt;https://github.com/pytest-dev/pytest/issues/5565&gt;`_: Removed unused support code for `unittest2 &lt;https://pypi.org/project/unittest2/&gt;`__.

  The ``unittest2`` backport module is no longer
  necessary since Python 3.3+, and the small amount of code in pytest to support it also doesn&#39;t seem
  to be used: after removed, all tests still pass unchanged.

  Although our policy is to introduce a deprecation period before removing any features or support
  for third party libraries, because this code is apparently not used
  at all (even if ``unittest2`` is used by a test suite executed by pytest), it was decided to
  remove it in this release.

  If you experience a regression because of this, please
  `file an issue &lt;https://github.com/pytest-dev/pytest/issues/new&gt;`__.


- `5615 &lt;https://github.com/pytest-dev/pytest/issues/5615&gt;`_: ``pytest.fail``, ``pytest.xfail`` and ``pytest.skip`` no longer support bytes for the message argument.

  This was supported for Python 2 where it was tempting to use ``&quot;message&quot;``
  instead of ``u&quot;message&quot;``.

  Python 3 code is unlikely to pass ``bytes`` to these functions. If you do,
  please decode it to an ``str`` beforehand.



Features
--------

- `5564 &lt;https://github.com/pytest-dev/pytest/issues/5564&gt;`_: New ``Config.invocation_args`` attribute containing the unchanged arguments passed to ``pytest.main()``.


- `5576 &lt;https://github.com/pytest-dev/pytest/issues/5576&gt;`_: New `NUMBER &lt;https://docs.pytest.org/en/latest/doctest.htmlusing-doctest-options&gt;`__
  option for doctests to ignore irrelevant differences in floating-point numbers.
  Inspired by Sébastien Boisgérault&#39;s `numtest &lt;https://github.com/boisgera/numtest&gt;`__
  extension for doctest.



Improvements
------------

- `5471 &lt;https://github.com/pytest-dev/pytest/issues/5471&gt;`_: JUnit XML now includes a timestamp and hostname in the testsuite tag.


- `5707 &lt;https://github.com/pytest-dev/pytest/issues/5707&gt;`_: Time taken to run the test suite now includes a human-readable representation when it takes over
  60 seconds, for example::

      ===== 2 failed in 102.70s (0:01:42) =====



Bug Fixes
---------

- `4344 &lt;https://github.com/pytest-dev/pytest/issues/4344&gt;`_: Fix RuntimeError/StopIteration when trying to collect package with &quot;__init__.py&quot; only.


- `5115 &lt;https://github.com/pytest-dev/pytest/issues/5115&gt;`_: Warnings issued during ``pytest_configure`` are explicitly not treated as errors, even if configured as such, because it otherwise completely breaks pytest.


- `5477 &lt;https://github.com/pytest-dev/pytest/issues/5477&gt;`_: The XML file produced by ``--junitxml`` now correctly contain a ``&lt;testsuites&gt;`` root element.


- `5523 &lt;https://github.com/pytest-dev/pytest/issues/5523&gt;`_: Fixed using multiple short options together in the command-line (for example ``-vs``) in Python 3.8+.


- `5524 &lt;https://github.com/pytest-dev/pytest/issues/5524&gt;`_: Fix issue where ``tmp_path`` and ``tmpdir`` would not remove directories containing files marked as read-only,
  which could lead to pytest crashing when executed a second time with the ``--basetemp`` option.


- `5537 &lt;https://github.com/pytest-dev/pytest/issues/5537&gt;`_: Replace ``importlib_metadata`` backport with ``importlib.metadata`` from the
  standard library on Python 3.8+.


- `5578 &lt;https://github.com/pytest-dev/pytest/issues/5578&gt;`_: Improve type checking for some exception-raising functions (``pytest.xfail``, ``pytest.skip``, etc)
  so they provide better error messages when users meant to use marks (for example ``pytest.xfail``
  instead of ``pytest.mark.xfail``).


- `5606 &lt;https://github.com/pytest-dev/pytest/issues/5606&gt;`_: Fixed internal error when test functions were patched with objects that cannot be compared
  for truth values against others, like ``numpy`` arrays.


- `5634 &lt;https://github.com/pytest-dev/pytest/issues/5634&gt;`_: ``pytest.exit`` is now correctly handled in ``unittest`` cases.
  This makes ``unittest`` cases handle ``quit`` from pytest&#39;s pdb correctly.


- `5650 &lt;https://github.com/pytest-dev/pytest/issues/5650&gt;`_: Improved output when parsing an ini configuration file fails.


- `5701 &lt;https://github.com/pytest-dev/pytest/issues/5701&gt;`_: Fix collection of ``staticmethod`` objects defined with ``functools.partial``.


- `5734 &lt;https://github.com/pytest-dev/pytest/issues/5734&gt;`_: Skip async generator test functions, and update the warning message to refer to ``async def`` functions.



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

- `5669 &lt;https://github.com/pytest-dev/pytest/issues/5669&gt;`_: Add docstring for ``Testdir.copy_example``.



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

- `5095 &lt;https://github.com/pytest-dev/pytest/issues/5095&gt;`_: XML files of the ``xunit2`` family are now validated against the schema by pytest&#39;s own test suite
  to avoid future regressions.


- `5516 &lt;https://github.com/pytest-dev/pytest/issues/5516&gt;`_: Cache node splitting function which can improve collection performance in very large test suites.


- `5603 &lt;https://github.com/pytest-dev/pytest/issues/5603&gt;`_: Simplified internal ``SafeRepr`` class and removed some dead code.


- `5664 &lt;https://github.com/pytest-dev/pytest/issues/5664&gt;`_: When invoking pytest&#39;s own testsuite with ``PYTHONDONTWRITEBYTECODE=1``,
  the ``test_xfail_handling`` test no longer fails.


- `5684 &lt;https://github.com/pytest-dev/pytest/issues/5684&gt;`_: Replace manual handling of ``OSError.errno`` in the codebase by new ``OSError`` subclasses (``PermissionError``, ``FileNotFoundError``, etc.).
   ```
   
  
</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>
bors bot added a commit to mozilla/normandy that referenced this pull request Sep 3, 2019
Merge #1963
1963: Scheduled weekly dependency update for week 35 r=jaredkerim a=pyup-bot






### Update [botocore](https://pypi.org/project/botocore) from **1.12.200** to **1.12.220**.


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

* api-change:``mq``: Update mq client to latest version
* api-change:``apigatewaymanagementapi``: Update apigatewaymanagementapi client to latest version
* api-change:``ecs``: Update ecs client to latest version
   ```
   
  
  
   ### 1.12.219
   ```
   ========

* api-change:``codepipeline``: Update codepipeline client to latest version
* api-change:``application-autoscaling``: Update application-autoscaling client to latest version
* api-change:``elasticache``: Update elasticache client to latest version
* api-change:``lambda``: Update lambda client to latest version
* api-change:``ecs``: Update ecs client to latest version
   ```
   
  
  
   ### 1.12.218
   ```
   ========

* api-change:``sqs``: Update sqs client to latest version
* api-change:``globalaccelerator``: Update globalaccelerator client to latest version
* api-change:``mediaconvert``: Update mediaconvert client to latest version
   ```
   
  
  
   ### 1.12.217
   ```
   ========

* api-change:``organizations``: Update organizations client to latest version
   ```
   
  
  
   ### 1.12.216
   ```
   ========

* api-change:``ssm``: Update ssm client to latest version
* api-change:``securityhub``: Update securityhub client to latest version
   ```
   
  
  
   ### 1.12.215
   ```
   ========

* api-change:``ec2``: Update ec2 client to latest version
* api-change:``mediapackage-vod``: Update mediapackage-vod client to latest version
* api-change:``transcribe``: Update transcribe client to latest version
   ```
   
  
  
   ### 1.12.214
   ```
   ========

* api-change:``datasync``: Update datasync client to latest version
* api-change:``rds``: Update rds client to latest version
   ```
   
  
  
   ### 1.12.213
   ```
   ========

* api-change:``forecast``: Update forecast client to latest version
* api-change:``forecastquery``: Update forecastquery client to latest version
* api-change:``personalize-runtime``: Update personalize-runtime client to latest version
* api-change:``elasticache``: Update elasticache client to latest version
* api-change:``rekognition``: Update rekognition client to latest version
* api-change:``sagemaker``: Update sagemaker client to latest version
* api-change:``sqs``: Update sqs client to latest version
   ```
   
  
  
   ### 1.12.212
   ```
   ========

* api-change:``sagemaker``: Update sagemaker client to latest version
* api-change:``transfer``: Update transfer client to latest version
* api-change:``appstream``: Update appstream client to latest version
* api-change:``alexaforbusiness``: Update alexaforbusiness client to latest version
   ```
   
  
  
   ### 1.12.211
   ```
   ========

* api-change:``appmesh``: Update appmesh client to latest version
* api-change:``cur``: Update cur client to latest version
   ```
   
  
  
   ### 1.12.210
   ```
   ========

* api-change:``robomaker``: Update robomaker client to latest version
* api-change:``emr``: Update emr client to latest version
* api-change:``ecs``: Update ecs client to latest version
   ```
   
  
  
   ### 1.12.209
   ```
   ========

* api-change:``ec2``: Update ec2 client to latest version
* api-change:``appmesh``: Update appmesh client to latest version
* api-change:``athena``: Update athena client to latest version
* api-change:``codecommit``: Update codecommit client to latest version
* api-change:``glue``: Update glue client to latest version
* api-change:``storagegateway``: Update storagegateway client to latest version
   ```
   
  
  
   ### 1.12.208
   ```
   ========

* api-change:``ec2``: Update ec2 client to latest version
   ```
   
  
  
   ### 1.12.207
   ```
   ========

* api-change:``appsync``: Update appsync client to latest version
   ```
   
  
  
   ### 1.12.206
   ```
   ========

* api-change:``autoscaling``: Update autoscaling client to latest version
* api-change:``cloudwatch``: Update cloudwatch client to latest version
* api-change:``application-autoscaling``: Update application-autoscaling client to latest version
* api-change:``rekognition``: Update rekognition client to latest version
   ```
   
  
  
   ### 1.12.205
   ```
   ========

* api-change:``guardduty``: Update guardduty client to latest version
* api-change:``lex-runtime``: Update lex-runtime client to latest version
* api-change:``redshift``: Update redshift client to latest version
* api-change:``iot``: Update iot client to latest version
* api-change:``mediaconvert``: Update mediaconvert client to latest version
   ```
   
  
  
   ### 1.12.204
   ```
   ========

* api-change:``lakeformation``: Update lakeformation client to latest version
* api-change:``opsworkscm``: Update opsworkscm client to latest version
* api-change:``glue``: Update glue client to latest version
* api-change:``codebuild``: Update codebuild client to latest version
   ```
   
  
  
   ### 1.12.203
   ```
   ========

* api-change:``application-insights``: Update application-insights client to latest version
   ```
   
  
  
   ### 1.12.202
   ```
   ========

* api-change:``batch``: Update batch client to latest version
   ```
   
  
  
   ### 1.12.201
   ```
   ========

* api-change:``datasync``: Update datasync client to latest version
* api-change:``iot``: Update iot client to latest version
* api-change:``ec2``: Update ec2 client to latest version
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/botocore
  - Changelog: https://pyup.io/changelogs/botocore/
  - Repo: https://github.com/boto/botocore
</details>





### Update [Faker](https://pypi.org/project/Faker) from **2.0.0** to **2.0.1**.


<details>
  <summary>Changelog</summary>
  
  
   ### 2.0.1
   ```
   ------------------------------------------------------------------------------------

* Add nationalities for locale ``pt_PT``. Thanks tng10.
* Add ``ios()`` and ``android()`` to ``user_agent`` provider. Thanks gsilvan.
* Update ``zh_CN`` provinces. Thanks casen27.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/faker
  - Changelog: https://pyup.io/changelogs/faker/
  - Repo: https://github.com/joke2k/faker
</details>





### Update [GitPython](https://pypi.org/project/GitPython) from **2.1.13** to **3.0.2**.


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

* fixes an issue with installation
   ```
   
  
  
   ### 3.0.1
   ```
   =============================================

* Fix a `performance regression &lt;https://github.com/gitpython-developers/GitPython/issues/906&gt;`_ which could make certain workloads 50% slower
* Add `currently_rebasing_on` method on `Repo`, see `the PR &lt;https://github.com/gitpython-developers/GitPython/pull/903/filesdiff-c276fc3c4df38382ec884e59657b869dR1065&gt;`_
* Fix incorrect `requirements.txt` which could lead to broken installations, see this `issue &lt;https://github.com/gitpython-developers/GitPython/issues/908&gt;`_ for details.

3.0.0 - Remove Python 2 support
===============================

Motivation for this is a patch which improves unicode handling when dealing with filesystem paths.
Python 2 compatibility was introduced to deal with differences, and I thought it would be a good idea
to &#39;just&#39; drop support right now, mere 5 months away from the official maintenance stop of python 2.7.

The underlying motivation clearly is my anger when thinking python and unicode, which was a hassle from the
start, at least in a codebase as old as GitPython, which totally doesn&#39;t handle encodings correctly in many cases.

Having migrated to using `Rust` exclusively for tooling, I still see that correct handling of encodings isn&#39;t entirely
trivial, but at least `Rust` makes clear what has to be done at compile time, allowing to write software that is pretty
much guaranteed to work once it compiles.

Again, my apologies if removing Python 2 support caused inconveniences, please see release 2.1.13 which returns it.

see the following for (most) details:
https://github.com/gitpython-developers/gitpython/milestone/27?closed=1

or run have a look at the difference between tags v2.1.12 and v3.0.0:
gitpython-developers/GitPython@2.1.12...3.0.0.

2.1.13 - Bring back Python 2.7 support
======================================

My apologies for any inconvenience this may have caused. Following semver, backward incompatible changes
will be introduced in a minor version.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/gitpython
  - Changelog: https://pyup.io/changelogs/gitpython/
  - Repo: https://github.com/gitpython-developers/GitPython
  - Docs: https://pythonhosted.org/GitPython/
</details>





### Update [google-resumable-media](https://pypi.org/project/google-resumable-media) from **0.3.2** to **0.3.3**.


<details>
  <summary>Changelog</summary>
  
  
   ### 0.3.3
   ```
   08-23-2019 14:15 PDT

 Implementation Changes
- Add a default timeout for the http_request method ([88](googleapis/google-resumable-media-python#88))
- DRY &#39;requests&#39; pin; don&#39;t shadow exception. ([83](googleapis/google-resumable-media-python#83))
- Drop a hardcoded value in an error message. ([48](googleapis/google-resumable-media-python#48))

 Documentation
- Reconstruct &#39;CHANGELOG.md&#39; from pre-releasetool era releases. ([66](googleapis/google-resumable-media-python#66))

 Internal / Testing Changes
- Use Kokoro for CI ([90](googleapis/google-resumable-media-python#90))
- Renovate: preserve semver ranges. ([82](googleapis/google-resumable-media-python#82))
- Add renovate.json ([79](googleapis/google-resumable-media-python#79))
- Fix systest bitrot. ([77](googleapis/google-resumable-media-python#77))
- Fix docs build redux. ([75](googleapis/google-resumable-media-python#75))
- Update to new nox ([57](googleapis/google-resumable-media-python#57))
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/google-resumable-media
  - Changelog: https://pyup.io/changelogs/google-resumable-media/
  - Repo: https://github.com/GoogleCloudPlatform/google-resumable-media-python
</details>





### Update [graphene](https://pypi.org/project/graphene) from **2.1.7** to **2.1.8**.


<details>
  <summary>Changelog</summary>
  
  
   ### 2.1.8
   ```
   Changelog

* Bump pinned aniso8601 version
* Allow mutations to apply the interfaces META argument to have the payload object type implement the desired interfaces
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/graphene
  - Changelog: https://pyup.io/changelogs/graphene/
  - Repo: https://github.com/graphql-python/graphene
</details>





### Update [importlib-metadata](https://pypi.org/project/importlib-metadata) from **0.19** to **0.20**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/importlib-metadata
  - Docs: http://importlib-metadata.readthedocs.io/
</details>





### Update [jedi](https://pypi.org/project/jedi) from **0.14.1** to **0.15.1**.


<details>
  <summary>Changelog</summary>
  
  
   ### 0.15.1
   ```
   +++++++++++++++++++

- Small bugfix and removal of a print statement
   ```
   
  
  
   ### 0.15.0
   ```
   ====================

* Adds `only_complete_after_regex` setting
* Upgrade jedi to 0.13.3 and parso to 0.4.0
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/jedi
  - Changelog: https://pyup.io/changelogs/jedi/
  - Repo: https://github.com/davidhalter/jedi
</details>





### Update [lizard](https://pypi.org/project/lizard) from **1.16.3** to **1.16.6**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/lizard
  - Changelog: https://pyup.io/changelogs/lizard/
  - Homepage: http://www.lizard.ws
</details>





### Update [protobuf](https://pypi.org/project/protobuf) from **3.9.0** to **3.9.1**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/protobuf
  - Changelog: https://pyup.io/changelogs/protobuf/
  - Repo: https://github.com/protocolbuffers/protobuf/releases
  - Homepage: https://developers.google.com/protocol-buffers/
</details>





### Update [ruamel.yaml](https://pypi.org/project/ruamel.yaml) from **0.16.0** to **0.16.5**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/ruamel.yaml
  - Repo: https://bitbucket.org/ruamel/yaml
</details>





### Update [setuptools](https://pypi.org/project/setuptools) from **41.0.1** to **41.2.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 41.2.0
   ```
   -------

* 479: Remove some usage of the deprecated ``imp`` module.
* 1565: Changed html_sidebars from string to list of string as per
  https://www.sphinx-doc.org/en/master/changes.htmlid58
   ```
   
  
  
   ### 41.1.0
   ```
   -------

* 1697: Moved most of the constants from setup.py to setup.cfg
* 1749: Fixed issue with the PEP 517 backend where building a source distribution would fail if any tarball existed in the destination directory.
* 1750: Fixed an issue with PEP 517 backend where wheel builds would fail if the destination directory did not already exist.
* 1756: Forse metadata-version &gt;= 1.2. when project urls are present.
* 1769: Improve ``package_data`` check: ensure the dictionary values are lists/tuples of strings.
* 1788: Changed compatibility fallback logic for ``html.unescape`` to avoid accessing ``HTMLParser.unescape`` when not necessary. ``HTMLParser.unescape`` is deprecated and will be removed in Python 3.9.
* 1790: Added the file path to the error message when a ``UnicodeDecodeError`` occurs while reading a metadata file.
* 1776: Use license classifiers rather than the license field.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/setuptools
  - Changelog: https://pyup.io/changelogs/setuptools/
  - Repo: https://github.com/pypa/setuptools
</details>





### Update [text-unidecode](https://pypi.org/project/text-unidecode) from **1.2** to **1.3**.


<details>
  <summary>Changelog</summary>
  
  
   ### 1.3
   ```
   * text-unidecode is now dual-licensed under Artistic License and GPL 1 / GPL 2+, to cause less problems for distributions. Choose license which fits better.
* Declare Python 3.7 support, don&#39;t declare Python 3.3 support
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/text-unidecode
  - Changelog: https://pyup.io/changelogs/text-unidecode/
  - Repo: https://github.com/kmike/text-unidecode/
</details>





### Update [typing](https://pypi.org/project/typing) from **3.7.4** to **3.7.4.1**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/typing
  - Homepage: https://docs.python.org/3/library/typing.html
</details>





### Update [zipp](https://pypi.org/project/zipp) from **0.5.2** to **0.6.0**.


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

12: When adding implicit dirs, ensure that ancestral directories
are added and that duplicates are excluded.

The library now relies on
`more_itertools &lt;https://pypi.org/project/more_itertools&gt;`_.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/zipp
  - Changelog: https://pyup.io/changelogs/zipp/
  - Repo: https://github.com/jaraco/zipp
</details>





### Update [boto3](https://pypi.org/project/boto3) from **1.9.200** to **1.9.220**.


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

* api-change:``mq``: [``botocore``] Update mq client to latest version
* api-change:``apigatewaymanagementapi``: [``botocore``] Update apigatewaymanagementapi client to latest version
* api-change:``ecs``: [``botocore``] Update ecs client to latest version
   ```
   
  
  
   ### 1.9.219
   ```
   =======

* api-change:``codepipeline``: [``botocore``] Update codepipeline client to latest version
* api-change:``application-autoscaling``: [``botocore``] Update application-autoscaling client to latest version
* api-change:``elasticache``: [``botocore``] Update elasticache client to latest version
* api-change:``lambda``: [``botocore``] Update lambda client to latest version
* api-change:``ecs``: [``botocore``] Update ecs client to latest version
   ```
   
  
  
   ### 1.9.218
   ```
   =======

* api-change:``sqs``: [``botocore``] Update sqs client to latest version
* api-change:``globalaccelerator``: [``botocore``] Update globalaccelerator client to latest version
* api-change:``mediaconvert``: [``botocore``] Update mediaconvert client to latest version
   ```
   
  
  
   ### 1.9.217
   ```
   =======

* api-change:``organizations``: [``botocore``] Update organizations client to latest version
   ```
   
  
  
   ### 1.9.216
   ```
   =======

* api-change:``ssm``: [``botocore``] Update ssm client to latest version
* api-change:``securityhub``: [``botocore``] Update securityhub client to latest version
   ```
   
  
  
   ### 1.9.215
   ```
   =======

* api-change:``ec2``: [``botocore``] Update ec2 client to latest version
* api-change:``mediapackage-vod``: [``botocore``] Update mediapackage-vod client to latest version
* api-change:``transcribe``: [``botocore``] Update transcribe client to latest version
   ```
   
  
  
   ### 1.9.214
   ```
   =======

* api-change:``datasync``: [``botocore``] Update datasync client to latest version
* api-change:``rds``: [``botocore``] Update rds client to latest version
   ```
   
  
  
   ### 1.9.213
   ```
   =======

* api-change:``forecast``: [``botocore``] Update forecast client to latest version
* api-change:``forecastquery``: [``botocore``] Update forecastquery client to latest version
* api-change:``personalize-runtime``: [``botocore``] Update personalize-runtime client to latest version
* api-change:``elasticache``: [``botocore``] Update elasticache client to latest version
* api-change:``rekognition``: [``botocore``] Update rekognition client to latest version
* api-change:``sagemaker``: [``botocore``] Update sagemaker client to latest version
* api-change:``sqs``: [``botocore``] Update sqs client to latest version
   ```
   
  
  
   ### 1.9.212
   ```
   =======

* api-change:``sagemaker``: [``botocore``] Update sagemaker client to latest version
* api-change:``transfer``: [``botocore``] Update transfer client to latest version
* api-change:``appstream``: [``botocore``] Update appstream client to latest version
* api-change:``alexaforbusiness``: [``botocore``] Update alexaforbusiness client to latest version
   ```
   
  
  
   ### 1.9.211
   ```
   =======

* api-change:``appmesh``: [``botocore``] Update appmesh client to latest version
* api-change:``cur``: [``botocore``] Update cur client to latest version
   ```
   
  
  
   ### 1.9.210
   ```
   =======

* api-change:``robomaker``: [``botocore``] Update robomaker client to latest version
* api-change:``emr``: [``botocore``] Update emr client to latest version
* api-change:``ecs``: [``botocore``] Update ecs client to latest version
   ```
   
  
  
   ### 1.9.209
   ```
   =======

* api-change:``ec2``: [``botocore``] Update ec2 client to latest version
* api-change:``appmesh``: [``botocore``] Update appmesh client to latest version
* api-change:``athena``: [``botocore``] Update athena client to latest version
* api-change:``codecommit``: [``botocore``] Update codecommit client to latest version
* api-change:``glue``: [``botocore``] Update glue client to latest version
* api-change:``storagegateway``: [``botocore``] Update storagegateway client to latest version
   ```
   
  
  
   ### 1.9.208
   ```
   =======

* api-change:``ec2``: [``botocore``] Update ec2 client to latest version
   ```
   
  
  
   ### 1.9.207
   ```
   =======

* api-change:``appsync``: [``botocore``] Update appsync client to latest version
   ```
   
  
  
   ### 1.9.206
   ```
   =======

* api-change:``autoscaling``: [``botocore``] Update autoscaling client to latest version
* api-change:``cloudwatch``: [``botocore``] Update cloudwatch client to latest version
* api-change:``application-autoscaling``: [``botocore``] Update application-autoscaling client to latest version
* api-change:``rekognition``: [``botocore``] Update rekognition client to latest version
   ```
   
  
  
   ### 1.9.205
   ```
   =======

* api-change:``guardduty``: [``botocore``] Update guardduty client to latest version
* api-change:``lex-runtime``: [``botocore``] Update lex-runtime client to latest version
* api-change:``redshift``: [``botocore``] Update redshift client to latest version
* api-change:``iot``: [``botocore``] Update iot client to latest version
* api-change:``mediaconvert``: [``botocore``] Update mediaconvert client to latest version
   ```
   
  
  
   ### 1.9.204
   ```
   =======

* api-change:``lakeformation``: [``botocore``] Update lakeformation client to latest version
* api-change:``opsworkscm``: [``botocore``] Update opsworkscm client to latest version
* api-change:``glue``: [``botocore``] Update glue client to latest version
* api-change:``codebuild``: [``botocore``] Update codebuild client to latest version
   ```
   
  
  
   ### 1.9.203
   ```
   =======

* api-change:``application-insights``: [``botocore``] Update application-insights client to latest version
   ```
   
  
  
   ### 1.9.202
   ```
   =======

* api-change:``batch``: [``botocore``] Update batch client to latest version
   ```
   
  
  
   ### 1.9.201
   ```
   =======

* api-change:``datasync``: [``botocore``] Update datasync client to latest version
* api-change:``iot``: [``botocore``] Update iot client to latest version
* api-change:``ec2``: [``botocore``] Update ec2 client to latest version
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/boto3
  - Changelog: https://pyup.io/changelogs/boto3/
  - Repo: https://github.com/boto/boto3
</details>





### Update [Django](https://pypi.org/project/Django) from **2.2.4** to **2.2.5**.


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

*September 2, 2019*

Django 2.2.5 fixes several bugs in 2.2.4.

Bugfixes
========

* Relaxed the system check added in Django 2.2 for models to reallow use of the
  same ``db_table`` by multiple models when database routers are installed
  (🎫`30673`).

* Fixed crash of ``KeyTransform()`` for
  :class:`~django.contrib.postgres.fields.JSONField` and
  :class:`~django.contrib.postgres.fields.HStoreField` when using on
  expressions with params (🎫`30672`).

* Fixed a regression in Django 2.2 where
  :attr:`ModelAdmin.list_filter &lt;django.contrib.admin.ModelAdmin.list_filter&gt;`
  choices to foreign objects don&#39;t respect a model&#39;s ``Meta.ordering``
  (🎫`30449`).


==========================
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/django
  - Changelog: https://pyup.io/changelogs/django/
  - Homepage: https://www.djangoproject.com/
</details>





### Update [django-cors-headers](https://pypi.org/project/django-cors-headers) from **3.0.2** to **3.1.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 3.1.0
   ```
   ------------------

* Drop Python 2 support, only Python 3.5-3.7 is supported now.
* Fix all links for move from ``github.com/ottoyiu/django-cors-headers`` to
  ``github.com/adamchainz/django-cors-headers``.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/django-cors-headers
  - Changelog: https://pyup.io/changelogs/django-cors-headers/
  - Repo: https://github.com/adamchainz/django-cors-headers
</details>





### Update [django-countries](https://pypi.org/project/django-countries) from **5.3.3** to **5.4**.


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

- Renamed Macedonia -&gt; North Macedonia.

- Fix an outlying ``makemigrations`` error.

- Pulled in new translations which were provided but missing from previous
  version.

- Fixed Simplified Chinese translation (needed to be ``locale/zh_Hans``).

- Introduce an optional complex format for ``COUNTRIES_ONLY`` and
  ``COUNTRIES_OVERRIDE`` to allow for multiple names for a country, a custom
  three character code, and a custom numeric country code.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/django-countries
  - Changelog: https://pyup.io/changelogs/django-countries/
  - Repo: https://github.com/SmileyChris/django-countries/
</details>





### Update [google-cloud-storage](https://pypi.org/project/google-cloud-storage) from **1.17.0** to **1.19.0**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/google-cloud-storage
  - Repo: https://github.com/GoogleCloudPlatform/google-cloud-python
</details>





### Update [graphene-django](https://pypi.org/project/graphene-django) from **2.4.0** to **2.5.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 2.5.0
   ```
   Changelog

Squeezing in another release before v3. Mostly bug fixes but also a change to the parts that are required in DjangoConnectionField and DjangoFilterConnectionField which might require a schema update.

 New features

* Set converted Django connections to required (610)

 Bugfixes

* Fix choices enum: if field can be blank then it isn&#39;t required (714)
* Check for filters defined on base filterset classes (730)
* Make DjangoDebugContext wait for nested fields (591)

Full changelog: graphql-python/graphene-django@v2.4.0...v2.5.0
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/graphene-django
  - Changelog: https://pyup.io/changelogs/graphene-django/
  - Repo: https://github.com/graphql-python/graphene-django
</details>





### Update [newrelic](https://pypi.org/project/newrelic) from **4.20.1.121** to **5.0.2.126**.


<details>
  <summary>Changelog</summary>
  
  
   ### 5.0.2.126
   ```
   This release of the Python agent includes bug fixes for feedparser and django-piston.

The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from the New Relic download site.

Bug Fixes


Fixed a crash when using feedparser

When running with the feedparser library the agent would crash on attempting to parse an RSS feed. This issue has now been corrected.
Fixed a crash when using django-piston

When running with the django-piston library the agent would crash on attempting to service a request. This issue has now been corrected.
   ```
   
  
  
   ### 5.0.1.125
   ```
   This release of the Python agent includes a bug fix for the mako library instrumentation.

The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from the New Relic download site.

Bug Fixes


Fixed a crash when using the Mako template library

When running with the Mako template library the agent would crash on attempting to render a template. This issue has now been corrected.
   ```
   
  
  
   ### 5.0.0.124
   ```
   This release of the Python agent introduces:


Event loop diagnostics feature
Tornado instrumentation for versions 6 or higher
Improved context manager API functionality and interfaces


This release also drops support for Python 3.4.

The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from the New Relic download site.

Event loop diagnostics

Introducing event loop diagnostics for asyncio! The Python agent can now surface information about transactions that block the event loop. The agent will be able to generate information about transactions that have waited a significant amount of time to acquire control of the event loop.

Event loop diagnostic information will be available in both APM and via NRQL query.

Event loop metrics will appear in the transaction Breakdown table:



Time spent waiting on other transactions will be shown in the transaction Trace details page, as shown here:



eventLoopTime and eventLoopWait attributes will be available via NRQL query. An example query might be:
SELECT count(*) as &#39;count&#39;, average(eventLoopTime) as &#39;loopTime&#39;, average(eventLoopWait) as &#39;loopWait&#39; FROM Transaction facet name

In New Relic Insights, this might show a result like this:



Diagnostics will be available by default through our existing aiohttp, sanic, and Tornado instrumentation. Diagnostic information will also be available for coroutines that use our background_task and web_transaction decorator APIs.

Tornado 6 Instrumentation

Instrumentation for Tornado framework version 6.x is supported without any feature flags. Support for versions earlier than Tornado 6.x has been dropped.  The Tornado web server, framework, and http client are instrumented and information will show up in both APM and insights.

Important: Using the tornado.gen.coroutine with instrumentation is not supported. Any usage of tornado.gen.coroutine should be replaced with an asyncio coroutine.

Before

class MainHandler(tornado.web.RequestHandler):
    tornado.gen.coroutine
    def get(self):

        yield gen.sleep(0.2)


After

class MainHandler(tornado.web.RequestHandler):
    asyncio.coroutine
    def get(self):

        yield from gen.sleep(0.2)


Improved APIs for time trace context managers

Context managers (such as FunctionTrace, ExternalTrace, DatastoreTrace) may now be used from within asyncio coroutines! Additionally, the transaction argument is no longer used for any context manager API.  In order to transition to the new API, the transaction argument must be removed.

Before

transaction = newrelic.agent.current_transaction()
with newrelic.agent.FunctionTrace(transaction, &quot;my_trace&quot;):
  pass


After

with newrelic.agent.FunctionTrace(&quot;my_trace&quot;):
  pass


Updated WebTransaction context manager

The WebTransaction context manager is no longer WSGI dependent. The context manager takes generic HTTP arguments, which you can use to build web transactions that appear in the APM product. For more information, see our API documentation.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/newrelic
  - Changelog: https://pyup.io/changelogs/newrelic/
  - Homepage: http://newrelic.com/docs/python/new-relic-for-python
</details>





### Update [pyasn1](https://pypi.org/project/pyasn1) from **0.4.6** to **0.4.7**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pyasn1
  - Changelog: https://pyup.io/changelogs/pyasn1/
  - Repo: https://github.com/etingof/pyasn1
</details>





### Update [pytest](https://pypi.org/project/pytest) from **5.0.1** to **5.1.2**.


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

Bug Fixes
---------

- `2270 &lt;https://github.com/pytest-dev/pytest/issues/2270&gt;`_: Fixed ``self`` reference in function-scoped fixtures defined plugin classes: previously ``self``
  would be a reference to a *test* class, not the *plugin* class.


- `570 &lt;https://github.com/pytest-dev/pytest/issues/570&gt;`_: Fixed long standing issue where fixture scope was not respected when indirect fixtures were used during
  parametrization.


- `5782 &lt;https://github.com/pytest-dev/pytest/issues/5782&gt;`_: Fix decoding error when printing an error response from ``--pastebin``.


- `5786 &lt;https://github.com/pytest-dev/pytest/issues/5786&gt;`_: Chained exceptions in test and collection reports are now correctly serialized, allowing plugins like
  ``pytest-xdist`` to display them properly.


- `5792 &lt;https://github.com/pytest-dev/pytest/issues/5792&gt;`_: Windows: Fix error that occurs in certain circumstances when loading
  ``conftest.py`` from a working directory that has casing other than the one stored
  in the filesystem (e.g., ``c:\test`` instead of ``C:\test``).
   ```
   
  
  
   ### 5.1.1
   ```
   =========================

Bug Fixes
---------

- `5751 &lt;https://github.com/pytest-dev/pytest/issues/5751&gt;`_: Fixed ``TypeError`` when importing pytest on Python 3.5.0 and 3.5.1.
   ```
   
  
  
   ### 5.1.0
   ```
   =========================

Removals
--------

- `5180 &lt;https://github.com/pytest-dev/pytest/issues/5180&gt;`_: As per our policy, the following features have been deprecated in the 4.X series and are now
  removed:

  * ``Request.getfuncargvalue``: use ``Request.getfixturevalue`` instead.

  * ``pytest.raises`` and ``pytest.warns`` no longer support strings as the second argument.

  * ``message`` parameter of ``pytest.raises``.

  * ``pytest.raises``, ``pytest.warns`` and ``ParameterSet.param`` now use native keyword-only
    syntax. This might change the exception message from previous versions, but they still raise
    ``TypeError`` on unknown keyword arguments as before.

  * ``pytest.config`` global variable.

  * ``tmpdir_factory.ensuretemp`` method.

  * ``pytest_logwarning`` hook.

  * ``RemovedInPytest4Warning`` warning type.

  * ``request`` is now a reserved name for fixtures.


  For more information consult
  `Deprecations and Removals &lt;https://docs.pytest.org/en/latest/deprecations.html&gt;`__ in the docs.


- `5565 &lt;https://github.com/pytest-dev/pytest/issues/5565&gt;`_: Removed unused support code for `unittest2 &lt;https://pypi.org/project/unittest2/&gt;`__.

  The ``unittest2`` backport module is no longer
  necessary since Python 3.3+, and the small amount of code in pytest to support it also doesn&#39;t seem
  to be used: after removed, all tests still pass unchanged.

  Although our policy is to introduce a deprecation period before removing any features or support
  for third party libraries, because this code is apparently not used
  at all (even if ``unittest2`` is used by a test suite executed by pytest), it was decided to
  remove it in this release.

  If you experience a regression because of this, please
  `file an issue &lt;https://github.com/pytest-dev/pytest/issues/new&gt;`__.


- `5615 &lt;https://github.com/pytest-dev/pytest/issues/5615&gt;`_: ``pytest.fail``, ``pytest.xfail`` and ``pytest.skip`` no longer support bytes for the message argument.

  This was supported for Python 2 where it was tempting to use ``&quot;message&quot;``
  instead of ``u&quot;message&quot;``.

  Python 3 code is unlikely to pass ``bytes`` to these functions. If you do,
  please decode it to an ``str`` beforehand.



Features
--------

- `5564 &lt;https://github.com/pytest-dev/pytest/issues/5564&gt;`_: New ``Config.invocation_args`` attribute containing the unchanged arguments passed to ``pytest.main()``.


- `5576 &lt;https://github.com/pytest-dev/pytest/issues/5576&gt;`_: New `NUMBER &lt;https://docs.pytest.org/en/latest/doctest.htmlusing-doctest-options&gt;`__
  option for doctests to ignore irrelevant differences in floating-point numbers.
  Inspired by Sébastien Boisgérault&#39;s `numtest &lt;https://github.com/boisgera/numtest&gt;`__
  extension for doctest.



Improvements
------------

- `5471 &lt;https://github.com/pytest-dev/pytest/issues/5471&gt;`_: JUnit XML now includes a timestamp and hostname in the testsuite tag.


- `5707 &lt;https://github.com/pytest-dev/pytest/issues/5707&gt;`_: Time taken to run the test suite now includes a human-readable representation when it takes over
  60 seconds, for example::

      ===== 2 failed in 102.70s (0:01:42) =====



Bug Fixes
---------

- `4344 &lt;https://github.com/pytest-dev/pytest/issues/4344&gt;`_: Fix RuntimeError/StopIteration when trying to collect package with &quot;__init__.py&quot; only.


- `5115 &lt;https://github.com/pytest-dev/pytest/issues/5115&gt;`_: Warnings issued during ``pytest_configure`` are explicitly not treated as errors, even if configured as such, because it otherwise completely breaks pytest.


- `5477 &lt;https://github.com/pytest-dev/pytest/issues/5477&gt;`_: The XML file produced by ``--junitxml`` now correctly contain a ``&lt;testsuites&gt;`` root element.


- `5523 &lt;https://github.com/pytest-dev/pytest/issues/5523&gt;`_: Fixed using multiple short options together in the command-line (for example ``-vs``) in Python 3.8+.


- `5524 &lt;https://github.com/pytest-dev/pytest/issues/5524&gt;`_: Fix issue where ``tmp_path`` and ``tmpdir`` would not remove directories containing files marked as read-only,
  which could lead to pytest crashing when executed a second time with the ``--basetemp`` option.


- `5537 &lt;https://github.com/pytest-dev/pytest/issues/5537&gt;`_: Replace ``importlib_metadata`` backport with ``importlib.metadata`` from the
  standard library on Python 3.8+.


- `5578 &lt;https://github.com/pytest-dev/pytest/issues/5578&gt;`_: Improve type checking for some exception-raising functions (``pytest.xfail``, ``pytest.skip``, etc)
  so they provide better error messages when users meant to use marks (for example ``pytest.xfail``
  instead of ``pytest.mark.xfail``).


- `5606 &lt;https://github.com/pytest-dev/pytest/issues/5606&gt;`_: Fixed internal error when test functions were patched with objects that cannot be compared
  for truth values against others, like ``numpy`` arrays.


- `5634 &lt;https://github.com/pytest-dev/pytest/issues/5634&gt;`_: ``pytest.exit`` is now correctly handled in ``unittest`` cases.
  This makes ``unittest`` cases handle ``quit`` from pytest&#39;s pdb correctly.


- `5650 &lt;https://github.com/pytest-dev/pytest/issues/5650&gt;`_: Improved output when parsing an ini configuration file fails.


- `5701 &lt;https://github.com/pytest-dev/pytest/issues/5701&gt;`_: Fix collection of ``staticmethod`` objects defined with ``functools.partial``.


- `5734 &lt;https://github.com/pytest-dev/pytest/issues/5734&gt;`_: Skip async generator test functions, and update the warning message to refer to ``async def`` functions.



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

- `5669 &lt;https://github.com/pytest-dev/pytest/issues/5669&gt;`_: Add docstring for ``Testdir.copy_example``.



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

- `5095 &lt;https://github.com/pytest-dev/pytest/issues/5095&gt;`_: XML files of the ``xunit2`` family are now validated against the schema by pytest&#39;s own test suite
  to avoid future regressions.


- `5516 &lt;https://github.com/pytest-dev/pytest/issues/5516&gt;`_: Cache node splitting function which can improve collection performance in very large test suites.


- `5603 &lt;https://github.com/pytest-dev/pytest/issues/5603&gt;`_: Simplified internal ``SafeRepr`` class and removed some dead code.


- `5664 &lt;https://github.com/pytest-dev/pytest/issues/5664&gt;`_: When invoking pytest&#39;s own testsuite with ``PYTHONDONTWRITEBYTECODE=1``,
  the ``test_xfail_handling`` test no longer fails.


- `5684 &lt;https://github.com/pytest-dev/pytest/issues/5684&gt;`_: Replace manual handling of ``OSError.errno`` in the codebase by new ``OSError`` subclasses (``PermissionError``, ``FileNotFoundError``, etc.).
   ```
   
  
</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>





### Update [requests-mock](https://pypi.org/project/requests-mock) from **1.6.0** to **1.7.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 1.7.0
   ```
   Releasing a few pull-requests that people will find useful. 

Includes fixes for 93 and 106. These should be inconsequential for most people.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/requests-mock
  - Changelog: https://pyup.io/changelogs/requests-mock/
  - Docs: https://requests-mock.readthedocs.io/
</details>





### Update [ipython](https://pypi.org/project/ipython) from **7.7.0** to **7.8.0**.


<details>
  <summary>Changelog</summary>
  
  
   ### 7.8.0
   ```
   None
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/ipython
  - Changelog: https://pyup.io/changelogs/ipython/
  - Homepage: https://ipython.org
</details>





### Update [Sphinx](https://pypi.org/project/Sphinx) from **2.1.2** to **2.2.0**.


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

Incompatible changes
--------------------

* apidoc: template files are renamed to ``.rst_t``
* html: Field lists will be styled by grid layout

Deprecated
----------

* ``sphinx.domains.math.MathDomain.add_equation()``
* ``sphinx.domains.math.MathDomain.get_next_equation_number()``
* The ``info`` and ``warn`` arguments of
  ``sphinx.ext.autosummary.generate.generate_autosummary_docs()``
* ``sphinx.ext.autosummary.generate._simple_info()``
* ``sphinx.ext.autosummary.generate._simple_warn()``
* ``sphinx.ext.todo.merge_info()``
* ``sphinx.ext.todo.process_todo_nodes()``
* ``sphinx.ext.todo.process_todos()``
* ``sphinx.ext.todo.purge_todos()``

Features added
--------------

* 5124: graphviz: ``:graphviz_dot:`` option is renamed to ``:layout:``
* 1464: html: emit a warning if :confval:`html_static_path` and
  :confval:`html_extra_path` directories are inside output directory
* 6514: html: Add a label to search input for accessability purposes
* 5602: apidoc: Add ``--templatedir`` option
* 6475: Add ``override`` argument to ``app.add_autodocumenter()``
* 6310: imgmath: let :confval:`imgmath_use_preview` work also with the SVG
  format for images rendering inline math
* 6533: LaTeX: refactor visit_enumerated_list() to use ``\sphinxsetlistlabels``
* 6628: quickstart: Use ``https://docs.python.org/3/`` for default setting of
  :confval:`intersphinx_mapping`
* 6419: sphinx-build: give reasons why rebuilded

Bugs fixed
----------

* py domain: duplicated warning does not point the location of source code
* 6499: html: Sphinx never updates a copy of :confval:`html_logo` even if
  original file has changed
* 1125: html theme: scrollbar is hard to see on classic theme and macOS
* 5502: linkcheck: Consider HTTP 503 response as not an error
* 6439: Make generated download links reproducible
* 6486: UnboundLocalError is raised if broken extension installed
* 6567: autodoc: :confval:`autodoc_inherit_docstrings` does not effect to
  ``__init__()`` and ``__new__()``
* 6574: autodoc: :confval:`autodoc_member_order` does not refer order of
  imports when ``&#39;bysource&#39;`` order
* 6574: autodoc: missing type annotation for variadic and keyword parameters
* 6589: autodoc: Formatting issues with autodoc_typehints=&#39;none&#39;
* 6605: autodoc: crashed when target code contains custom method-like objects
* 6498: autosummary: crashed with wrong autosummary_generate setting
* 6507: autosummary: crashes without no autosummary_generate setting
* 6511: LaTeX: autonumbered list can not be customized in LaTeX
  since Sphinx 1.8.0 (refs: 6533)
* 6531: Failed to load last environment object when extension added
* 736: Invalid sort in pair index
* 6527: :confval:`last_updated` wrongly assumes timezone as UTC
* 5592: std domain: :rst:dir:`option` directive registers an index entry for
  each comma separated option
* 6549: sphinx-build: Escaped characters in error messages
* 6545: doctest comments not getting trimmed since Sphinx 1.8.0
* 6561: glossary: Wrong hyperlinks are generated for non alphanumeric terms
* 6620: i18n: classifiers of definition list are not translated with
  docutils-0.15
* 6474: ``DocFieldTransformer`` raises AttributeError when given directive is
  not a subclass of ObjectDescription
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/sphinx
  - Changelog: https://pyup.io/changelogs/sphinx/
  - Homepage: http://sphinx-doc.org/
</details>







Co-authored-by: pyup-bot <github-bot@pyup.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.