Skip to content

Merge master into features #5522

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 170 commits into from
Jun 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
24c95c7
add updated monkeypatch examples
EvanKepner May 28, 2019
2dfbed1
fix path expansion example
EvanKepner May 28, 2019
2125d04
Revert "Fix all() unroll for non-generators/non-list comprehensions (…
asottile Jun 3, 2019
1b381d5
Revert "Unroll calls to any #5062 (#5103)"
asottile Jun 3, 2019
230f736
Add changelog entries for reverting all() handling
asottile Jun 3, 2019
63099bc
Merge pull request #5373 from asottile/revert_all_handling
asottile Jun 3, 2019
e770db4
Revert "Revert "ci: Travis: add pypy3 to allowed failures temporarily""
blueyed Jun 3, 2019
3a8b082
Merge pull request #5377 from blueyed/pypy3
blueyed Jun 3, 2019
606d728
Revert "Revert "Revert "ci: Travis: add pypy3 to allowed failures tem…
blueyed Jun 3, 2019
1d6bbab
Add a new Exceptions section in documentation and document UsageError
Pulkit07 May 8, 2019
f223d26
Add a new Exceptions section in documentation and document UsageError…
nicoddemus Jun 3, 2019
9657166
Merge pull request #5379 from asottile/release-4.6.2
asottile Jun 3, 2019
927e95c
[release notes] Merge pull request #5379 from asottile/release-4.6.2 …
nicoddemus Jun 3, 2019
2cfd9c2
Revert "ci: Travis: add pypy3 to allowed failures temporarily" (#5378)
nicoddemus Jun 3, 2019
2a3d643
Documentation: expansion of Monkeypatch to include mocked classes and…
nicoddemus Jun 3, 2019
b95bb29
Remove --recreate from .travis.yml
asottile Jun 3, 2019
6a6b6d8
Remove --recreate from .travis.yml (#5384)
nicoddemus Jun 4, 2019
0a91e18
fix logic if importlib_metadata.PathDistribution.files is None
dirk-thomas Jun 4, 2019
898e869
add changelog file for #5389
dirk-thomas Jun 4, 2019
883db6a
Add test for packages with broken metadata
nicoddemus Jun 4, 2019
9349c72
Allow pypy3 failures again
nicoddemus Jun 4, 2019
76d5080
Allow pypy3 failures again (#5394)
nicoddemus Jun 4, 2019
1f8fd42
item.obj is again a bound method on TestCase function items
nicoddemus Jun 4, 2019
79ef048
Merge pull request #5389 from dirk-thomas/patch-1
nicoddemus Jun 4, 2019
23cd68b
Use keyword-only arguments in a few places
nicoddemus Jun 5, 2019
0f4992c
Merge pull request #5393 from nicoddemus/unittest-self-5390
asottile Jun 5, 2019
be2be04
Clean up u' prefixes and py2 bytes conversions
asottile Jun 5, 2019
25cef55
Merge pull request #5398 from nicoddemus/kwargs-refactoring
asottile Jun 5, 2019
5fdc2d7
Merge pull request #5400 from asottile/prefixes
asottile Jun 5, 2019
aab5687
tests: restore tracing function
blueyed Jun 5, 2019
190456a
Merge pull request #5406 from blueyed/restore-tracing
blueyed Jun 5, 2019
d9eafbd
Revert "Enable coverage for 'py37' environment"
blueyed Jun 4, 2019
be84ba8
Merge pull request #5396 from blueyed/travis-py37-nocov
blueyed Jun 5, 2019
8f5cb46
Turn PytestDeprecationWarning into error
nicoddemus Jun 5, 2019
577b0df
Fix verbosity bug in --collect-only
twmr Jun 4, 2019
3656885
Fix verbosity bug in --collect-only (#5391)
nicoddemus Jun 5, 2019
9f8b566
Turn PytestDeprecationWarning into error (#5410)
nicoddemus Jun 6, 2019
0fd1f30
ci: move coverage reporting to shared script
blueyed Jun 5, 2019
450d264
ci: move coverage reporting to shared script (#5403)
nicoddemus Jun 6, 2019
65c2a81
Remove ExceptionInfo.__str__, falling back to __repr__
nicoddemus Jun 6, 2019
ccd87f9
small mypy fixes
asottile Jun 6, 2019
9182687
Add `slow` marker in run/skip option example.
rillian Jun 6, 2019
0405697
Merge pull request #5415 from asottile/small_mypy_fixes
asottile Jun 6, 2019
042a10f
Add `slow` marker in run/skip option example. (#5416)
nicoddemus Jun 6, 2019
47022b3
ci: Travis: remove pypy3 job for now
blueyed Jun 7, 2019
9f5c356
Remove ExceptionInfo.__str__, falling back to __repr__ (#5413)
nicoddemus Jun 7, 2019
4f597f0
Merge pull request #5419 from blueyed/remove-pypy3
blueyed Jun 7, 2019
f0cee59
Link deprecation docs pytest.raises 'message' warning
nicoddemus Jun 7, 2019
28aa38e
ci: optimize twisted/pexpect related jobs
blueyed Jun 5, 2019
83d1809
Merge pull request #5421 from nicoddemus/raises-warning-message
asottile Jun 8, 2019
40c5a9d
Merge pull request #5409 from blueyed/twisted
blueyed Jun 9, 2019
e868bb6
remove commented code
blueyed Jun 1, 2019
75cda6d
tox: coverage: use -m with coverage-report
blueyed Jun 9, 2019
c5a549b
Emit warning for broken object
Zac-HD Jun 8, 2019
18c2ff6
Merge pull request #5435 from asottile/release-4.6.3
asottile Jun 11, 2019
108fad1
Revert "ci: Travis: remove pypy3 job for now"
asottile Jun 11, 2019
f586d62
re-enable pypy3 now that importlib-metadata 0.18 is released
asottile Jun 11, 2019
4744796
Merge pull request #5437 from asottile/reenable_pypy3
asottile Jun 11, 2019
d637d1b
Merge pull request #5435 from asottile/release-4.6.3 (#5436)
nicoddemus Jun 12, 2019
52780f3
Postpone removal of --result-log to pytest 6.0
nicoddemus Jun 12, 2019
ede8b87
Merge pull request #5438 from nicoddemus/result-log-deprecation
asottile Jun 12, 2019
bad7ab7
Minor: tox: coverage: use -m with coverage-report (#5427)
nicoddemus Jun 12, 2019
701d035
Add missing 'e' to test_mod(e).
patriksevallius Jun 13, 2019
e3dcf1f
Merge pull request #5442 from patriksevallius/master
nicoddemus Jun 13, 2019
ad15efc
add test for stepwise attribute error Refs: #5444
graingert Jun 13, 2019
4cc05a6
Fix --sw crash when first file in cmdline fails to collect
nicoddemus Jun 13, 2019
bc345ac
Remove handling of collection errors by --sw
nicoddemus Jun 13, 2019
7513d87
Remove broken/unused PytestPluginManager.addhooks
nicoddemus Jun 13, 2019
c94e9b6
Fix test docstring
nicoddemus Jun 14, 2019
240828d
Merge pull request #5448 from nicoddemus/add-hooks
asottile Jun 15, 2019
2b92fee
initial conversion of exit codes to enum
RonnyPfannschmidt Jun 7, 2019
2bd619e
add changelog
RonnyPfannschmidt Jun 9, 2019
355eb5a
Small cleanups on _pytest.compat
nicoddemus Jun 15, 2019
177af03
Remove unused/unneeded code
nicoddemus Jun 15, 2019
d8fa434
Remove Python 2-only workaround
nicoddemus Jun 15, 2019
43e8576
Make pytest warnings show as from 'pytest' module instead of '_pytest…
nicoddemus Jun 15, 2019
065fa17
update cangelog to fit review suggestion
RonnyPfannschmidt Jun 15, 2019
103d614
document exitcode members
RonnyPfannschmidt Jun 15, 2019
8b3b10b
pre-commit
RonnyPfannschmidt Jun 15, 2019
cf27af7
Merge pull request #5404 from Zac-HD/helpful-mock-unwrapper
blueyed Jun 15, 2019
1cfea5f
add ExitCode reference in usage
RonnyPfannschmidt Jun 15, 2019
ab6ed38
Improve ExitCode docstring
nicoddemus Jun 15, 2019
bbfc8d1
conversion of exit codes to enum + exposure (#5420)
nicoddemus Jun 16, 2019
87fc5a5
Make pytest warnings show as from 'pytest' module instead of '_pytest…
nicoddemus Jun 16, 2019
689ce11
Small cleanups on _pytest.compat (#5451)
nicoddemus Jun 16, 2019
b38a4e8
Fix stepwise crash when first collected module fails (#5446)
nicoddemus Jun 16, 2019
0627d92
fix typos in the resolution of #5125
RonnyPfannschmidt Jun 17, 2019
b713460
fix typos in the resolution of #5125 (#5458)
nicoddemus Jun 17, 2019
12b76b6
Update cache.rst
curiousjazz77 Jun 21, 2019
a37b902
Integrate pytest-faulthandler into the core
nicoddemus Jun 12, 2019
3d01dd3
Update cache.rst (#5465)
nicoddemus Jun 22, 2019
3ce31b6
Change pytest-faulthandler for simplification
nicoddemus Jun 22, 2019
01a094c
minor: clarify help with reportchars
blueyed Jun 24, 2019
9a89783
Assertion passed hook
Jun 24, 2019
52e695b
Removed debug code.
Jun 24, 2019
4cd08f9
Switch from deprecated imp to importlib
asottile Jun 22, 2019
61dcb84
Merge pull request #5468 from asottile/switch_importlib_to_imp
asottile Jun 24, 2019
380ca8f
Use new raise syntax in one case
asottile Jun 24, 2019
a24933b
Merge pull request #5481 from asottile/minor_py3_cleanup
asottile Jun 24, 2019
63c4802
minor: clarify help with reportchars (#5475)
nicoddemus Jun 24, 2019
3f5b078
Merge pull request #5441 from nicoddemus/faulthandler-5440
nicoddemus Jun 24, 2019
f43fb13
Include pytest version in the cached pyc tags
nicoddemus Jun 24, 2019
9571443
Pickup additional positional args passed to _parse_parametrize_args
kevinjfoley Jun 24, 2019
23aa3bb
Clarify changelog entries should be rst files
kevinjfoley Jun 25, 2019
37fce6c
Pickup addition positional args passed to _parse_parametrize_ar… (#5483)
nicoddemus Jun 25, 2019
a54e2e1
Clarify changelog entries should be rst files (#5485)
nicoddemus Jun 25, 2019
98b212c
Added "experimental" note.
Jun 25, 2019
f8c9a7b
Formatting and removed py2 support.
Jun 25, 2019
2280f28
Black formatting.
Jun 25, 2019
81e3f3c
Black formatting
Jun 25, 2019
b991810
Do not attempt to rewrite non-source files
asottile Jun 25, 2019
64a6365
Include pytest version in the cached pyc tags (#5484)
nicoddemus Jun 25, 2019
0194552
Merge remote-tracking branch 'upstream/features' into merge-features-…
nicoddemus Jun 25, 2019
db50a97
Reverted leak fixture test.
Jun 25, 2019
cfbfa53
Using pytester subprocess to avoid keeping references in the HookReco…
Jun 25, 2019
4db5488
Now dependent on command line option.
Jun 25, 2019
80ac910
Added msg to docstring for cleaning pyc.
Jun 25, 2019
bd647fd
Revert allow_abbrev=False in helper scripts
asottile Jun 25, 2019
ed85c83
Deprecate funcargnames alias
Zac-HD Jun 25, 2019
1aefb24
Merge features into master (#5491)
nicoddemus Jun 25, 2019
8c7eb82
Fix/improve comparison of byte strings
blueyed May 15, 2019
3f2344e
Show bytes ascii representation instead of numeric value
nicoddemus Jun 25, 2019
aaf4031
Do not attempt to rewrite non-source files (#5490)
nicoddemus Jun 25, 2019
3f3f3e7
Merge pull request #5495 from nicoddemus/blueyed/cmp-bytes
asottile Jun 26, 2019
bfba33e
Delete stray comment
asottile Jun 26, 2019
7efdd50
Update src/_pytest/assertion/rewrite.py
Sup3rGeo Jun 26, 2019
fdb6e35
Fix typo replace `circuting` with `circuiting`.
timgates42 Jun 26, 2019
d81f758
Update changelog with trivial as per ./CONTRIBUTING.rst
timgates42 Jun 26, 2019
994c322
Fix rst support
timgates42 Jun 26, 2019
6cf8e71
Merge pull request #5496 from pytest-dev/stray_comment
asottile Jun 26, 2019
a48feb3
Delete 5497.trivial.rst
nicoddemus Jun 26, 2019
6a2d844
Fix typo replace `circuting` with `circuiting`. (#5497)
nicoddemus Jun 26, 2019
0fb5241
Reverted changes.
Jun 26, 2019
d638da5
Using ini-file option instead of cmd option.
Jun 26, 2019
f755ff6
Black formatting.
Jun 26, 2019
d91a5d3
Further reverting changes.
Jun 26, 2019
9a34d88
Explanation variables only defined if failed or passed with plugins i…
Jun 26, 2019
6f851e6
Merge remote-tracking branch 'upstream/master' into features-assertio…
Jun 26, 2019
53234bf
Added config back to AssertionWriter and fixed typo in check_if_asser…
Jun 26, 2019
6854ff2
Fixed import order pep8.
Jun 26, 2019
eb90f3d
Fix default value of 'enable_assertion_pass_hook'
nicoddemus Jun 26, 2019
fcbe66f
Restore proper handling of '%' in assertion messages
nicoddemus Jun 26, 2019
3afee36
Improve docs and reference
nicoddemus Jun 26, 2019
8edf68f
Add a trivial note about astor
nicoddemus Jun 26, 2019
629eb3e
Move formatting variables under the "has impls" if
nicoddemus Jun 26, 2019
2ea2221
Cover assertions with messages when enable_assertion_pass_hook is ena…
nicoddemus Jun 26, 2019
790806e
Merge pull request #5494 from Zac-HD/funcargnames-to-fixturenames
nicoddemus Jun 27, 2019
37fb50a
Features assertion pass hook (#3479)
nicoddemus Jun 27, 2019
1be49e7
Remove py<35 compatibility code from rewrite.py
nicoddemus Jun 26, 2019
c9923a3
Merge pull request #5499 from nicoddemus/cleanup-py35-rewrite
asottile Jun 27, 2019
3e0e31a
Don't crash with --pyargs and a filename that looks like a module
asottile Jun 27, 2019
2479a91
Add Open Collective to FUNDING.yml
The-Compiler Jun 27, 2019
5ef5079
Add Open Collective to FUNDING.yml (#5504)
nicoddemus Jun 27, 2019
65fbdf2
Don't crash with --pyargs and a filename that looks like a modu… (#5503)
nicoddemus Jun 27, 2019
4e723d6
Fix crash when discovery fails while using `-p no:terminal`
asottile Jun 27, 2019
45af361
Remove stray comment from tox.ini
asottile Jun 27, 2019
f7bfbb5
Merge pull request #5506 from asottile/fix_no_terminal
asottile Jun 27, 2019
3c9b46f
Remove stray comment from tox.ini (#5507)
nicoddemus Jun 27, 2019
bf39e89
Refactoring doctests
AmirElkess Jun 28, 2019
7ee2444
Remove astor and reproduce the original assertion expression
asottile Jun 28, 2019
73d918d
Remove astor and reproduce the original assertion expression (#5512)
nicoddemus Jun 28, 2019
fd2f320
Preparing release version 5.0.0
asottile Jun 28, 2019
5e39eb9
Correct Zac-HD's name in changelogs
asottile Jun 27, 2019
55d2fe0
Use importlib instead of imp in demo
asottile Jun 27, 2019
97f0a20
Add notice about py35+ and move ExitCode changelog entry
asottile Jun 27, 2019
58bfc77
Use shutil.which to avoid distutils+imp warning
asottile Jun 27, 2019
e6ffa78
Refactoring doctests (#5518)
nicoddemus Jun 28, 2019
2c6453c
Merge pull request #5509 from asottile/release-5.0.0
asottile Jun 29, 2019
844d660
Merge pull request #5520 from asottile/release-4.6.4
asottile Jun 29, 2019
4bc0415
Merge pull request #5521 from asottile/cherry-pick-maintenance-release
asottile Jun 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# * https://help.github.com/en/articles/displaying-a-sponsor-button-in-your-repository
# * https://tidelift.com/subscription/how-to-connect-tidelift-with-github
tidelift: pypi/pytest
open_collective: pytest
19 changes: 5 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
include:
# OSX tests - first (in test stage), since they are the slower ones.
- os: osx
# NOTE: (tests with) pexpect appear to be buggy on Travis,
# at least with coverage.
# Log: https://travis-ci.org/pytest-dev/pytest/jobs/500358864
osx_image: xcode10.1
language: generic
env: TOXENV=py37-xdist PYTEST_COVERAGE=1
Expand All @@ -34,7 +31,7 @@ jobs:
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 37

# Full run of latest supported version, without xdist.
- env: TOXENV=py37 PYTEST_COVERAGE=1
- env: TOXENV=py37
python: '3.7'

# Coverage tracking is slow with pypy, skip it.
Expand All @@ -49,12 +46,12 @@ jobs:
# - TestArgComplete (linux only)
# - numpy
# Empty PYTEST_ADDOPTS to run this non-verbose.
- env: TOXENV=py37-lsof-numpy-xdist PYTEST_COVERAGE=1 PYTEST_ADDOPTS=
- env: TOXENV=py37-lsof-numpy-twisted-xdist PYTEST_COVERAGE=1 PYTEST_ADDOPTS=

# Specialized factors for py37.
# Coverage for:
# - test_sys_breakpoint_interception (via pexpect).
- env: TOXENV=py37-pexpect,py37-twisted PYTEST_COVERAGE=1
- env: TOXENV=py37-pexpect PYTEST_COVERAGE=1
- env: TOXENV=py37-pluggymaster-xdist
- env: TOXENV=py37-freeze

Expand Down Expand Up @@ -105,18 +102,12 @@ before_script:
export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
fi

script: tox --recreate
script: tox

after_success:
- |
if [[ "$PYTEST_COVERAGE" = 1 ]]; then
set -e
# Add last TOXENV to $PATH.
PATH="$PWD/.tox/${TOXENV##*,}/bin:$PATH"
coverage combine
coverage xml
coverage report -m
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -n $TOXENV-$TRAVIS_OS_NAME
env CODECOV_NAME="$TOXENV-$TRAVIS_OS_NAME" scripts/report-coverage.sh
fi

notifications:
Expand Down
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Kale Kundert
Katarzyna Jachim
Katerina Koukiou
Kevin Cox
Kevin J. Foley
Kodi B. Arfer
Kostis Anagnostopoulos
Kristoffer Nordström
Expand Down Expand Up @@ -200,6 +201,7 @@ Pulkit Goyal
Punyashloka Biswal
Quentin Pradet
Ralf Schmitt
Ralph Giles
Ran Benita
Raphael Castaneda
Raphael Pierzina
Expand Down
236 changes: 236 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,242 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start

pytest 5.0.0 (2019-06-28)
=========================

Important
---------

This release is a Python3.5+ only release.

For more details, see our `Python 2.7 and 3.4 support plan <https://docs.pytest.org/en/latest/py27-py34-deprecation.html>`__.

Removals
--------

- `#1149 <https://github.com/pytest-dev/pytest/issues/1149>`_: Pytest no longer accepts prefixes of command-line arguments, for example
typing ``pytest --doctest-mod`` inplace of ``--doctest-modules``.
This was previously allowed where the ``ArgumentParser`` thought it was unambiguous,
but this could be incorrect due to delayed parsing of options for plugins.
See for example issues `#1149 <https://github.com/pytest-dev/pytest/issues/1149>`__,
`#3413 <https://github.com/pytest-dev/pytest/issues/3413>`__, and
`#4009 <https://github.com/pytest-dev/pytest/issues/4009>`__.


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

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

**The affected features will be effectively removed in pytest 5.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 ``5.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.PytestDeprecationWarning

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

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


- `#5412 <https://github.com/pytest-dev/pytest/issues/5412>`_: ``ExceptionInfo`` objects (returned by ``pytest.raises``) now have the same ``str`` representation as ``repr``, which
avoids some confusion when users use ``print(e)`` to inspect the object.



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

- `#4488 <https://github.com/pytest-dev/pytest/issues/4488>`_: The removal of the ``--result-log`` option and module has been postponed to (tentatively) pytest 6.0 as
the team has not yet got around to implement a good alternative for it.


- `#466 <https://github.com/pytest-dev/pytest/issues/466>`_: The ``funcargnames`` attribute has been an alias for ``fixturenames`` since
pytest 2.3, and is now deprecated in code too.



Features
--------

- `#3457 <https://github.com/pytest-dev/pytest/issues/3457>`_: New `pytest_assertion_pass <https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_assertion_pass>`__
hook, called with context information when an assertion *passes*.

This hook is still **experimental** so use it with caution.


- `#5440 <https://github.com/pytest-dev/pytest/issues/5440>`_: The `faulthandler <https://docs.python.org/3/library/faulthandler.html>`__ standard library
module is now enabled by default to help users diagnose crashes in C modules.

This functionality was provided by integrating the external
`pytest-faulthandler <https://github.com/pytest-dev/pytest-faulthandler>`__ plugin into the core,
so users should remove that plugin from their requirements if used.

For more information see the docs: https://docs.pytest.org/en/latest/usage.html#fault-handler


- `#5452 <https://github.com/pytest-dev/pytest/issues/5452>`_: When warnings are configured as errors, pytest warnings now appear as originating from ``pytest.`` instead of the internal ``_pytest.warning_types.`` module.


- `#5125 <https://github.com/pytest-dev/pytest/issues/5125>`_: ``Session.exitcode`` values are now coded in ``pytest.ExitCode``, an ``IntEnum``. This makes the exit code available for consumer code and are more explicit other than just documentation. User defined exit codes are still valid, but should be used with caution.

The team doesn't expect this change to break test suites or plugins in general, except in esoteric/specific scenarios.

**pytest-xdist** users should upgrade to ``1.29.0`` or later, as ``pytest-xdist`` required a compatibility fix because of this change.



Bug Fixes
---------

- `#1403 <https://github.com/pytest-dev/pytest/issues/1403>`_: Switch from ``imp`` to ``importlib``.


- `#1671 <https://github.com/pytest-dev/pytest/issues/1671>`_: The name of the ``.pyc`` files cached by the assertion writer now includes the pytest version
to avoid stale caches.


- `#2761 <https://github.com/pytest-dev/pytest/issues/2761>`_: Honor PEP 235 on case-insensitive file systems.


- `#5078 <https://github.com/pytest-dev/pytest/issues/5078>`_: Test module is no longer double-imported when using ``--pyargs``.


- `#5260 <https://github.com/pytest-dev/pytest/issues/5260>`_: Improved comparison of byte strings.

When comparing bytes, the assertion message used to show the byte numeric value when showing the differences::

def test():
> assert b'spam' == b'eggs'
E AssertionError: assert b'spam' == b'eggs'
E At index 0 diff: 115 != 101
E Use -v to get the full diff

It now shows the actual ascii representation instead, which is often more useful::

def test():
> assert b'spam' == b'eggs'
E AssertionError: assert b'spam' == b'eggs'
E At index 0 diff: b's' != b'e'
E Use -v to get the full diff


- `#5335 <https://github.com/pytest-dev/pytest/issues/5335>`_: Colorize level names when the level in the logging format is formatted using
'%(levelname).Xs' (truncated fixed width alignment), where X is an integer.


- `#5354 <https://github.com/pytest-dev/pytest/issues/5354>`_: Fix ``pytest.mark.parametrize`` when the argvalues is an iterator.


- `#5370 <https://github.com/pytest-dev/pytest/issues/5370>`_: Revert unrolling of ``all()`` to fix ``NameError`` on nested comprehensions.


- `#5371 <https://github.com/pytest-dev/pytest/issues/5371>`_: Revert unrolling of ``all()`` to fix incorrect handling of generators with ``if``.


- `#5372 <https://github.com/pytest-dev/pytest/issues/5372>`_: Revert unrolling of ``all()`` to fix incorrect assertion when using ``all()`` in an expression.


- `#5383 <https://github.com/pytest-dev/pytest/issues/5383>`_: ``-q`` has again an impact on the style of the collected items
(``--collect-only``) when ``--log-cli-level`` is used.


- `#5389 <https://github.com/pytest-dev/pytest/issues/5389>`_: Fix regressions of `#5063 <https://github.com/pytest-dev/pytest/pull/5063>`__ for ``importlib_metadata.PathDistribution`` which have their ``files`` attribute being ``None``.


- `#5390 <https://github.com/pytest-dev/pytest/issues/5390>`_: Fix regression where the ``obj`` attribute of ``TestCase`` items was no longer bound to methods.


- `#5404 <https://github.com/pytest-dev/pytest/issues/5404>`_: Emit a warning when attempting to unwrap a broken object raises an exception,
for easier debugging (`#5080 <https://github.com/pytest-dev/pytest/issues/5080>`__).


- `#5432 <https://github.com/pytest-dev/pytest/issues/5432>`_: Prevent "already imported" warnings from assertion rewriter when invoking pytest in-process multiple times.


- `#5433 <https://github.com/pytest-dev/pytest/issues/5433>`_: Fix assertion rewriting in packages (``__init__.py``).


- `#5444 <https://github.com/pytest-dev/pytest/issues/5444>`_: Fix ``--stepwise`` mode when the first file passed on the command-line fails to collect.


- `#5482 <https://github.com/pytest-dev/pytest/issues/5482>`_: Fix bug introduced in 4.6.0 causing collection errors when passing
more than 2 positional arguments to ``pytest.mark.parametrize``.


- `#5505 <https://github.com/pytest-dev/pytest/issues/5505>`_: Fix crash when discovery fails while using ``-p no:terminal``.



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

- `#5315 <https://github.com/pytest-dev/pytest/issues/5315>`_: Expand docs on mocking classes and dictionaries with ``monkeypatch``.


- `#5416 <https://github.com/pytest-dev/pytest/issues/5416>`_: Fix PytestUnknownMarkWarning in run/skip example.


pytest 4.6.4 (2019-06-28)
=========================

Bug Fixes
---------

- `#5404 <https://github.com/pytest-dev/pytest/issues/5404>`_: Emit a warning when attempting to unwrap a broken object raises an exception,
for easier debugging (`#5080 <https://github.com/pytest-dev/pytest/issues/5080>`__).


- `#5444 <https://github.com/pytest-dev/pytest/issues/5444>`_: Fix ``--stepwise`` mode when the first file passed on the command-line fails to collect.


- `#5482 <https://github.com/pytest-dev/pytest/issues/5482>`_: Fix bug introduced in 4.6.0 causing collection errors when passing
more than 2 positional arguments to ``pytest.mark.parametrize``.


- `#5505 <https://github.com/pytest-dev/pytest/issues/5505>`_: Fix crash when discovery fails while using ``-p no:terminal``.


pytest 4.6.3 (2019-06-11)
=========================

Bug Fixes
---------

- `#5383 <https://github.com/pytest-dev/pytest/issues/5383>`_: ``-q`` has again an impact on the style of the collected items
(``--collect-only``) when ``--log-cli-level`` is used.


- `#5389 <https://github.com/pytest-dev/pytest/issues/5389>`_: Fix regressions of `#5063 <https://github.com/pytest-dev/pytest/pull/5063>`__ for ``importlib_metadata.PathDistribution`` which have their ``files`` attribute being ``None``.


- `#5390 <https://github.com/pytest-dev/pytest/issues/5390>`_: Fix regression where the ``obj`` attribute of ``TestCase`` items was no longer bound to methods.


pytest 4.6.2 (2019-06-03)
=========================

Bug Fixes
---------

- `#5370 <https://github.com/pytest-dev/pytest/issues/5370>`_: Revert unrolling of ``all()`` to fix ``NameError`` on nested comprehensions.


- `#5371 <https://github.com/pytest-dev/pytest/issues/5371>`_: Revert unrolling of ``all()`` to fix incorrect handling of generators with ``if``.


- `#5372 <https://github.com/pytest-dev/pytest/issues/5372>`_: Revert unrolling of ``all()`` to fix incorrect assertion when using ``all()`` in an expression.


pytest 4.6.1 (2019-06-02)
=========================

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Short version

The test environments above are usually enough to cover most cases locally.

#. Write a ``changelog`` entry: ``changelog/2574.bugfix``, use issue id number
#. Write a ``changelog`` entry: ``changelog/2574.bugfix.rst``, use issue id number
and one of ``bugfix``, ``removal``, ``feature``, ``vendor``, ``doc`` or
``trivial`` for the issue type.
#. Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please
Expand Down Expand Up @@ -264,7 +264,7 @@ Here is a simple overview, with pytest-specific bits:
$ git commit -a -m "<commit message>"
$ git push -u

#. Create a new changelog entry in ``changelog``. The file should be named ``<issueid>.<type>``,
#. Create a new changelog entry in ``changelog``. The file should be named ``<issueid>.<type>.rst``,
where *issueid* is the number of the issue related to the change and *type* is one of
``bugfix``, ``removal``, ``feature``, ``vendor``, ``doc`` or ``trivial``.

Expand Down
27 changes: 15 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ trigger:

variables:
PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml -vv"
COVERAGE_FILE: "$(Build.Repository.LocalPath)/.coverage"
COVERAGE_PROCESS_START: "$(Build.Repository.LocalPath)/.coveragerc"
PYTEST_COVERAGE: '0'

jobs:
Expand All @@ -30,17 +28,14 @@ jobs:
tox.env: 'py36-xdist'
py37:
python.version: '3.7'
tox.env: 'py37'
tox.env: 'py37-twisted-numpy'
# Coverage for:
# - _py36_windowsconsoleio_workaround (with py36+)
# - test_request_garbage (no xdist)
PYTEST_COVERAGE: '1'
py37-linting/docs/doctesting:
python.version: '3.7'
tox.env: 'linting,docs,doctesting'
py37-twisted/numpy:
python.version: '3.7'
tox.env: 'py37-twisted,py37-numpy'
py37-pluggymaster-xdist:
python.version: '3.7'
tox.env: 'py37-pluggymaster-xdist'
Expand All @@ -55,8 +50,13 @@ jobs:
- script: python -m pip install --upgrade pip && python -m pip install tox
displayName: 'Install tox'

- script: |
call scripts/setup-coverage-vars.bat || goto :eof
- bash: |
if [[ "$PYTEST_COVERAGE" == "1" ]]; then
export _PYTEST_TOX_COVERAGE_RUN="coverage run -m"
export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
export COVERAGE_FILE="$PWD/.coverage"
export COVERAGE_PROCESS_START="$PWD/.coveragerc"
fi
python -m tox -e $(tox.env)
displayName: 'Run tests'

Expand All @@ -66,9 +66,12 @@ jobs:
testRunTitle: '$(tox.env)'
condition: succeededOrFailed()

- script: call scripts\upload-coverage.bat
displayName: 'Report and upload coverage'
condition: eq(variables['PYTEST_COVERAGE'], '1')
- bash: |
if [[ "$PYTEST_COVERAGE" == 1 ]]; then
scripts/report-coverage.sh
fi
env:
CODECOV_NAME: $(tox.env)
CODECOV_TOKEN: $(CODECOV_TOKEN)
PYTEST_CODECOV_NAME: $(tox.env)
displayName: Report and upload coverage
condition: eq(variables['PYTEST_COVERAGE'], '1')
Loading