Skip to content

Merge master into features #5374

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 34 commits into from
Jun 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e7cd00a
Preparing release version 4.6.0
asottile May 31, 2019
917195e
Merge pull request #5350 from asottile/release-4.6.0
asottile Jun 1, 2019
e2ac4b7
Fix link anchor
hugovk Jun 1, 2019
a8f4e56
Docs: Fix link anchor (#5355)
nicoddemus Jun 1, 2019
cafb13c
Fix `pytest.mark.parametrize` when the argvalue is an iterator
asottile Jun 1, 2019
e4fe41e
Merge pull request #5356 from asottile/fix_parametrize_iterator
asottile Jun 1, 2019
acdf30a
Fix all() unroll for non-generators/non-list comprehensions
nicoddemus Jun 2, 2019
733f43b
Fix all() unroll for non-generators/non-list comprehensions (#5360)
nicoddemus Jun 2, 2019
4d49ba6
Drop Python 2.7 and 3.4 support
nicoddemus May 27, 2019
a6dc283
Revert "ci: Travis: add pypy3 to allowed failures temporarily"
blueyed Jun 2, 2019
642ef6d
Merge pull request #5362 from asottile/release-4.6.1
asottile Jun 2, 2019
25e728c
Update release instructions for 4.6-maintenance
asottile Jun 2, 2019
5c016d1
Fix typo about interpreters count in doc/en/example/parametrize.html
apollovy Jun 2, 2019
b7f8f53
Revert "ci: Travis: add pypy3 to allowed failures temporarily" (#5364)
nicoddemus Jun 2, 2019
876df87
Update release instructions for 4.6-maintenance (#5363)
nicoddemus Jun 2, 2019
602a290
Drop py27 and py34 support (#5318)
nicoddemus Jun 2, 2019
6e68532
Merge pull request #5362 from asottile/release-4.6.1 (#5365)
nicoddemus Jun 2, 2019
5999782
Use python 3 interpreters in example
nicoddemus Jun 2, 2019
28ac469
Merge pull request #5367 from apollovy/master
nicoddemus Jun 2, 2019
ef05319
logging: Extend LEVELNAME_FMT_REGEX
twmr May 29, 2019
b8781ff
Merge pull request #5335 from thisch/fmtregex
twmr Jun 3, 2019
9905755
manual changes to .pre-commit-config.yaml
asottile Jun 2, 2019
5034399
pre-commit run fix-encoding-pragma --all-files
asottile Jun 2, 2019
3f1ec52
pre-commit run reorder-python-imports --all-files
asottile Jun 2, 2019
a91fe1f
pre-commit run pyupgrade --all-files
asottile Jun 2, 2019
4df529e
Clean up __future__ and coding: in tests
asottile Jun 2, 2019
c63320c
codecs.open / io.open
asottile Jun 2, 2019
ca1efd5
git rm src/_pytest/_code/_py2traceback.py
asottile Jun 2, 2019
5dcf85c
manual: remove dependence on six
asottile Jun 2, 2019
96fd44e
Update line number for warning
asottile Jun 2, 2019
8292644
Allow multiple positions for the SyntaxError in pypy3.6
asottile Jun 3, 2019
6d393c5
Enable coverage for 'py37' environment
nicoddemus Jun 3, 2019
ce78c9a
Fix linting
nicoddemus Jun 3, 2019
5976f36
Merge pull request #5368 from asottile/pyupgrade
asottile Jun 3, 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
13 changes: 7 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ repos:
args: [--safe, --quiet]
language_version: python3
- repo: https://github.com/asottile/blacken-docs
rev: v0.5.0
rev: v1.0.0
hooks:
- id: blacken-docs
additional_dependencies: [black==19.3b0]
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.2
rev: v2.2.3
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: fix-encoding-pragma
args: [--remove]
- id: check-yaml
- id: debug-statements
exclude: _pytest/debugging.py
Expand All @@ -31,14 +32,14 @@ repos:
rev: v1.4.0
hooks:
- id: reorder-python-imports
args: ['--application-directories=.:src']
args: ['--application-directories=.:src', --py3-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v1.15.0
rev: v1.18.0
hooks:
- id: pyupgrade
args: [--keep-percent-format]
args: [--py3-plus]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.3.0
rev: v1.4.0
hooks:
- id: rst-backticks
- repo: local
Expand Down
41 changes: 8 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,28 @@ install:
jobs:
include:
# OSX tests - first (in test stage), since they are the slower ones.
- &test-macos
os: osx
- 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
# Coverage for:
# - py2 with symlink in test_cmdline_python_package_symlink.
env: TOXENV=py27-xdist PYTEST_COVERAGE=1
before_install:
- python -V
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 27
- <<: *test-macos
env: TOXENV=py37-pexpect,py37-xdist PYTEST_COVERAGE=1
env: TOXENV=py37-xdist PYTEST_COVERAGE=1
before_install:
- which python3
- python3 -V
- ln -sfn "$(which python3)" /usr/local/bin/python
- python -V
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 37

# Full run of latest (major) supported versions, without xdist.
- env: TOXENV=py27
python: '2.7'
- env: TOXENV=py37
# Full run of latest supported version, without xdist.
- env: TOXENV=py37 PYTEST_COVERAGE=1
python: '3.7'

# Coverage tracking is slow with pypy, skip it.
- env: TOXENV=pypy-xdist
python: 'pypy'
- env: TOXENV=pypy3-xdist
python: 'pypy3'

- env: TOXENV=py34-xdist
python: '3.4'
- env: TOXENV=py35-xdist
python: '3.5'

Expand All @@ -62,12 +51,6 @@ jobs:
# Empty PYTEST_ADDOPTS to run this non-verbose.
- env: TOXENV=py37-lsof-numpy-xdist PYTEST_COVERAGE=1 PYTEST_ADDOPTS=

# Specialized factors for py27.
- env: TOXENV=py27-nobyte-numpy-xdist
python: '2.7'
- env: TOXENV=py27-pluggymaster-xdist
python: '2.7'

# Specialized factors for py37.
# Coverage for:
# - test_sys_breakpoint_interception (via pexpect).
Expand All @@ -81,12 +64,7 @@ jobs:
if: type = cron

- stage: baseline
# Coverage for:
# - _pytest.unittest._handle_skip (via pexpect).
env: TOXENV=py27-pexpect,py27-twisted PYTEST_COVERAGE=1
python: '2.7'
# Use py36 here for faster baseline.
- env: TOXENV=py36-xdist
env: TOXENV=py36-xdist
python: '3.6'
- env: TOXENV=linting,docs,doctesting PYTEST_COVERAGE=1
cache:
Expand All @@ -112,9 +90,6 @@ matrix:
allow_failures:
- python: '3.8-dev'
env: TOXENV=py38-xdist
# Temporary (https://github.com/pytest-dev/pytest/pull/5334).
- env: TOXENV=pypy3-xdist
python: 'pypy3'

before_script:
- |
Expand Down
90 changes: 90 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,96 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start

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

Bug Fixes
---------

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


- `#5358 <https://github.com/pytest-dev/pytest/issues/5358>`_: Fix assertion rewriting of ``all()`` calls to deal with non-generators.


pytest 4.6.0 (2019-05-31)
=========================

Important
---------

The ``4.6.X`` series will be the last series to support **Python 2 and Python 3.4**.

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


Features
--------

- `#4559 <https://github.com/pytest-dev/pytest/issues/4559>`_: Added the ``junit_log_passing_tests`` ini value which can be used to enable or disable logging of passing test output in the Junit XML file.


- `#4956 <https://github.com/pytest-dev/pytest/issues/4956>`_: pytester's ``testdir.spawn`` uses ``tmpdir`` as HOME/USERPROFILE directory.


- `#5062 <https://github.com/pytest-dev/pytest/issues/5062>`_: Unroll calls to ``all`` to full for-loops with assertion rewriting for better failure messages, especially when using Generator Expressions.


- `#5063 <https://github.com/pytest-dev/pytest/issues/5063>`_: Switch from ``pkg_resources`` to ``importlib-metadata`` for entrypoint detection for improved performance and import time.


- `#5091 <https://github.com/pytest-dev/pytest/issues/5091>`_: The output for ini options in ``--help`` has been improved.


- `#5269 <https://github.com/pytest-dev/pytest/issues/5269>`_: ``pytest.importorskip`` includes the ``ImportError`` now in the default ``reason``.


- `#5311 <https://github.com/pytest-dev/pytest/issues/5311>`_: Captured logs that are output for each failing test are formatted using the
ColoredLevelFormatter.


- `#5312 <https://github.com/pytest-dev/pytest/issues/5312>`_: Improved formatting of multiline log messages in Python 3.



Bug Fixes
---------

- `#2064 <https://github.com/pytest-dev/pytest/issues/2064>`_: The debugging plugin imports the wrapped ``Pdb`` class (``--pdbcls``) on-demand now.


- `#4908 <https://github.com/pytest-dev/pytest/issues/4908>`_: The ``pytest_enter_pdb`` hook gets called with post-mortem (``--pdb``).


- `#5036 <https://github.com/pytest-dev/pytest/issues/5036>`_: Fix issue where fixtures dependent on other parametrized fixtures would be erroneously parametrized.


- `#5256 <https://github.com/pytest-dev/pytest/issues/5256>`_: Handle internal error due to a lone surrogate unicode character not being representable in Jython.


- `#5257 <https://github.com/pytest-dev/pytest/issues/5257>`_: Ensure that ``sys.stdout.mode`` does not include ``'b'`` as it is a text stream.


- `#5278 <https://github.com/pytest-dev/pytest/issues/5278>`_: Pytest's internal python plugin can be disabled using ``-p no:python`` again.


- `#5286 <https://github.com/pytest-dev/pytest/issues/5286>`_: Fix issue with ``disable_test_id_escaping_and_forfeit_all_rights_to_community_support`` option not working when using a list of test IDs in parametrized tests.


- `#5330 <https://github.com/pytest-dev/pytest/issues/5330>`_: Show the test module being collected when emitting ``PytestCollectionWarning`` messages for
test classes with ``__init__`` and ``__new__`` methods to make it easier to pin down the problem.


- `#5333 <https://github.com/pytest-dev/pytest/issues/5333>`_: Fix regression in 4.5.0 with ``--lf`` not re-running all tests with known failures from non-selected tests.



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

- `#5250 <https://github.com/pytest-dev/pytest/issues/5250>`_: Expand docs on use of ``setenv`` and ``delenv`` with ``monkeypatch``.


pytest 4.5.0 (2019-05-11)
=========================

Expand Down
16 changes: 14 additions & 2 deletions HOWTORELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ taking a lot of time to make a new one.

#. Create a branch ``release-X.Y.Z`` with the version for the release.

* **maintenance releases**: from ``4.6-maintenance``;

* **patch releases**: from the latest ``master``;

* **minor releases**: from the latest ``features``; then merge with the latest ``master``;
Expand All @@ -24,7 +26,8 @@ taking a lot of time to make a new one.

This will generate a commit with all the changes ready for pushing.

#. Open a PR for this branch targeting ``master``.
#. Open a PR for this branch targeting ``master`` (or ``4.6-maintenance`` for
maintenance releases).

#. After all tests pass and the PR has been approved, publish to PyPI by pushing the tag::

Expand All @@ -33,7 +36,16 @@ taking a lot of time to make a new one.

Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.

#. Merge the PR into ``master``.
#. Merge the PR.

#. If this is a maintenance release, cherry-pick the CHANGELOG / announce
files to the ``master`` branch::

git fetch --all --prune
git checkout origin/master -b cherry-pick-maintenance-release
git cherry-pick --no-commit -m1 origin/4.6-maintenance
git checkout origin/master -- changelog
git commit # no arguments

#. Send an email announcement with the contents from::

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Features
- Can run `unittest <https://docs.pytest.org/en/latest/unittest.html>`_ (or trial),
`nose <https://docs.pytest.org/en/latest/nose.html>`_ test suites out of the box;

- Python 2.7, Python 3.4+, PyPy 2.3, Jython 2.5 (untested);
- Python 3.5+ and PyPy3;

- Rich plugin architecture, with over 315+ `external plugins <http://plugincompat.herokuapp.com>`_ and thriving community;

Expand Down
41 changes: 1 addition & 40 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ trigger:

variables:
PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml -vv"
python.needs_vc: False
COVERAGE_FILE: "$(Build.Repository.LocalPath)/.coverage"
COVERAGE_PROCESS_START: "$(Build.Repository.LocalPath)/.coveragerc"
PYTEST_COVERAGE: '0'
Expand All @@ -16,44 +15,10 @@ jobs:
vmImage: "vs2017-win2016"
strategy:
matrix:
py27:
python.version: '2.7'
tox.env: 'py27'
py27-nobyte-lsof-numpy:
python.version: '2.7'
tox.env: 'py27-lsof-nobyte-numpy'
# Coverage for:
# - test_supports_breakpoint_module_global
# - test_terminal_reporter_writer_attr (without xdist)
# - "if write" branch in _pytest.assertion.rewrite
# - numpy
# - pytester's LsofFdLeakChecker (being skipped)
PYTEST_COVERAGE: '1'
py27-twisted:
python.version: '2.7'
tox.env: 'py27-twisted'
python.needs_vc: True
py27-pluggymaster-xdist:
python.version: '2.7'
tox.env: 'py27-pluggymaster-xdist'
# Coverage for:
# - except-IOError in _attempt_to_close_capture_file for py2.
# Also seen with py27-nobyte (using xdist), and py27-xdist.
# But no exception with py27-pexpect,py27-twisted,py27-numpy.
PYTEST_COVERAGE: '1'
# -- pypy2 and pypy3 are disabled for now: #5279 --
# pypy:
# python.version: 'pypy2'
# tox.env: 'pypy'
# -- pypy3 disabled for now: #5279 --
# pypy3:
# python.version: 'pypy3'
# tox.env: 'pypy3'
py34-xdist:
python.version: '3.4'
tox.env: 'py34-xdist'
# Coverage for:
# - _pytest.compat._bytes_to_ascii
PYTEST_COVERAGE: '1'
py35-xdist:
python.version: '3.5'
tox.env: 'py35-xdist'
Expand Down Expand Up @@ -87,10 +52,6 @@ jobs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: choco install vcpython27
condition: eq(variables['python.needs_vc'], True)
displayName: 'Install VC for py27'

- script: python -m pip install --upgrade pip && python -m pip install tox
displayName: 'Install tox'

Expand Down
1 change: 0 additions & 1 deletion bench/bench.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import sys

if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion bench/bench_argcomplete.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# 10000 iterations, just for relative comparison
# 2.7.5 3.3.2
# FilesCompleter 75.1109 69.2116
Expand Down
1 change: 0 additions & 1 deletion bench/empty.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-
for i in range(1000):
exec("def test_func_%d(): pass" % i)
1 change: 0 additions & 1 deletion bench/manyparam.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import pytest


Expand Down
3 changes: 0 additions & 3 deletions bench/skip.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from six.moves import range

import pytest

SKIP = True
Expand Down
1 change: 0 additions & 1 deletion changelog/2064.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4559.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4908.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4956.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/5036.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/5062.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/5063.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/5091.feature.rst

This file was deleted.

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

This file was deleted.

1 change: 0 additions & 1 deletion changelog/5256.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/5257.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/5269.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/5278.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/5286.bugfix.rst

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/5311.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/5312.feature.rst

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/5330.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/5333.bugfix.rst

This file was deleted.

2 changes: 2 additions & 0 deletions changelog/5335.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Colorize level names when the level in the logging format is formatted using
'%(levelname).Xs' (truncated fixed width alignment), where X is an integer.
Loading