Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
9769bc0
moving plugin inside pytest first pass
alysivji Aug 2, 2018
d42f1e8
Add tests for attrs and dataclasses
alysivji Aug 2, 2018
a0ba881
Add change to log; name to AUTHORS
alysivji Aug 2, 2018
1184db8
cleaning up
alysivji Aug 2, 2018
87b019d
fix gitignore
alysivji Aug 2, 2018
1847cc7
adding docs and cleaning up
alysivji Aug 3, 2018
a3e388a
Improve changelog
alysivji Aug 3, 2018
025d160
Update tests to pass in py27
alysivji Aug 3, 2018
e1e81e3
code review 1/n -- change hasattr to getattr
alysivji Aug 4, 2018
a663f60
cr 2/n -- refactor compare eq class
alysivji Sep 10, 2018
4e99c80
have tests pass in python37; move to separate file
alysivji Nov 12, 2018
2bffd68
Move dataclass tests for 3.7 to separate file
alysivji Nov 12, 2018
b83e978
improve failure output
alysivji Nov 13, 2018
ed91d5f
config: set invocation_dir in the constructor already
blueyed Nov 8, 2018
ba457f5
Optimize/revisit determine_setup
blueyed Nov 9, 2018
5872e1c
Merge pull request #4392 from nicoddemus/merge-master-into-features
RonnyPfannschmidt Nov 15, 2018
62967b3
Merge pull request #4367 from blueyed/determine_setup
blueyed Nov 18, 2018
1a8d9bf
Let approx() work on more generic sequences
ndevenish Nov 7, 2018
4eddf63
Rename and split out the testing, and reword the changelog.
ndevenish Nov 18, 2018
2754a13
Merge master into features
blueyed Nov 19, 2018
92a2884
pdb: support kwargs with `pdb.set_trace`
blueyed Nov 18, 2018
ba17363
remove pytest namespace hook
RonnyPfannschmidt Nov 19, 2018
6e85feb
Merge pull request #4420 from blueyed/merge-master
blueyed Nov 19, 2018
50e3783
Merge pull request #4421 from RonnyPfannschmidt/remove-pytest-namespace
asottile Nov 19, 2018
3d92d5a
Make sure parametrize ids are printable
asottile Nov 18, 2018
8395b9e
Require id=... to be a string
asottile Nov 18, 2018
9ca0ab6
Ensure printable manually-specified param(id=...)
asottile Nov 18, 2018
9a1e518
Add changelog entry for printable node ids
asottile Nov 18, 2018
95c6d59
Properly escape \r \n \t bytes
asottile Nov 18, 2018
0ffb8dd
Merge pull request #4418 from asottile/printable_ids
RonnyPfannschmidt Nov 19, 2018
d52ea4b
Use python 3 in 'doctesting' environment
nicoddemus Nov 19, 2018
9ed63c6
capture: do not overwrite `sys.__stdin__` etc
blueyed Nov 17, 2018
d894bf4
Merge pull request #4407 from blueyed/sys-dunder
RonnyPfannschmidt Nov 22, 2018
88bf01a
fix #4386 - restructure construction and partial state of ExceptionInfo
RonnyPfannschmidt Nov 22, 2018
2eaf3db
Fix docstring indentation (docs env)
nicoddemus Nov 22, 2018
5d2e237
Update deprecations.rst now that we have removed a few features
nicoddemus Nov 22, 2018
f987b36
Merge pull request #3776 from alysivji/attrs-n-dataclasses
nicoddemus Nov 22, 2018
63f90a2
Merge pull request #4438 from RonnyPfannschmidt/fix-4386-raises-parti…
nicoddemus Nov 23, 2018
33b877c
Merge remote-tracking branch 'upstream/master' into merge-master-into…
nicoddemus Nov 24, 2018
5bee396
Merge master into merge-master-into-features
blueyed Nov 24, 2018
59f6523
Merge pull request #4454 from nicoddemus/merge-master-into-features
RonnyPfannschmidt Nov 24, 2018
e9b2475
Display actual test ids in `--collect-only`
asottile Nov 25, 2018
7d3ca68
Merge pull request #4464 from asottile/dash_q_escaped
asottile Nov 25, 2018
b73e083
Merge remote-tracking branch 'upstream/master' into merge-master-into…
nicoddemus Nov 26, 2018
5cf69fa
Merge pull request #4466 from nicoddemus/merge-master-into-features
nicoddemus Nov 27, 2018
1bba0a9
Deprecate `raises(..., 'code(as_a_string)')` / `warns(..., 'code(as_a…
asottile Nov 22, 2018
1d86247
Merge pull request #4443 from asottile/deprecate_raises_exec
asottile Nov 29, 2018
7eb28f9
remove yield tests and compat properties
RonnyPfannschmidt Aug 28, 2018
b531f7d
Merge pull request #3898 from RonnyPfannschmidt/remove-yield-and-comp…
RonnyPfannschmidt Nov 30, 2018
847eace
refactor CallInfo constructor magic into named constructor
RonnyPfannschmidt Nov 3, 2018
e0ba1cb
Merge pull request #4299 from RonnyPfannschmidt/callinfo-sanity
nicoddemus Nov 30, 2018
63f38de
Merge remote-tracking branch 'upstream/features' into update-deprecat…
nicoddemus Dec 1, 2018
06dc6e3
Merge pull request #4446 from nicoddemus/update-deprecations-docs
nicoddemus Dec 1, 2018
b05061d
Change deprecation type of --result-log to PytestDeprecationWarning
nicoddemus Nov 22, 2018
090f7ff
Remove request.cached_setup
nicoddemus Dec 1, 2018
40b85d7
Remove Metafunc.addcall
nicoddemus Dec 1, 2018
44b74c8
Merge pull request #4447 from nicoddemus/remove-result-log
nicoddemus Dec 1, 2018
4ffa137
Add links to the deprecations docs for the "removal" changelog entries
nicoddemus Dec 1, 2018
a131f0a
Merge pull request #4490 from nicoddemus/remove-cached-setup-add-call
nicoddemus Dec 1, 2018
4a3c8e2
Merge pull request #4491 from nicoddemus/removal-links
asottile Dec 2, 2018
b88c3f8
Deprecate pytest.config
asottile Dec 3, 2018
5db46d2
Merge pull request #4498 from asottile/deprecate_pytest_config
asottile Dec 3, 2018
d237197
#4278 Added a CACHEDIR.TAG file to the cache directory
Dec 4, 2018
1654b77
[#3191] Set up tests to confirm warnings
Tadaboody Oct 14, 2018
9fc9b29
Fix tests and add aditional cases
Tadaboody Oct 15, 2018
aaf7f7f
Update changelog
Tadaboody Oct 25, 2018
59a11b6
Check for 'assert None' and warn appropriately
Tadaboody Oct 24, 2018
e0c2ab1
Fix tests not to assert a function that already asserts
Tadaboody Oct 25, 2018
3e6f1fa
Simplify warning creation by using ast.parse
Tadaboody Oct 25, 2018
26d27df
Improve changelog message
nicoddemus Oct 30, 2018
e1e4b22
:ok_hand: Address code review
Tadaboody Nov 5, 2018
41031fc
Address code review
Tadaboody Dec 5, 2018
7a7ad0c
Shorten docstring for warn_about_none_ast
Tadaboody Dec 5, 2018
8fd6048
Don't insert warnings when not in a module
Tadaboody Dec 5, 2018
62b8f2f
Update changelog [ci skip]
blueyed Dec 5, 2018
8a0ed7e
Revisit changelog entry [ci skip]
blueyed Dec 5, 2018
5ebacc4
Harden tests, fix doc/msg
blueyed Dec 5, 2018
76884c7
Merge pull request #4146 from Tadaboody/give_hints_when_an_assertion_…
nicoddemus Dec 5, 2018
0db5ccb
Merge master into features
blueyed Dec 10, 2018
539d3dc
Merge branch 'fix-test_raises_exception_looks_iterable' into merge-ma…
blueyed Dec 10, 2018
038f1f9
Merge pull request #4524 from blueyed/merge-master
blueyed Dec 10, 2018
fc4aa27
Derive outcomes.exit.Exception from SystemExit instead of KeyboardInt…
blueyed Nov 2, 2018
7b1cb88
Handle missing space with -p
blueyed Dec 9, 2018
0e4e8e0
Merge pull request #4504 from feuillemorte/4278_add_cachedir_tag
blueyed Dec 11, 2018
8152b68
Merge pull request #4419 from blueyed/set_trace-kwargs
blueyed Dec 11, 2018
3445eae
argparsing: Parser: allow to forward prog to argparse
blueyed Dec 11, 2018
ebe0a88
Merge pull request #4522 from blueyed/p-no-space
blueyed Dec 11, 2018
bb363c8
Merge pull request #4528 from blueyed/parser-prog
blueyed Dec 11, 2018
cfbd387
Add --junittime=call option
aparamon Dec 11, 2018
a44776e
Fix linting
nicoddemus Dec 11, 2018
9839cef
Change -ra to show errors and failures last, instead of first
nicoddemus Dec 11, 2018
3cd1161
Add CHANGELOG
nicoddemus Dec 11, 2018
0bccfc4
Fix flaky test
aparamon Dec 12, 2018
316cca2
Switch to ini config parameter
aparamon Dec 12, 2018
b1e766c
Update docs
aparamon Dec 12, 2018
ec4507d
Fix doc formatting
aparamon Dec 12, 2018
5d79baf
Fix flaky test attempt 2
aparamon Dec 12, 2018
e3d30f8
Remove deprecated PyCollector.makeitem
nicoddemus Dec 11, 2018
110fe24
Merge pull request #4531 from nicoddemus/remove-custom-collection-types
nicoddemus Dec 12, 2018
5b83417
Deprecate the 'message' parameter of pytest.raises
nicoddemus Dec 12, 2018
15b0a89
Merge pull request #4539 from nicoddemus/deprecate-pytest-raises-message
nicoddemus Dec 13, 2018
f96e1b6
Merge pull request #4532 from nicoddemus/failure-summary
nicoddemus Dec 13, 2018
b390c66
Merge pull request #4292 from blueyed/exit-outcome
nicoddemus Dec 13, 2018
26d202a
Merge pull request #4529 from aparamon/jxmlunit-call-time
nicoddemus Dec 13, 2018
1e80a9c
Remove pytest_funcarg__ prefix support for defining fixtures
nicoddemus Dec 13, 2018
437f44a
Merge pull request #4544 from nicoddemus/remove-pytest-funcarg-prefix
nicoddemus Dec 14, 2018
9898717
Review changelog entries for features branch
nicoddemus Dec 14, 2018
fd48cd5
Remove config.warn, Node.warn; pytest_logwarning issues a warning whe…
nicoddemus Dec 11, 2018
ae5d5b8
Merge pull request #4552 from nicoddemus/review-changelog-entries
nicoddemus Dec 14, 2018
231863b
Rename "junit_time" to "junit_duration_report" option
nicoddemus Dec 14, 2018
8e287c5
Merge master into features
blueyed Dec 14, 2018
6e1b1ab
Remove deprecated record_xml_property
nicoddemus Dec 14, 2018
a7e4016
Remove support to pass strings to pytest.main()
nicoddemus Dec 14, 2018
1499778
Errors in parametrize id functions now propagate the error instead of…
nicoddemus Dec 14, 2018
3cf44b3
Merge pull request #4554 from blueyed/merge-master
blueyed Dec 15, 2018
84390ac
Merge pull request #4553 from nicoddemus/junit-durations
nicoddemus Dec 17, 2018
c6d27d8
Merge pull request #4555 from nicoddemus/remove-record-xml-pytest-mai…
nicoddemus Dec 17, 2018
75e93e5
Merge pull request #4556 from nicoddemus/idfunc-failure
nicoddemus Dec 17, 2018
b7e8171
Merge branch 'features' into remove-legacy-warn
nicoddemus Dec 17, 2018
e63c7a1
Merge pull request #4327 from ndevenish/approx
RonnyPfannschmidt Dec 17, 2018
8563364
Merge pull request #4542 from nicoddemus/remove-legacy-warn
nicoddemus Dec 18, 2018
0115766
Calling fixtures directly is now an error instead of a warning
nicoddemus Dec 18, 2018
c400d8b
Merge pull request #4561 from nicoddemus/remove-calling-fixtures-dire…
nicoddemus Dec 19, 2018
197fd69
Use mocking to make test_junit_duration_report deterministic
nicoddemus Dec 19, 2018
9138419
Remove support for '[pytest]' section in setup.cfg file
nicoddemus Dec 19, 2018
a93f412
Raise an error if pytest_plugins is defined in a non-top-level confte…
nicoddemus Dec 19, 2018
b2d3ae2
Merge pull request #4566 from nicoddemus/remove-setup-cfg-non-top-lev…
RonnyPfannschmidt Dec 20, 2018
d888d5c
Merge pull request #4565 from nicoddemus/flaky-test
RonnyPfannschmidt Dec 20, 2018
c378cb4
Remove support for applying marks to values in parametrize
nicoddemus Dec 20, 2018
58fc918
Merge pull request #4571 from nicoddemus/remove-parametrize-marks
nicoddemus Dec 21, 2018
9f9f6ee
remove most of markertransfer
RonnyPfannschmidt Dec 19, 2018
3947b85
fix hookspec parsing
RonnyPfannschmidt Dec 19, 2018
b258764
fix docs
RonnyPfannschmidt Dec 19, 2018
64a353f
update deprecation docs
RonnyPfannschmidt Dec 20, 2018
102ffc6
add issue references to the todos
RonnyPfannschmidt Dec 20, 2018
8f8d311
apply suggested enhancements in deprecations.rst
RonnyPfannschmidt Dec 20, 2018
134641f
add first set of changelog entries for marker removal
RonnyPfannschmidt Dec 21, 2018
134ace9
Merge pull request #4564 from RonnyPfannschmidt/remove-markinfo
nicoddemus Dec 21, 2018
1eef53b
Update --collect-only to display test descriptions when ran in verbos…
jeffreyrack Dec 30, 2018
1a9979a
Merge pull request #4582 from jeffreyrack/4371-display-test-descriptions
nicoddemus Dec 30, 2018
30c7a7b
Merge remote-tracking branch 'upstream/master' into features
nicoddemus Jan 2, 2019
56aecfc
Merge pull request #4587 from nicoddemus/merge-master-into-features
asottile Jan 4, 2019
8b48621
Allow providing a custom reason for `importorskip`
s0undt3ch Jan 4, 2019
be7eb22
Add test case for `importorskip` custom reason
s0undt3ch Jan 4, 2019
0c48986
Add changelog entry and update docs for importorskip
nicoddemus Jan 5, 2019
0da5531
Merge pull request #4599 from s0undt3ch/feature/skiporfail-reason
nicoddemus Jan 5, 2019
9d297c0
Preparing release version 4.1.0
nicoddemus Jan 5, 2019
e380d43
Anonimize attrs links
nicoddemus Jan 5, 2019
5a8e674
Add dataclasses as a regendoc dependency
nicoddemus Jan 5, 2019
d0e9b48
Regendocs
nicoddemus Jan 5, 2019
01151ff
Add example for -ra usage to the docs
nicoddemus Jan 5, 2019
d746589
Regendoc again
nicoddemus Jan 5, 2019
99ef8c6
Fix typo in Makefile: PYTEST_ADDOPT -> PYTEST_ADDOPTS
nicoddemus Jan 5, 2019
e24031f
Regendocs again, without hypothesis
nicoddemus Jan 5, 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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ coverage.xml
.pydevproject
.project
.settings
.vscode
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ Alan Velasco
Alexander Johnson
Alexei Kozlenok
Allan Feldman
Aly Sivji
Anatoly Bubenkoff
Anders Hovmöller
Andras Tim
Andrea Cimatoribus
Andreas Zeidler
Andrey Paramonov
Andrzej Ostrowski
Andy Freeland
Anthon van der Neut
Expand Down Expand Up @@ -165,6 +167,7 @@ Miro Hrončok
Nathaniel Waisbrot
Ned Batchelder
Neven Mundar
Nicholas Devenish
Niclas Olofsson
Nicolas Delaby
Oleg Pidsadnyi
Expand Down
228 changes: 227 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,232 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start

pytest 4.1.0 (2019-01-05)
=========================

Removals
--------

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


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

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


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

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


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

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


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

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


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

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


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

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


- `#3616 <https://github.com/pytest-dev/pytest/issues/3616>`_: Removed the deprecated compat properties for ``node.Class/Function/Module`` - use ``pytest.Class/Function/Module`` now.

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


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

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


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

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


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


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

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


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

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


