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

Merge master into features #4021

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b553512
Amend CHANGELOG with missing #3251
nicoddemus Sep 6, 2018
3dd2933
Merge pull request #3948 from nicoddemus/fix-changelog
asottile Sep 7, 2018
826adaf
Improve pre-commit detection for changelog filenames
asottile Sep 7, 2018
2c90b3d
Merge pull request #3957 from asottile/changelog_files
asottile Sep 8, 2018
7537e94
tests: use unittest.mock with py34+
blueyed Sep 11, 2018
2cf2dc3
Merge pull request #3967 from blueyed/optional-mock
blueyed Sep 13, 2018
a0ce9a4
remove the legacy code about im_func and generalize using fix and com…
RonnyPfannschmidt Sep 13, 2018
8fe55b1
add changelog for fix #3975
RonnyPfannschmidt Sep 13, 2018
49800ea
Merge pull request #3977 from RonnyPfannschmidt/remove-im-func
nicoddemus Sep 13, 2018
9aa6b09
.pytest_cache is now automatically ignored by Git
nicoddemus Sep 14, 2018
87ddb2d
Change flaky test_request_garbage to provide more debug information
nicoddemus Sep 14, 2018
fa78da3
Update backward compatibility policy with new practices
nicoddemus Sep 14, 2018
cbb41f1
Ignore Sphinx's .doctrees folder
nicoddemus Sep 14, 2018
130cf7e
Fix rendering of the ini example for python_files
nicoddemus Sep 14, 2018
a4dd6ee
Fix linting
nicoddemus Sep 14, 2018
86a14d0
Fix scope determination with indirect parameters
nicoddemus Sep 15, 2018
f53eff9
Merge pull request #3982 from nicoddemus/ignore-pytest-cache
RonnyPfannschmidt Sep 15, 2018
2803eb9
Merge pull request #3984 from nicoddemus/fix-docs-formatting
nicoddemus Sep 15, 2018
bb57186
Merge pull request #3983 from nicoddemus/update-backward-policy
RonnyPfannschmidt Sep 16, 2018
93224f8
tox: remove obsolete whitelist_externals
blueyed Sep 17, 2018
739f9a4
Travis: use codecov-bash
blueyed Sep 17, 2018
03eaad3
tox: coverage factor: combine and report
blueyed Sep 17, 2018
1df6d28
Fix assertion rewriter crash if cwd changes mid-testing
nicoddemus Sep 13, 2018
37d2469
Use a PurePath instance to do matching against patterns in assertion …
nicoddemus Sep 17, 2018
ccb90b5
[WIP] Introduce deprecations page
nicoddemus Sep 18, 2018
28c9cc7
coverage: use modules for source
blueyed Sep 17, 2018
1e2e65f
Add references to the relevant Python issues
nicoddemus Sep 19, 2018
7f48f55
Fix linting
nicoddemus Sep 19, 2018
e7eb7e7
logging: del item.catch_log_handler only in teardown
blueyed Sep 19, 2018
29dac03
Merge pull request #3980 from nicoddemus/rewrite-cwd-changed
RonnyPfannschmidt Sep 19, 2018
d1fa8ae
Improve CHANGELOG entry
nicoddemus Sep 19, 2018
e86b01e
Update customize.rst
wimglenn Sep 19, 2018
1f28096
Merge pull request #4003 from pytest-dev/wimglenn-patch-1
wimglenn Sep 19, 2018
c284154
Introduce deprecations page
nicoddemus Sep 19, 2018
10b3b2d
Merge pull request #3990 from blueyed/coverage-source
nicoddemus Sep 19, 2018
27772f6
Merge pull request #3987 from nicoddemus/fix-find-scope-3941
nicoddemus Sep 19, 2018
7aff817
Merge pull request #3998 from blueyed/logging-del
nicoddemus Sep 19, 2018
7122fa5
Fix UnicodeDecodeError in assertion with mixed non-ascii bytes repr +…
asottile Sep 19, 2018
7a5e11b
Merge pull request #3997 from nicoddemus/deprecation-docs
nicoddemus Sep 20, 2018
f6eb39d
Merge pull request #4001 from asottile/fix_bytes_repr_text_mix_python_2
RonnyPfannschmidt Sep 20, 2018
41f6ea1
Fix 'Package has no len()' error during collection
nicoddemus Sep 20, 2018
f02dbaf
Merge pull request #4010 from nicoddemus/package-len-error-3749
RonnyPfannschmidt Sep 21, 2018
9b382ed
Fix typo in docstring
Sep 21, 2018
58aa4f9
Merge pull request #4012 from maxalbert/fix-docstring-typo
crazymerlyn Sep 21, 2018
650c458
Include Python 3.7 on getting started doc
williamjamir Sep 21, 2018
4ba3cb2
Merge pull request #4016 from williamjamir/patch-1
nicoddemus Sep 21, 2018
3f6a46c
Preparing release version 3.8.1
crazymerlyn Sep 22, 2018
ec57cbf
Merge pull request #4020 from crazymerlyn/release-3.8.1
crazymerlyn Sep 22, 2018
56d0b5a
Merge remote-tracking branch 'upstream/master' into merge-master-into…
nicoddemus Sep 22, 2018
fcc5b6d
Add "deprecation" to possible changelog entries in pre-commit
nicoddemus Sep 22, 2018
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
7 changes: 6 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[run]
source = _pytest,testing
source = pytest,_pytest,testing/
parallel = 1
branch = 1

