From 98987177a082944135ea2b208b38ec7d32b02d39 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 14 Dec 2018 11:17:24 -0200 Subject: [PATCH] Review changelog entries for features branch I used `towncrier --draft` to see the full changelog, and decided to "nitpick" it so it reads better as a whole. --- changelog/3050.deprecation.rst | 4 +++- changelog/3079.removal.rst | 2 +- changelog/3083.removal.rst | 2 +- changelog/3191.feature.rst | 16 +++++++++++----- changelog/3616.removal.rst | 2 +- changelog/4278.feature.rst | 4 ++++ changelog/4278.trivial.rst | 1 - changelog/4292.feature.rst | 2 +- changelog/4386.feature.rst | 2 +- changelog/4416.feature.rst | 2 +- changelog/4421.removal.rst | 2 +- changelog/4435.bugfix.rst | 2 +- changelog/4435.deprecation.rst | 4 +++- changelog/4483.feature.rst | 11 +++++++++-- changelog/4535.removal.rst | 2 +- changelog/4543.removal.rst | 2 +- 16 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 changelog/4278.feature.rst delete mode 100644 changelog/4278.trivial.rst diff --git a/changelog/3050.deprecation.rst b/changelog/3050.deprecation.rst index 2da417c85..fce5979d6 100644 --- a/changelog/3050.deprecation.rst +++ b/changelog/3050.deprecation.rst @@ -1 +1,3 @@ -Deprecate ``pytest.config`` global. See https://docs.pytest.org/en/latest/deprecations.html#pytest-config-global +Deprecated the ``pytest.config`` global. + +See https://docs.pytest.org/en/latest/deprecations.html#pytest-config-global for rationale. diff --git a/changelog/3079.removal.rst b/changelog/3079.removal.rst index 19a8612f0..cb2265ff3 100644 --- a/changelog/3079.removal.rst +++ b/changelog/3079.removal.rst @@ -1,3 +1,3 @@ -Remove support for yield tests - they are fundamentally broken because they don't support fixtures properly since collection and test execution were separated. +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 `__ on information on how to update your code. diff --git a/changelog/3083.removal.rst b/changelog/3083.removal.rst index ce689b94a..74d268a4e 100644 --- a/changelog/3083.removal.rst +++ b/changelog/3083.removal.rst @@ -1,3 +1,3 @@ -Remove ``Metafunc.addcall``. This was the predecessor mechanism to ``@pytest.mark.parametrize``. +Removed ``Metafunc.addcall``. This was the predecessor mechanism to ``@pytest.mark.parametrize``. See our `docs `__ on information on how to update your code. diff --git a/changelog/3191.feature.rst b/changelog/3191.feature.rst index 7eb4c3a15..dbf1c8304 100644 --- a/changelog/3191.feature.rst +++ b/changelog/3191.feature.rst @@ -1,16 +1,22 @@ A warning is now issued when assertions are made for ``None``. -This is a common source of confusion among new users, which write:: +This is a common source of confusion among new users, which write: - assert mocked_object.assert_called_with(3, 4, 5, key='value') +.. code-block:: python -When they should write:: + assert mocked_object.assert_called_with(3, 4, 5, key="value") - 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:: +This warning will not be issued when ``None`` is explicitly checked. An assertion like: + +.. code-block:: python assert variable is None diff --git a/changelog/3616.removal.rst b/changelog/3616.removal.rst index a8f2f1c92..5d8c9134e 100644 --- a/changelog/3616.removal.rst +++ b/changelog/3616.removal.rst @@ -1,3 +1,3 @@ -Remove the deprecated compat properties for ``node.Class/Function/Module`` - use ``pytest.Class/Function/Module`` now. +Removed the deprecated compat properties for ``node.Class/Function/Module`` - use ``pytest.Class/Function/Module`` now. See our `docs `__ on information on how to update your code. diff --git a/changelog/4278.feature.rst b/changelog/4278.feature.rst new file mode 100644 index 000000000..332e64572 --- /dev/null +++ b/changelog/4278.feature.rst @@ -0,0 +1,4 @@ +``CACHEDIR.TAG`` files are now created inside cache directories. + +Those files are part of the `Cache Directory Tagging Standard `__, and can +be used by backup or synchronization programs to identify pytest's cache directory as such. diff --git a/changelog/4278.trivial.rst b/changelog/4278.trivial.rst deleted file mode 100644 index 126cabea8..000000000 --- a/changelog/4278.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -A CACHEDIR.TAG file gets added to the cache directory. diff --git a/changelog/4292.feature.rst b/changelog/4292.feature.rst index 27d113ba0..760a27783 100644 --- a/changelog/4292.feature.rst +++ b/changelog/4292.feature.rst @@ -1 +1 @@ -``pytest.outcomes.Exit`` is derived from ``SystemExit`` instead of ``KeyboardInterrupt``. +``pytest.outcomes.Exit`` is derived from ``SystemExit`` instead of ``KeyboardInterrupt``. This allows us to better handle ``pdb`` exiting. diff --git a/changelog/4386.feature.rst b/changelog/4386.feature.rst index fe827cc23..5133a39a7 100644 --- a/changelog/4386.feature.rst +++ b/changelog/4386.feature.rst @@ -1 +1 @@ -Restructure ExceptionInfo object construction and ensure incomplete instances have a ``repr``/``str``. +Restructured ``ExceptionInfo`` object construction and ensure incomplete instances have a ``repr``/``str``. diff --git a/changelog/4416.feature.rst b/changelog/4416.feature.rst index 89c0a84b1..949e7c25a 100644 --- a/changelog/4416.feature.rst +++ b/changelog/4416.feature.rst @@ -1,4 +1,4 @@ -pdb: support keyword arguments with ``pdb.set_trace`` +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. diff --git a/changelog/4421.removal.rst b/changelog/4421.removal.rst index 279587d06..4bebd5c19 100644 --- a/changelog/4421.removal.rst +++ b/changelog/4421.removal.rst @@ -1,3 +1,3 @@ -Remove the implementation of the ``pytest_namespace`` hook. +Removed the implementation of the ``pytest_namespace`` hook. See our `docs `__ on information on how to update your code. diff --git a/changelog/4435.bugfix.rst b/changelog/4435.bugfix.rst index de60b5e62..36ace1fab 100644 --- a/changelog/4435.bugfix.rst +++ b/changelog/4435.bugfix.rst @@ -1 +1 @@ -Fix ``raises(..., 'code(string)')`` frame filename. +Fixed ``raises(..., 'code(string)')`` frame filename. diff --git a/changelog/4435.deprecation.rst b/changelog/4435.deprecation.rst index f12f0bc6c..6815c1776 100644 --- a/changelog/4435.deprecation.rst +++ b/changelog/4435.deprecation.rst @@ -1 +1,3 @@ -Deprecate ``raises(..., 'code(as_a_string)')`` and ``warns(..., 'code(as_a_string)')``. See https://docs.pytest.org/en/latest/deprecations.html#raises-warns-exec +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. diff --git a/changelog/4483.feature.rst b/changelog/4483.feature.rst index d9bd4c717..e70db2979 100644 --- a/changelog/4483.feature.rst +++ b/changelog/4483.feature.rst @@ -1,2 +1,9 @@ -Add ini parameter ``junit_time`` to optionally report test call -durations less setup and teardown times. +Added ini parameter ``junit_time`` 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_time = call diff --git a/changelog/4535.removal.rst b/changelog/4535.removal.rst index f89900587..89de6b744 100644 --- a/changelog/4535.removal.rst +++ b/changelog/4535.removal.rst @@ -1 +1 @@ -Removed deprecated ``PyCollector.makeitem`` method. This method was made public by mistake a long time ago. +Removed the deprecated ``PyCollector.makeitem`` method. This method was made public by mistake a long time ago. diff --git a/changelog/4543.removal.rst b/changelog/4543.removal.rst index f810b5bad..0a2b615f9 100644 --- a/changelog/4543.removal.rst +++ b/changelog/4543.removal.rst @@ -1,3 +1,3 @@ -Remove support to define fixtures using the ``pytest_funcarg__`` prefix. Use the ``@pytest.fixture`` decorator instead. +Removed support to define fixtures using the ``pytest_funcarg__`` prefix. Use the ``@pytest.fixture`` decorator instead. See our `docs `__ on information on how to update your code.