- `#4546 <https://github.com/pytest-dev/pytest/issues/4546>`_: Remove ``Node.get_marker(name)`` the return value was not usable for more than a existence check.

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


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

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


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

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


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



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

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

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


- `#3974 <https://github.com/pytest-dev/pytest/issues/3974>`_: Passing the ``message`` parameter of ``pytest.raises`` now issues a ``DeprecationWarning``.

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

If you have concerns about this, please comment on `issue #3974 <https://github.com/pytest-dev/pytest/issues/3974>`__.


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

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



Features
--------

- `#3191 <https://github.com/pytest-dev/pytest/issues/3191>`_: A warning is now issued when assertions are made for ``None``.

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

.. code-block:: python

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

When they should write:

.. code-block:: python

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

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

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

.. code-block:: python

assert variable is None

will not issue the warning.


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


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

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


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


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


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


- `#4416 <https://github.com/pytest-dev/pytest/issues/4416>`_: pdb: added support for keyword arguments with ``pdb.set_trace``.

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

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


- `#4483 <https://github.com/pytest-dev/pytest/issues/4483>`_: Added ini parameter ``junit_duration_report`` to optionally report test call durations, excluding setup and teardown times.

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

.. code-block:: ini

[pytest]
junit_duration_report = call


- `#4532 <https://github.com/pytest-dev/pytest/issues/4532>`_: ``-ra`` now will show errors and failures last, instead of as the first items in the summary.

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


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