[paths]
source = src/
.tox/*/lib/python*/site-packages/
.tox\*\Lib\site-packages\
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ src/_pytest/_version.py
.eggs/

doc/*/_build
doc/*/.doctrees
build/
dist/
*.egg-info
Expand Down
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ repos:
language: python
additional_dependencies: [pygments, restructuredtext_lint]
- id: changelogs-rst
name: changelog files must end in .rst
entry: ./scripts/fail
language: script
files: 'changelog/.*(?<!\.rst)$'
name: changelog filenames
language: fail
entry: 'changelog files must be named ####.(feature|bugfix|doc|removal|vendor|trivial).rst'
exclude: changelog/(\d+\.(feature|bugfix|doc|deprecation|removal|vendor|trivial).rst|README.rst|_template.rst)
files: ^changelog/
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ env:
- TOXENV=py27-xdist
- TOXENV=py27-trial
- TOXENV=py27-numpy
- TOXENV=py27-pluggymaster
- TOXENV=py27-pluggymaster PYTEST_NO_COVERAGE=1
- TOXENV=py36-pexpect
- TOXENV=py36-xdist
- TOXENV=py36-trial
- TOXENV=py36-numpy
- TOXENV=py36-pluggymaster
- TOXENV=py36-pluggymaster PYTEST_NO_COVERAGE=1
- TOXENV=py27-nobyte
- TOXENV=doctesting
- TOXENV=docs PYTEST_NO_COVERAGE=1
Expand Down Expand Up @@ -84,7 +84,7 @@ before_script:
if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
export COVERAGE_FILE="$PWD/.coverage"
export COVERAGE_PROCESS_START="$PWD/.coveragerc"
export _PYTEST_TOX_COVERAGE_RUN="coverage run --source {envsitepackagesdir}/_pytest/,{toxinidir}/testing -m"
export _PYTEST_TOX_COVERAGE_RUN="coverage run -m"
export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
fi

