Skip to content

Commit

Permalink
Merge branch 'master' into term-color
Browse files Browse the repository at this point in the history
Conflicts:
	src/_pytest/terminal.py
	testing/test_debugging.py
	testing/test_terminal.py
  • Loading branch information
blueyed committed Feb 15, 2020
2 parents fa87766 + 7fc9d4c commit e872532
Show file tree
Hide file tree
Showing 147 changed files with 3,425 additions and 1,446 deletions.
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ Thanks for submitting a PR, your contribution is really appreciated!
Here is a quick checklist that should be present in PRs.
- [ ] Target the `master` branch for bug fixes, documentation updates and trivial changes.
- [ ] Target the `features` branch for new features, improvements, and removals/deprecations.
- [ ] Include documentation when adding new features.
- [ ] Include new tests or update existing tests when applicable.
- [X] Allow maintainers to push and squash when merging my commits. Please uncheck this if you prefer to squash the commits yourself.
Unless your change is trivial or a small documentation fix (e.g., a typo or reword of a small section) please:
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ on:
push:
branches:
- master
- "[0-9]+.[0-9]+.x"
tags:
- "*"

pull_request:
branches:
- master
- "[0-9]+.[0-9]+.x"

jobs:
build:
Expand Down Expand Up @@ -52,6 +54,7 @@ jobs:
python: "3.5"
os: windows-latest
tox_env: "py35-xdist"
use_coverage: true
- name: "windows-py36"
python: "3.6"
os: windows-latest
Expand All @@ -68,6 +71,7 @@ jobs:
python: "3.8"
os: windows-latest
tox_env: "py38"
use_coverage: true

- name: "ubuntu-py35"
python: "3.5"
Expand All @@ -81,6 +85,7 @@ jobs:
python: "3.7"
os: ubuntu-latest
tox_env: "py37-lsof-numpy-oldattrs-pexpect-twisted"
use_coverage: true
- name: "ubuntu-py37-pluggy"
python: "3.7"
os: ubuntu-latest
Expand All @@ -89,8 +94,6 @@ jobs:
python: "3.7"
os: ubuntu-latest
tox_env: "py37-freeze"
# coverage does not apply for freeze test, skip it
skip_coverage: true
- name: "ubuntu-py38"
python: "3.8"
os: ubuntu-latest
Expand All @@ -99,8 +102,6 @@ jobs:
python: "pypy3"
os: ubuntu-latest
tox_env: "pypy3-xdist"
# coverage too slow with pypy3, skip it
skip_coverage: true

- name: "macos-py37"
python: "3.7"
Expand All @@ -110,21 +111,21 @@ jobs:
python: "3.8"
os: macos-latest
tox_env: "py38-xdist"
use_coverage: true

- name: "linting"
python: "3.7"
os: ubuntu-latest
tox_env: "linting"
skip_coverage: true
- name: "docs"
python: "3.7"
os: ubuntu-latest
tox_env: "docs"
skip_coverage: true
- name: "doctesting"
python: "3.7"
os: ubuntu-latest
tox_env: "doctesting"
use_coverage: true

steps:
- uses: actions/checkout@v1
Expand All @@ -138,24 +139,24 @@ jobs:
pip install tox coverage
- name: Test without coverage
if: "matrix.skip_coverage"
if: "! matrix.use_coverage"
run: "tox -e ${{ matrix.tox_env }}"

- name: Test with coverage
if: "! matrix.skip_coverage"
if: "matrix.use_coverage"
env:
_PYTEST_TOX_COVERAGE_RUN: "coverage run -m"
COVERAGE_PROCESS_START: ".coveragerc"
_PYTEST_TOX_EXTRA_DEP: "coverage-enable-subprocess"
run: "tox -e ${{ matrix.tox_env }}"