Bug Fixes
---------

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


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


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


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


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



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

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


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


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



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

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

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


pytest 4.0.2 (2018-12-13)
=========================

Expand Down Expand Up @@ -1757,7 +1983,7 @@ Bug Fixes
Trivial/Internal Changes
------------------------

- pytest now depends on `attrs <https://pypi.org/project/attrs/>`_ for internal
- pytest now depends on `attrs <https://pypi.org/project/attrs/>`__ for internal
structures to ease code maintainability. (`#2641
<https://github.com/pytest-dev/pytest/issues/2641>`_)

Expand Down
1 change: 0 additions & 1 deletion changelog/4557.doc.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4558.doc.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4580.doc.rst

This file was deleted.

2 changes: 1 addition & 1 deletion doc/en/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ clean:
-rm -rf $(BUILDDIR)/*

regen:
PYTHONDONTWRITEBYTECODE=1 PYTEST_ADDOPT=-pno:hypothesis COLUMNS=76 regendoc --update *.rst */*.rst ${REGENDOC_ARGS}
PYTHONDONTWRITEBYTECODE=1 PYTEST_ADDOPTS=-pno:hypothesis COLUMNS=76 regendoc --update *.rst */*.rst ${REGENDOC_ARGS}

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
Expand Down
1 change: 1 addition & 0 deletions doc/en/announce/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release announcements
:maxdepth: 2


release-4.1.0
release-4.0.2
release-4.0.1
release-4.0.0
Expand Down
44 changes: 44 additions & 0 deletions doc/en/announce/release-4.1.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
pytest-4.1.0
=======================================

The pytest team is proud to announce the 4.1.0 release!

pytest is a mature Python testing tool with more than a 2000 tests
against itself, passing on many different interpreters and platforms.

This release contains a number of bugs fixes and improvements, so users are encouraged
to take a look at the CHANGELOG:

https://docs.pytest.org/en/latest/changelog.html

For complete documentation, please visit:

https://docs.pytest.org/en/latest/

As usual, you can upgrade from pypi via:

pip install -U pytest

Thanks to all who contributed to this release, among them:

* Adam Johnson
* Aly Sivji
* Andrey Paramonov
* Anthony Sottile
* Bruno Oliveira
* Daniel Hahler
* David Vo
* Hyunchel Kim
* Jeffrey Rackauckas
* Kanguros
* Nicholas Devenish
* Pedro Algarvio
* Randy Barlow
* Ronny Pfannschmidt
* Tomer Keren
* feuillemorte
* wim glenn


Happy testing,
The Pytest Development Team
5 changes: 2 additions & 3 deletions doc/en/assert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ If you want to write test code that works on Python 2.4 as well,
you may also use two other ways to test for an expected exception::

pytest.raises(ExpectedException, func, *args, **kwargs)
pytest.raises(ExpectedException, "func(*args, **kwargs)")

both of which execute the specified function with args and kwargs and
asserts that the given ``ExpectedException`` is raised. The reporter will
which will execute the specified function with args and kwargs and
assert that the given ``ExpectedException`` is raised. The reporter will
provide you with helpful output in case of failures such as *no
exception* or *wrong exception*.

Expand Down
2 changes: 0 additions & 2 deletions doc/en/builtin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a

def test_function(record_property):
record_property("example_key", 1)
record_xml_property
(Deprecated) use record_property.
record_xml_attribute
Add extra xml attributes to the tag for the calling test.
The fixture is callable with ``(name, value)``, with value being
Expand Down
6 changes: 4 additions & 2 deletions doc/en/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ If you run this command for the first time, you can see the print statement:
> assert mydata == 23
E assert 42 == 23

test_caching.py:14: AssertionError
test_caching.py:17: AssertionError
-------------------------- Captured stdout setup ---------------------------
running expensive computation...
1 failed in 0.12 seconds

If you run it a second time the value will be retrieved from
Expand All @@ -234,7 +236,7 @@ the cache and nothing will be printed:
> assert mydata == 23
E assert 42 == 23

test_caching.py:14: AssertionError
test_caching.py:17: AssertionError
1 failed in 0.12 seconds

See the :ref:`cache-api` for more details.
Expand Down
Loading