Expand All @@ -94,11 +94,11 @@ after_success:
- |
if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
set -e
pip install codecov
pip install coverage
coverage combine
coverage xml --ignore-errors
coverage report -m --ignore-errors
codecov --required -X gcov pycov search -f coverage.xml --flags ${TOXENV//-/ } linux
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -F "${TOXENV//-/,},linux"

# Coveralls does not support merged reports.
if [[ "$TOXENV" = py37 ]]; then
Expand Down
73 changes: 53 additions & 20 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,61 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start

pytest 3.8.0 (2018-09-05)
pytest 3.8.1 (2018-09-22)
=========================

Deprecations and Removals
-------------------------
Bug Fixes
---------

- `#3286 <https://github.com/pytest-dev/pytest/issues/3286>`_: ``.pytest_cache`` directory is now automatically ignored by Git. Users who would like to contribute a solution for other SCMs please consult/comment on this issue.


- `#3749 <https://github.com/pytest-dev/pytest/issues/3749>`_: Fix the following error during collection of tests inside packages::

TypeError: object of type 'Package' has no len()


- `#2452 <https://github.com/pytest-dev/pytest/issues/2452>`_: ``Config.warn`` has been deprecated, it should be replaced by calls to the standard ``warnings.warn``.
- `#3941 <https://github.com/pytest-dev/pytest/issues/3941>`_: Fix bug where indirect parametrization would consider the scope of all fixtures used by the test function to determine the parametrization scope, and not only the scope of the fixtures being parametrized.

``Node.warn`` now supports two signatures:

* ``node.warn(PytestWarning("some message"))``: is now the recommended way to call this function. The warning
instance must be a ``PytestWarning`` or subclass instance.
- `#3973 <https://github.com/pytest-dev/pytest/issues/3973>`_: Fix crash of the assertion rewriter if a test changed the current working directory without restoring it afterwards.


- `#3998 <https://github.com/pytest-dev/pytest/issues/3998>`_: Fix issue that prevented some caplog properties (for example ``record_tuples``) from being available when entering the debugger with ``--pdb``.


- `#3999 <https://github.com/pytest-dev/pytest/issues/3999>`_: Fix ``UnicodeDecodeError`` in python2.x when a class returns a non-ascii binary ``__repr__`` in an assertion which also contains non-ascii text.



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

* ``node.warn("CI", "some message")``: this code/message form is now deprecated and should be converted to
the warning instance form above.
- `#3996 <https://github.com/pytest-dev/pytest/issues/3996>`_: New `Deprecations and Removals <https://docs.pytest.org/en/latest/deprecations.html>`_ page shows all currently
deprecated features, the rationale to do so, and alternatives to update your code. It also list features removed
from pytest in past major releases to help those with ancient pytest versions to upgrade.

``RemovedInPytest4Warning`` and ``PytestExperimentalApiWarning`` are now part of the public API and should be accessed
using ``pytest.RemovedInPytest4Warning`` and ``pytest.PytestExperimentalApiWarning``.


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

- `#3955 <https://github.com/pytest-dev/pytest/issues/3955>`_: Improve pre-commit detection for changelog filenames


- `#3975 <https://github.com/pytest-dev/pytest/issues/3975>`_: Remove legacy code around im_func as that was python2 only


pytest 3.8.0 (2018-09-05)
=========================

Deprecations and Removals
-------------------------

- `#2452 <https://github.com/pytest-dev/pytest/issues/2452>`_: ``Config.warn`` and ``Node.warn`` have been
deprecated, see `<https://docs.pytest.org/en/latest/deprecations.html#config-warn-and-node-warn>`_ for rationale and
examples.

- `#3936 <https://github.com/pytest-dev/pytest/issues/3936>`_: ``@pytest.mark.filterwarnings`` second parameter is no longer regex-escaped,
making it possible to actually use regular expressions to check the warning message.

Expand All @@ -63,7 +98,10 @@ Features
more info.


- `#3784 <https://github.com/pytest-dev/pytest/issues/3784>`_: Add option to disable plugin auto-loading.
- `#3251 <https://github.com/pytest-dev/pytest/issues/3251>`_: Warnings are now captured and displayed during test collection.


- `#3784 <https://github.com/pytest-dev/pytest/issues/3784>`_: ``PYTEST_DISABLE_PLUGIN_AUTOLOAD`` environment variable disables plugin auto-loading when set.


- `#3829 <https://github.com/pytest-dev/pytest/issues/3829>`_: Added the ``count`` option to ``console_output_style`` to enable displaying the progress as a count instead of a percentage.
Expand Down Expand Up @@ -250,15 +288,10 @@ pytest 3.7.0 (2018-07-30)
Deprecations and Removals
-------------------------

- `#2639 <https://github.com/pytest-dev/pytest/issues/2639>`_: ``pytest_namespace`` has been deprecated.

See the documentation for ``pytest_namespace`` hook for suggestions on how to deal
with this in plugins which use this functionality.

- `#2639 <https://github.com/pytest-dev/pytest/issues/2639>`_: ``pytest_namespace`` has been `deprecated <https://docs.pytest.org/en/latest/deprecations.html#pytest-namespace>`_.

- `#3661 <https://github.com/pytest-dev/pytest/issues/3661>`_: Calling a fixture function directly, as opposed to request them in a test function, now issues a ``RemovedInPytest4Warning``. It will be changed into an error in pytest ``4.0``.

This is a great source of confusion to new users, which will often call the fixture functions and request them from test functions interchangeably, which breaks the fixture resolution model.
- `#3661 <https://github.com/pytest-dev/pytest/issues/3661>`_: Calling a fixture function directly, as opposed to request them in a test function, now issues a ``RemovedInPytest4Warning``. See `the documentation for rationale and examples <https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly>`_.



Expand Down Expand Up @@ -620,7 +653,7 @@ Deprecations and Removals
<https://github.com/pytest-dev/pytest/issues/2770>`_)

- Defining ``pytest_plugins`` is now deprecated in non-top-level conftest.py
files, because they "leak" to the entire directory tree. (`#3084
files, because they "leak" to the entire directory tree. `See the docs <https://docs.pytest.org/en/latest/deprecations.html#pytest-plugins-in-non-top-level-conftest-files>`_ for the rationale behind this decision (`#3084
<https://github.com/pytest-dev/pytest/issues/3084>`_)


Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ environment:
- TOXENV: "py27-trial"
- TOXENV: "py27-numpy"
- TOXENV: "py27-pluggymaster"
PYTEST_NO_COVERAGE: "1"
- TOXENV: "py36-xdist"
- TOXENV: "py36-trial"
- TOXENV: "py36-numpy"
- TOXENV: "py36-pluggymaster"
PYTEST_NO_COVERAGE: "1"
- TOXENV: "py27-nobyte"
- TOXENV: "doctesting"
- TOXENV: "py36-freeze"
Expand Down
1 change: 0 additions & 1 deletion changelog/3251.feture.rst

This file was deleted.

File renamed without changes.
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-3.8.1
release-3.8.0
release-3.7.4
release-3.7.3
Expand Down
25 changes: 25 additions & 0 deletions doc/en/announce/release-3.8.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
pytest-3.8.1
=======================================

pytest 3.8.1 has just been released to PyPI.

This is a bug-fix release, being a drop-in replacement. To upgrade::

pip install --upgrade pytest

The full changelog is available at https://docs.pytest.org/en/latest/changelog.html.

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

* Ankit Goel
* Anthony Sottile
* Bruno Oliveira
* Daniel Hahler
* Maximilian Albert
* Ronny Pfannschmidt
* William Jamir Silva
* wim glenn


Happy testing,
The pytest Development Team
10 changes: 6 additions & 4 deletions doc/en/backwards-compatibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ Keeping backwards compatibility has a very high priority in the pytest project.

With the pytest 3.0 release we introduced a clear communication scheme for when we will actually remove the old busted joint and politely ask you to use the new hotness instead, while giving you enough time to adjust your tests or raise concerns if there are valid reasons to keep deprecated functionality around.

To communicate changes we are already issuing deprecation warnings, but they are not displayed by default. In pytest 3.0 we changed the default setting so that pytest deprecation warnings are displayed if not explicitly silenced (with ``--disable-pytest-warnings``).
To communicate changes we issue deprecation warnings using a custom warning hierarchy (see :ref:`internal-warnings`). These warnings may be suppressed using the standard means: ``-W`` command-line flag or ``filterwarnings`` ini options (see :ref:`warnings`), but we suggest to use these sparingly and temporarily, and heed the warnings when possible.

We will only remove deprecated functionality in major releases (e.g. if we deprecate something in 3.0 we will remove it in 4.0), and keep it around for at least two minor releases (e.g. if we deprecate something in 3.9 and 4.0 is the next release, we will not remove it in 4.0 but in 5.0).
We will only start the removal of deprecated functionality in major releases (e.g. if we deprecate something in 3.0 we will start to remove it in 4.0), and keep it around for at least two minor releases (e.g. if we deprecate something in 3.9 and 4.0 is the next release, we start to remove it in 5.0, not in 4.0).

When the deprecation expires (e.g. 4.0 is released), we won't remove the deprecated functionality immediately, but will use the standard warning filters to turn them into **errors** by default. This approach makes it explicit that removal is imminent, and still gives you time to turn the deprecated feature into a warning instead of an error so it can be dealt with in your own time. In the next minor release (e.g. 4.1), the feature will be effectively removed.


Deprecation Roadmap
-------------------

We track deprecation and removal of features using milestones and the `deprecation <https://github.com/pytest-dev/pytest/issues?q=label%3A%22type%3A+deprecation%22>`_ and `removal <https://github.com/pytest-dev/pytest/labels/type%3A%20removal>`_ labels on GitHub.
Features currently deprecated and removed in previous releases can be found in :ref:`deprecations`.

Following our deprecation policy, after starting issuing deprecation warnings we keep features for *at least* two minor versions before considering removal.
We track future deprecation and removal of features using milestones and the `deprecation <https://github.com/pytest-dev/pytest/issues?q=label%3A%22type%3A+deprecation%22>`_ and `removal <https://github.com/pytest-dev/pytest/labels/type%3A%20removal>`_ labels on GitHub.
1 change: 1 addition & 0 deletions doc/en/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Full pytest documentation
bash-completion

backwards-compatibility
deprecations
historical-notes
license
contributing
Expand Down
2 changes: 1 addition & 1 deletion doc/en/customize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Here's a summary what ``pytest`` uses ``rootdir`` for:
class name, function name and parametrization (if any).

* Is used by plugins as a stable location to store project/test run specific information;
for example, the internal :ref:`cache <cache>` plugin creates a ``.cache`` subdirectory
for example, the internal :ref:`cache <cache>` plugin creates a ``.pytest_cache`` subdirectory
in ``rootdir`` to store its cross-test run state.

Important to emphasize that ``rootdir`` is **NOT** used to modify ``sys.path``/``PYTHONPATH`` or
Expand Down
Loading