- name: Prepare coverage token
if: (!matrix.skip_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' ))
if: (matrix.use_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' ))
run: |
python scripts/append_codecov_token.py
- name: Report coverage
if: (!matrix.skip_coverage)
if: (matrix.use_coverage)
env:
CODECOV_NAME: ${{ matrix.name }}
run: bash scripts/report-coverage.sh -F GHA,${{ runner.os }}
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ repos:
- id: rst
name: rst
entry: rst-lint --encoding utf-8
files: ^(HOWTORELEASE.rst|README.rst|TIDELIFT.rst)$
files: ^(RELEASING.rst|README.rst|TIDELIFT.rst)$
language: python
additional_dependencies: [pygments, restructuredtext_lint]
- id: changelogs-rst
name: changelog filenames
language: fail
entry: 'changelog files must be named ####.(feature|bugfix|doc|deprecation|removal|vendor|trivial).rst'
exclude: changelog/(\d+\.(feature|improvement|bugfix|doc|deprecation|removal|vendor|trivial).rst|README.rst|_template.rst)
entry: 'changelog files must be named ####.(breaking|bugfix|deprecation|doc|feature|improvement|trivial|vendor).rst'
exclude: changelog/(\d+\.(breaking|bugfix|deprecation|doc|feature|improvement|trivial|vendor).rst|README.rst|_template.rst)
files: ^changelog/
- id: py-deprecated
name: py library is deprecated
Expand Down
39 changes: 6 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
dist: xenial
python: '3.7'
dist: trusty
python: '3.5.1'
cache: false

env:
Expand All @@ -16,36 +16,11 @@ install:

jobs:
include:
# OSX tests - first (in test stage), since they are the slower ones.
# Coverage for:
# - osx
# - verbose=1
- os: osx
osx_image: xcode10.1
language: generic
env: TOXENV=py37-xdist PYTEST_COVERAGE=1 PYTEST_ADDOPTS=-v
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 supported version, without xdist.
# Coverage for:
# - pytester's LsofFdLeakChecker
# - TestArgComplete (linux only)
# - numpy
# - old attrs
# - verbose=0
# - test_sys_breakpoint_interception (via pexpect).
- env: TOXENV=py37-lsof-numpy-oldattrs-pexpect-twisted PYTEST_COVERAGE=1 PYTEST_ADDOPTS=
python: '3.7'

# Coverage for Python 3.5.{0,1} specific code, mostly typing related.
- env: TOXENV=py35 PYTEST_COVERAGE=1 PYTEST_ADDOPTS="-k test_raises_cyclic_reference"
python: '3.5.1'
dist: trusty
before_install:
# Work around https://github.com/jaraco/zipp/issues/40.
- python -m pip install -U pip 'setuptools>=34.4.0' virtualenv

before_script:
- |
Expand Down Expand Up @@ -82,6 +57,4 @@ notifications:
branches:
only:
- master
- features
- 4.6-maintenance
- /^\d+(\.\d+)+$/
- /^\d+\.\d+\.x$/
12 changes: 10 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,21 @@ Carl Friedrich Bolz
Carlos Jenkins
Ceridwen
Charles Cloud
Charles Machalow
Charnjit SiNGH (CCSJ)
Chris Lamb
Christian Boelsen
Christian Fetzer
Christian Neumüller
Christian Theunert
Christian Tismer
Christopher Gilling
Christoph Buelter
Christopher Dignam
Christopher Gilling
Claudio Madotto
CrazyMerlyn
Cyrus Maden
Damian Skrzypczak
Dhiren Serai
Daniel Grana
Daniel Hahler
Daniel Nuri
Expand All @@ -80,6 +81,7 @@ David Szotten
David Vierra
Daw-Ran Liou
Denis Kirisov
Dhiren Serai
Diego Russo
Dmitry Dygalo
Dmitry Pribysh
Expand Down Expand Up @@ -112,6 +114,7 @@ Guido Wesdorp
Guoqiang Zhang
Harald Armin Massa
Henk-Jaap Wagenaar
Holger Kohr
Hugo van Kemenade
Hui Wang (coldnight)
Ian Bicking
Expand All @@ -120,6 +123,7 @@ Ilya Konstantinov
Ionuț Turturică
Iwan Briquemont
Jaap Broekhuizen
Jakub Mitoraj
Jan Balster
Janne Vanhala
Jason R. Coombs
Expand Down Expand Up @@ -206,8 +210,10 @@ Omer Hadari
Ondřej Súkup
Oscar Benjamin
Patrick Hayes
Pauli Virtanen
Paweł Adamczak
Pedro Algarvio
Philipp Loose
Pieter Mulder
Piotr Banaszkiewicz
Pulkit Goyal
Expand Down Expand Up @@ -240,6 +246,7 @@ Simon Gomizelj
Skylar Downes
Srinivas Reddy Thatiparthy
Stefan Farmbauer
Stefan Scherfke
Stefan Zimmermann
Stefano Taschini
Steffen Allner
Expand Down Expand Up @@ -268,6 +275,7 @@ Vidar T. Fauske
Virgil Dupras
Vitaly Lashmanov
Vlad Dragos
Vladyslav Rachek
Volodymyr Piskun
Wei Lin
Wil Cooley
Expand Down
11 changes: 2 additions & 9 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ Short version

#. Fork the repository.
#. Enable and install `pre-commit <https://pre-commit.com>`_ to ensure style-guides and code checks are followed.
#. Target ``master`` for bug fixes and doc changes.
#. Target ``features`` for new features or functionality changes.
#. Follow **PEP-8** for naming and `black <https://github.com/psf/black>`_ for formatting.
#. Tests are run using ``tox``::

Expand Down Expand Up @@ -204,14 +202,10 @@ Here is a simple overview, with pytest-specific bits:

$ git clone git@github.com:YOUR_GITHUB_USERNAME/pytest.git
$ cd pytest
# now, to fix a bug create your own branch off "master":
# now, create your own branch off "master":

$ git checkout -b your-bugfix-branch-name master

# or to instead add a feature create your own branch off "features":

$ git checkout -b your-feature-branch-name features

Given we have "major.minor.micro" version numbers, bug fixes will usually
be released in micro releases whereas features will be released in
minor releases and incompatible changes in major releases.
Expand Down Expand Up @@ -294,8 +288,7 @@ Here is a simple overview, with pytest-specific bits:
compare: your-branch-name

base-fork: pytest-dev/pytest
base: master # if it's a bug fix
base: features # if it's a feature
base: master


Writing Tests
Expand Down
30 changes: 14 additions & 16 deletions HOWTORELEASE.rst → RELEASING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,38 @@ taking a lot of time to make a new one.
pytest releases must be prepared on **Linux** because the docs and examples expect
to be executed on that platform.

#. Create a branch ``release-X.Y.Z`` with the version for the release.
To release a version ``MAJOR.MINOR.PATCH``, follow these steps:

* **maintenance releases**: from ``4.6-maintenance``;
#. For major and minor releases, create a new branch ``MAJOR.MINOR.x`` from the
latest ``master`` and push it to the ``pytest-dev/pytest`` repo.

* **patch releases**: from the latest ``master``;
#. Create a branch ``release-MAJOR.MINOR.PATCH`` from the ``MAJOR.MINOR.x`` branch.

* **minor releases**: from the latest ``features``; then merge with the latest ``master``;

Ensure your are in a clean work tree.
Ensure your are updated and in a clean working tree.

#. Using ``tox``, generate docs, changelog, announcements::

$ tox -e release -- <VERSION>
$ tox -e release -- MAJOR.MINOR.PATCH

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

#. Open a PR for this branch targeting ``master`` (or ``4.6-maintenance`` for
maintenance releases).
#. Open a PR for the ``release-MAJOR.MINOR.PATCH`` branch targeting ``MAJOR.MINOR.x``.

#. After all tests pass and the PR has been approved, publish to PyPI by pushing the tag::
#. After all tests pass and the PR has been approved, tag the release commit
in the ``MAJOR.MINOR.x`` branch and push it. This will publish to PyPI::

git tag <VERSION>
git push git@github.com:pytest-dev/pytest.git <VERSION>
git tag MAJOR.MINOR.PATCH
git push git@github.com:pytest-dev/pytest.git MAJOR.MINOR.PATCH

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

#. Merge the PR.

#. If this is a maintenance release, cherry-pick the CHANGELOG / announce
files to the ``master`` branch::
#. 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 -b cherry-pick-release
git cherry-pick --no-commit -m1 origin/MAJOR.MINOR.x
git checkout origin/master -- changelog
git commit # no arguments

Expand Down
1 change: 1 addition & 0 deletions changelog/1857.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``pytest.mark.parametrize`` accepts integers for ``ids`` again, converting it to strings.
5 changes: 5 additions & 0 deletions changelog/3238.deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Option ``--no-print-logs`` is deprecated and meant to be removed in a future release. If you use ``--no-print-logs``, please try out ``--show-capture`` and
provide feedback.

``--show-capture`` command-line option was added in ``pytest 3.5.0`` and allows to specify how to
display captured output when tests fail: ``no``, ``stdout``, ``stderr``, ``log`` or ``all`` (the default).
1 change: 1 addition & 0 deletions changelog/3823.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``--trace`` now works with unittests.
1 change: 1 addition & 0 deletions changelog/4445.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed some warning reports produced by pytest to point to the correct location of the warning in the user's code.
1 change: 1 addition & 0 deletions changelog/449.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use "yellow" main color with any XPASSED tests.
1 change: 1 addition & 0 deletions changelog/4597.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
New :ref:`--capture=tee-sys <capture-method>` option to allow both live printing and capturing of test output.
4 changes: 4 additions & 0 deletions changelog/4639.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Revert "A warning is now issued when assertions are made for ``None``".

The warning proved to be less useful than initially expected and had quite a
few false positive cases.
1 change: 1 addition & 0 deletions changelog/5686.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``tmpdir_factory.mktemp`` now fails when given absolute and non-normalized paths.
2 changes: 2 additions & 0 deletions changelog/5712.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Now all arguments to ``@pytest.mark.parametrize`` need to be explicitly declared in the function signature or via ``indirect``.
Previously it was possible to omit an argument if a fixture with the same name existed, which was just an accident of implementation and was not meant to be a part of the API.
1 change: 1 addition & 0 deletions changelog/5928.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Report ``PytestUnknownMarkWarning`` at the level of the user's code, not ``pytest``'s.
Loading

0 comments on commit e872532

Please sign in to comment.