Merge branch 'main' into warn-when-a-mark-is-applied-to-a-fixture
|
@ -25,6 +25,7 @@ exclude_lines =
|
||||||
^\s*raise NotImplementedError\b
|
^\s*raise NotImplementedError\b
|
||||||
^\s*return NotImplemented\b
|
^\s*return NotImplemented\b
|
||||||
^\s*assert False(,|$)
|
^\s*assert False(,|$)
|
||||||
|
^\s*assert_never\(
|
||||||
|
|
||||||
^\s*if TYPE_CHECKING:
|
^\s*if TYPE_CHECKING:
|
||||||
^\s*@overload( |$)
|
^\s*@overload( |$)
|
||||||
|
|
|
@ -13,7 +13,7 @@ If this change fixes an issue, please:
|
||||||
|
|
||||||
Unless your change is trivial or a small documentation fix (e.g., a typo or reword of a small section) please:
|
Unless your change is trivial or a small documentation fix (e.g., a typo or reword of a small section) please:
|
||||||
|
|
||||||
- [ ] Create a new changelog file in the `changelog` folder, with a name like `<ISSUE NUMBER>.<TYPE>.rst`. See [changelog/README.rst](https://github.com/pytest-dev/pytest/blob/master/changelog/README.rst) for details.
|
- [ ] Create a new changelog file in the `changelog` folder, with a name like `<ISSUE NUMBER>.<TYPE>.rst`. See [changelog/README.rst](https://github.com/pytest-dev/pytest/blob/main/changelog/README.rst) for details.
|
||||||
|
|
||||||
Write sentences in the **past or present tense**, examples:
|
Write sentences in the **past or present tense**, examples:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
name: backport
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Note that `pull_request_target` has security implications:
|
||||||
|
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
|
||||||
|
# In particular:
|
||||||
|
# - Only allow triggers that can be used only be trusted users
|
||||||
|
# - Don't execute any code from the target branch
|
||||||
|
# - Don't use cache
|
||||||
|
pull_request_target:
|
||||||
|
types: [labeled]
|
||||||
|
|
||||||
|
# Set permissions at the job level.
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
backport:
|
||||||
|
if: startsWith(github.event.label.name, 'backport ') && github.event.pull_request.merged
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: true
|
||||||
|
|
||||||
|
- name: Create backport PR
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
git config --global user.name "pytest bot"
|
||||||
|
git config --global user.email "pytestbot@gmail.com"
|
||||||
|
|
||||||
|
label='${{ github.event.label.name }}'
|
||||||
|
target_branch="${label#backport }"
|
||||||
|
backport_branch=backport-${{ github.event.number }}-to-"${target_branch}"
|
||||||
|
subject="[$target_branch] $(gh pr view --json title -q .title ${{ github.event.number }})"
|
||||||
|
|
||||||
|
git checkout origin/"${target_branch}" -b "${backport_branch}"
|
||||||
|
git cherry-pick -x --mainline 1 ${{ github.event.pull_request.merge_commit_sha }}
|
||||||
|
git commit --amend --message "$subject"
|
||||||
|
git push --set-upstream origin --force-with-lease "${backport_branch}"
|
||||||
|
gh pr create \
|
||||||
|
--base "${target_branch}" \
|
||||||
|
--title "${subject}" \
|
||||||
|
--body "Backport of PR #${{ github.event.number }} to $target_branch branch. PR created by backport workflow."
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -0,0 +1,56 @@
|
||||||
|
name: deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
# These tags are protected, see:
|
||||||
|
# https://github.com/pytest-dev/pytest/settings/tag_protection
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
|
||||||
|
|
||||||
|
|
||||||
|
# Set permissions at the job level.
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
if: github.repository == 'pytest-dev/pytest'
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: "3.7"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install --upgrade build tox
|
||||||
|
|
||||||
|
- name: Build package
|
||||||
|
run: |
|
||||||
|
python -m build
|
||||||
|
|
||||||
|
- name: Publish package to PyPI
|
||||||
|
uses: pypa/gh-action-pypi-publish@master
|
||||||
|
with:
|
||||||
|
user: __token__
|
||||||
|
password: ${{ secrets.pypi_token }}
|
||||||
|
|
||||||
|
- name: Publish GitHub release notes
|
||||||
|
env:
|
||||||
|
GH_RELEASE_NOTES_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get install pandoc
|
||||||
|
tox -e publish-gh-release-notes
|
|
@ -11,10 +11,20 @@ on:
|
||||||
description: 'Major release? (yes/no)'
|
description: 'Major release? (yes/no)'
|
||||||
required: true
|
required: true
|
||||||
default: 'no'
|
default: 'no'
|
||||||
|
prerelease:
|
||||||
|
description: 'Prerelease (ex: rc1). Leave empty if not a pre-release.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
|
||||||
|
# Set permissions at the job level.
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -34,9 +44,9 @@ jobs:
|
||||||
- name: Prepare release PR (minor/patch release)
|
- name: Prepare release PR (minor/patch release)
|
||||||
if: github.event.inputs.major == 'no'
|
if: github.event.inputs.major == 'no'
|
||||||
run: |
|
run: |
|
||||||
tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ secrets.chatops }}
|
tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --prerelease='${{ github.event.inputs.prerelease }}'
|
||||||
|
|
||||||
- name: Prepare release PR (major release)
|
- name: Prepare release PR (major release)
|
||||||
if: github.event.inputs.major == 'yes'
|
if: github.event.inputs.major == 'yes'
|
||||||
run: |
|
run: |
|
||||||
tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ secrets.chatops }} --major
|
tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --major --prerelease='${{ github.event.inputs.prerelease }}'
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
# part of our release process, see `release-on-comment.py`
|
|
||||||
name: release on comment
|
|
||||||
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types: [opened, edited]
|
|
||||||
issue_comment:
|
|
||||||
types: [created, edited]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
if: (github.event.comment && startsWith(github.event.comment.body, '@pytestbot please')) || (github.event.issue && !github.event.comment && startsWith(github.event.issue.body, '@pytestbot please'))
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: "3.8"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install --upgrade setuptools tox
|
|
||||||
- name: Prepare release
|
|
||||||
run: |
|
|
||||||
tox -e release-on-comment -- $GITHUB_EVENT_PATH ${{ secrets.chatops }}
|
|
|
@ -1,10 +1,11 @@
|
||||||
name: main
|
name: test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- "[0-9]+.[0-9]+.x"
|
- "[0-9]+.[0-9]+.x"
|
||||||
|
- "test-me-*"
|
||||||
tags:
|
tags:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+"
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
|
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
|
||||||
|
@ -14,30 +15,43 @@ on:
|
||||||
- main
|
- main
|
||||||
- "[0-9]+.[0-9]+.x"
|
- "[0-9]+.[0-9]+.x"
|
||||||
|
|
||||||
|
env:
|
||||||
|
PYTEST_ADDOPTS: "--color=yes"
|
||||||
|
|
||||||
|
# Set permissions at the job level.
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 30
|
timeout-minutes: 45
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
name: [
|
name: [
|
||||||
"windows-py36",
|
|
||||||
"windows-py37",
|
"windows-py37",
|
||||||
"windows-py37-pluggy",
|
"windows-py37-pluggy",
|
||||||
"windows-py38",
|
"windows-py38",
|
||||||
|
"windows-py39",
|
||||||
|
"windows-py310",
|
||||||
|
"windows-py311",
|
||||||
|
|
||||||
"ubuntu-py36",
|
|
||||||
"ubuntu-py37",
|
"ubuntu-py37",
|
||||||
"ubuntu-py37-pluggy",
|
"ubuntu-py37-pluggy",
|
||||||
"ubuntu-py37-freeze",
|
"ubuntu-py37-freeze",
|
||||||
"ubuntu-py38",
|
"ubuntu-py38",
|
||||||
"ubuntu-py39",
|
"ubuntu-py39",
|
||||||
|
"ubuntu-py310",
|
||||||
|
"ubuntu-py311",
|
||||||
"ubuntu-pypy3",
|
"ubuntu-pypy3",
|
||||||
|
|
||||||
"macos-py37",
|
"macos-py37",
|
||||||
"macos-py38",
|
"macos-py38",
|
||||||
|
"macos-py39",
|
||||||
|
"macos-py310",
|
||||||
|
|
||||||
"docs",
|
"docs",
|
||||||
"doctesting",
|
"doctesting",
|
||||||
|
@ -45,10 +59,6 @@ jobs:
|
||||||
]
|
]
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- name: "windows-py36"
|
|
||||||
python: "3.6"
|
|
||||||
os: windows-latest
|
|
||||||
tox_env: "py36-xdist"
|
|
||||||
- name: "windows-py37"
|
- name: "windows-py37"
|
||||||
python: "3.7"
|
python: "3.7"
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
|
@ -62,11 +72,19 @@ jobs:
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
tox_env: "py38-unittestextras"
|
tox_env: "py38-unittestextras"
|
||||||
use_coverage: true
|
use_coverage: true
|
||||||
|
- name: "windows-py39"
|
||||||
|
python: "3.9"
|
||||||
|
os: windows-latest
|
||||||
|
tox_env: "py39-xdist"
|
||||||
|
- name: "windows-py310"
|
||||||
|
python: "3.10"
|
||||||
|
os: windows-latest
|
||||||
|
tox_env: "py310-xdist"
|
||||||
|
- name: "windows-py311"
|
||||||
|
python: "3.11-dev"
|
||||||
|
os: windows-latest
|
||||||
|
tox_env: "py311"
|
||||||
|
|
||||||
- name: "ubuntu-py36"
|
|
||||||
python: "3.6"
|
|
||||||
os: ubuntu-latest
|
|
||||||
tox_env: "py36-xdist"
|
|
||||||
- name: "ubuntu-py37"
|
- name: "ubuntu-py37"
|
||||||
python: "3.7"
|
python: "3.7"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
@ -88,6 +106,15 @@ jobs:
|
||||||
python: "3.9"
|
python: "3.9"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
tox_env: "py39-xdist"
|
tox_env: "py39-xdist"
|
||||||
|
- name: "ubuntu-py310"
|
||||||
|
python: "3.10"
|
||||||
|
os: ubuntu-latest
|
||||||
|
tox_env: "py310-xdist"
|
||||||
|
- name: "ubuntu-py311"
|
||||||
|
python: "3.11-dev"
|
||||||
|
os: ubuntu-latest
|
||||||
|
tox_env: "py311"
|
||||||
|
use_coverage: true
|
||||||
- name: "ubuntu-pypy3"
|
- name: "ubuntu-pypy3"
|
||||||
python: "pypy-3.7"
|
python: "pypy-3.7"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
@ -102,9 +129,17 @@ jobs:
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
tox_env: "py38-xdist"
|
tox_env: "py38-xdist"
|
||||||
use_coverage: true
|
use_coverage: true
|
||||||
|
- name: "macos-py39"
|
||||||
|
python: "3.9"
|
||||||
|
os: macos-latest
|
||||||
|
tox_env: "py39-xdist"
|
||||||
|
- name: "macos-py310"
|
||||||
|
python: "3.10"
|
||||||
|
os: macos-latest
|
||||||
|
tox_env: "py310-xdist"
|
||||||
|
|
||||||
- name: "plugins"
|
- name: "plugins"
|
||||||
python: "3.7"
|
python: "3.9"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
tox_env: "plugins"
|
tox_env: "plugins"
|
||||||
|
|
||||||
|
@ -119,13 +154,16 @@ jobs:
|
||||||
use_coverage: true
|
use_coverage: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python }}
|
- name: Set up Python ${{ matrix.python }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
|
@ -139,60 +177,14 @@ jobs:
|
||||||
if: "matrix.use_coverage"
|
if: "matrix.use_coverage"
|
||||||
run: "tox -e ${{ matrix.tox_env }}-coverage"
|
run: "tox -e ${{ matrix.tox_env }}-coverage"
|
||||||
|
|
||||||
- name: Upload coverage
|
- name: Generate coverage report
|
||||||
if: matrix.use_coverage && github.repository == 'pytest-dev/pytest'
|
if: "matrix.use_coverage"
|
||||||
env:
|
run: python -m coverage xml
|
||||||
CODECOV_NAME: ${{ matrix.name }}
|
|
||||||
run: bash scripts/upload-coverage.sh -F GHA,${{ runner.os }}
|
|
||||||
|
|
||||||
linting:
|
- name: Upload coverage to Codecov
|
||||||
runs-on: ubuntu-latest
|
if: "matrix.use_coverage"
|
||||||
steps:
|
uses: codecov/codecov-action@v3
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
- name: set PY
|
|
||||||
run: echo "name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pre-commit
|
fail_ci_if_error: true
|
||||||
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
files: ./coverage.xml
|
||||||
- name: Install dependencies
|
verbose: true
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install tox
|
|
||||||
- run: tox -e linting
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest'
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 30
|
|
||||||
|
|
||||||
needs: [build]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: "3.7"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install --upgrade wheel setuptools tox
|
|
||||||
- name: Build package
|
|
||||||
run: |
|
|
||||||
python setup.py sdist bdist_wheel
|
|
||||||
- name: Publish package to PyPI
|
|
||||||
uses: pypa/gh-action-pypi-publish@master
|
|
||||||
with:
|
|
||||||
user: __token__
|
|
||||||
password: ${{ secrets.pypi_token }}
|
|
||||||
- name: Publish GitHub release notes
|
|
||||||
env:
|
|
||||||
GH_RELEASE_NOTES_TOKEN: ${{ secrets.release_notes }}
|
|
||||||
run: |
|
|
||||||
sudo apt-get install pandoc
|
|
||||||
tox -e publish-gh-release-notes
|
|
|
@ -7,22 +7,36 @@ on:
|
||||||
- cron: '0 0 * * 0'
|
- cron: '0 0 * * 0'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
# Set permissions at the job level.
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
createPullRequest:
|
createPullRequest:
|
||||||
|
if: github.repository_owner == 'pytest-dev'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.8
|
python-version: 3.8
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install packaging requests tabulate[widechars]
|
pip install packaging requests tabulate[widechars] tqdm
|
||||||
|
|
||||||
- name: Update Plugin List
|
- name: Update Plugin List
|
||||||
run: python scripts/update-plugin-list.py
|
run: python scripts/update-plugin-list.py
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@2455e1596942c2902952003bbb574afbbe2ab2e6
|
uses: peter-evans/create-pull-request@2455e1596942c2902952003bbb574afbbe2ab2e6
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -53,3 +53,6 @@ coverage.xml
|
||||||
|
|
||||||
# generated by pip
|
# generated by pip
|
||||||
pip-wheel-metadata/
|
pip-wheel-metadata/
|
||||||
|
|
||||||
|
# pytest debug logs generated via --debug
|
||||||
|
pytestdebug.log
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
|
default_language_version:
|
||||||
|
python: "3.10"
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 20.8b1
|
rev: 22.8.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
args: [--safe, --quiet]
|
args: [--safe, --quiet]
|
||||||
- repo: https://github.com/asottile/blacken-docs
|
- repo: https://github.com/asottile/blacken-docs
|
||||||
rev: v1.10.0
|
rev: v1.12.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: blacken-docs
|
- id: blacken-docs
|
||||||
additional_dependencies: [black==20.8b1]
|
additional_dependencies: [black==20.8b1]
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v3.4.0
|
rev: v4.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
|
@ -20,34 +22,43 @@ repos:
|
||||||
- id: debug-statements
|
- id: debug-statements
|
||||||
exclude: _pytest/(debugging|hookspec).py
|
exclude: _pytest/(debugging|hookspec).py
|
||||||
language_version: python3
|
language_version: python3
|
||||||
- repo: https://gitlab.com/pycqa/flake8
|
- repo: https://github.com/PyCQA/autoflake
|
||||||
rev: 3.9.0
|
rev: v1.6.1
|
||||||
|
hooks:
|
||||||
|
- id: autoflake
|
||||||
|
name: autoflake
|
||||||
|
args: ["--in-place", "--remove-unused-variables", "--remove-all-unused-imports"]
|
||||||
|
language: python
|
||||||
|
files: \.py$
|
||||||
|
- repo: https://github.com/PyCQA/flake8
|
||||||
|
rev: 5.0.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
language_version: python3
|
language_version: python3
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- flake8-typing-imports==1.9.0
|
- flake8-typing-imports==1.12.0
|
||||||
- flake8-docstrings==1.5.0
|
- flake8-docstrings==1.5.0
|
||||||
- repo: https://github.com/asottile/reorder_python_imports
|
- repo: https://github.com/asottile/reorder_python_imports
|
||||||
rev: v2.4.0
|
rev: v3.8.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: reorder-python-imports
|
- id: reorder-python-imports
|
||||||
args: ['--application-directories=.:src', --py36-plus]
|
args: ['--application-directories=.:src', --py37-plus]
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v2.10.0
|
rev: v2.38.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py36-plus]
|
args: [--py37-plus]
|
||||||
- repo: https://github.com/asottile/setup-cfg-fmt
|
- repo: https://github.com/asottile/setup-cfg-fmt
|
||||||
rev: v1.17.0
|
rev: v2.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: setup-cfg-fmt
|
- id: setup-cfg-fmt
|
||||||
|
args: ["--max-py-version=3.10", "--include-version-classifiers"]
|
||||||
- repo: https://github.com/pre-commit/pygrep-hooks
|
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||||
rev: v1.8.0
|
rev: v1.9.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: python-use-type-annotations
|
- id: python-use-type-annotations
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: v0.812
|
rev: v0.981
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
files: ^(src/|testing/)
|
files: ^(src/|testing/)
|
||||||
|
@ -57,6 +68,11 @@ repos:
|
||||||
- py>=1.8.2
|
- py>=1.8.2
|
||||||
- attrs>=19.2.0
|
- attrs>=19.2.0
|
||||||
- packaging
|
- packaging
|
||||||
|
- tomli
|
||||||
|
- types-pkg_resources
|
||||||
|
# for mypy running on python>=3.11 since exceptiongroup is only a dependency
|
||||||
|
# on <3.11
|
||||||
|
- exceptiongroup>=1.0.0rc8
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: rst
|
- id: rst
|
||||||
|
@ -89,7 +105,7 @@ repos:
|
||||||
types: [python]
|
types: [python]
|
||||||
- id: py-path-deprecated
|
- id: py-path-deprecated
|
||||||
name: py.path usage is deprecated
|
name: py.path usage is deprecated
|
||||||
|
exclude: docs|src/_pytest/deprecated.py|testing/deprecated_test.py|src/_pytest/legacypath.py
|
||||||
language: pygrep
|
language: pygrep
|
||||||
entry: \bpy\.path\.local
|
entry: \bpy\.path\.local
|
||||||
exclude: docs
|
|
||||||
types: [python]
|
types: [python]
|
||||||
|
|
|
@ -1,12 +1,19 @@
|
||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
python:
|
python:
|
||||||
version: 3.7
|
|
||||||
install:
|
install:
|
||||||
- requirements: doc/en/requirements.txt
|
- requirements: doc/en/requirements.txt
|
||||||
- method: pip
|
- method: pip
|
||||||
path: .
|
path: .
|
||||||
|
|
||||||
|
build:
|
||||||
|
os: ubuntu-20.04
|
||||||
|
tools:
|
||||||
|
python: "3.9"
|
||||||
|
apt_packages:
|
||||||
|
- inkscape
|
||||||
|
|
||||||
formats:
|
formats:
|
||||||
- epub
|
- epub
|
||||||
- pdf
|
- pdf
|
||||||
|
- htmlzip
|
||||||
|
|
47
AUTHORS
|
@ -5,6 +5,7 @@ Contributors include::
|
||||||
|
|
||||||
Aaron Coleman
|
Aaron Coleman
|
||||||
Abdeali JK
|
Abdeali JK
|
||||||
|
Abdelrahman Elbehery
|
||||||
Abhijeet Kasurde
|
Abhijeet Kasurde
|
||||||
Adam Johnson
|
Adam Johnson
|
||||||
Adam Uhlir
|
Adam Uhlir
|
||||||
|
@ -12,7 +13,9 @@ Ahn Ki-Wook
|
||||||
Akiomi Kamakura
|
Akiomi Kamakura
|
||||||
Alan Velasco
|
Alan Velasco
|
||||||
Alexander Johnson
|
Alexander Johnson
|
||||||
|
Alexander King
|
||||||
Alexei Kozlenok
|
Alexei Kozlenok
|
||||||
|
Alice Purcell
|
||||||
Allan Feldman
|
Allan Feldman
|
||||||
Aly Sivji
|
Aly Sivji
|
||||||
Amir Elkess
|
Amir Elkess
|
||||||
|
@ -23,6 +26,7 @@ Andras Tim
|
||||||
Andrea Cimatoribus
|
Andrea Cimatoribus
|
||||||
Andreas Motl
|
Andreas Motl
|
||||||
Andreas Zeidler
|
Andreas Zeidler
|
||||||
|
Andrew Shapton
|
||||||
Andrey Paramonov
|
Andrey Paramonov
|
||||||
Andrzej Klajnert
|
Andrzej Klajnert
|
||||||
Andrzej Ostrowski
|
Andrzej Ostrowski
|
||||||
|
@ -34,12 +38,14 @@ Anton Grinevich
|
||||||
Anton Lodder
|
Anton Lodder
|
||||||
Antony Lee
|
Antony Lee
|
||||||
Arel Cordero
|
Arel Cordero
|
||||||
|
Arias Emmanuel
|
||||||
Ariel Pillemer
|
Ariel Pillemer
|
||||||
Armin Rigo
|
Armin Rigo
|
||||||
Aron Coyle
|
Aron Coyle
|
||||||
Aron Curzon
|
Aron Curzon
|
||||||
Aviral Verma
|
Aviral Verma
|
||||||
Aviv Palivoda
|
Aviv Palivoda
|
||||||
|
Babak Keyvani
|
||||||
Barney Gale
|
Barney Gale
|
||||||
Ben Gartner
|
Ben Gartner
|
||||||
Ben Webb
|
Ben Webb
|
||||||
|
@ -58,8 +64,11 @@ Ceridwen
|
||||||
Charles Cloud
|
Charles Cloud
|
||||||
Charles Machalow
|
Charles Machalow
|
||||||
Charnjit SiNGH (CCSJ)
|
Charnjit SiNGH (CCSJ)
|
||||||
|
Cheuk Ting Ho
|
||||||
Chris Lamb
|
Chris Lamb
|
||||||
Chris NeJame
|
Chris NeJame
|
||||||
|
Chris Rose
|
||||||
|
Chris Wheeler
|
||||||
Christian Boelsen
|
Christian Boelsen
|
||||||
Christian Fetzer
|
Christian Fetzer
|
||||||
Christian Neumüller
|
Christian Neumüller
|
||||||
|
@ -72,11 +81,13 @@ Christopher Gilling
|
||||||
Claire Cecil
|
Claire Cecil
|
||||||
Claudio Madotto
|
Claudio Madotto
|
||||||
CrazyMerlyn
|
CrazyMerlyn
|
||||||
|
Cristian Vera
|
||||||
Cyrus Maden
|
Cyrus Maden
|
||||||
Damian Skrzypczak
|
Damian Skrzypczak
|
||||||
Daniel Grana
|
Daniel Grana
|
||||||
Daniel Hahler
|
Daniel Hahler
|
||||||
Daniel Nuri
|
Daniel Nuri
|
||||||
|
Daniel Sánchez Castelló
|
||||||
Daniel Wandschneider
|
Daniel Wandschneider
|
||||||
Daniele Procida
|
Daniele Procida
|
||||||
Danielle Jenkins
|
Danielle Jenkins
|
||||||
|
@ -90,6 +101,7 @@ David Vierra
|
||||||
Daw-Ran Liou
|
Daw-Ran Liou
|
||||||
Debi Mishra
|
Debi Mishra
|
||||||
Denis Kirisov
|
Denis Kirisov
|
||||||
|
Denivy Braiam Rück
|
||||||
Dhiren Serai
|
Dhiren Serai
|
||||||
Diego Russo
|
Diego Russo
|
||||||
Dmitry Dygalo
|
Dmitry Dygalo
|
||||||
|
@ -98,11 +110,14 @@ Dominic Mortlock
|
||||||
Duncan Betts
|
Duncan Betts
|
||||||
Edison Gustavo Muenz
|
Edison Gustavo Muenz
|
||||||
Edoardo Batini
|
Edoardo Batini
|
||||||
|
Edson Tadeu M. Manoel
|
||||||
Eduardo Schettino
|
Eduardo Schettino
|
||||||
Eli Boyarski
|
Eli Boyarski
|
||||||
Elizaveta Shashkova
|
Elizaveta Shashkova
|
||||||
|
Éloi Rivard
|
||||||
Endre Galaczi
|
Endre Galaczi
|
||||||
Eric Hunsberger
|
Eric Hunsberger
|
||||||
|
Eric Liu
|
||||||
Eric Siegerman
|
Eric Siegerman
|
||||||
Erik Aronesty
|
Erik Aronesty
|
||||||
Erik M. Bray
|
Erik M. Bray
|
||||||
|
@ -119,7 +134,9 @@ Garvit Shubham
|
||||||
Gene Wood
|
Gene Wood
|
||||||
George Kussumoto
|
George Kussumoto
|
||||||
Georgy Dyuldin
|
Georgy Dyuldin
|
||||||
|
Gergely Kalmár
|
||||||
Gleb Nikonorov
|
Gleb Nikonorov
|
||||||
|
Graeme Smecher
|
||||||
Graham Horler
|
Graham Horler
|
||||||
Greg Price
|
Greg Price
|
||||||
Gregory Lee
|
Gregory Lee
|
||||||
|
@ -128,6 +145,7 @@ Grigorii Eremeev (budulianin)
|
||||||
Guido Wesdorp
|
Guido Wesdorp
|
||||||
Guoqiang Zhang
|
Guoqiang Zhang
|
||||||
Harald Armin Massa
|
Harald Armin Massa
|
||||||
|
Harshna
|
||||||
Henk-Jaap Wagenaar
|
Henk-Jaap Wagenaar
|
||||||
Holger Kohr
|
Holger Kohr
|
||||||
Hugo van Kemenade
|
Hugo van Kemenade
|
||||||
|
@ -140,6 +158,7 @@ Iwan Briquemont
|
||||||
Jaap Broekhuizen
|
Jaap Broekhuizen
|
||||||
Jakob van Santen
|
Jakob van Santen
|
||||||
Jakub Mitoraj
|
Jakub Mitoraj
|
||||||
|
James Bourbeau
|
||||||
Jan Balster
|
Jan Balster
|
||||||
Janne Vanhala
|
Janne Vanhala
|
||||||
Jason R. Coombs
|
Jason R. Coombs
|
||||||
|
@ -149,7 +168,9 @@ Jeff Rackauckas
|
||||||
Jeff Widman
|
Jeff Widman
|
||||||
Jenni Rinker
|
Jenni Rinker
|
||||||
John Eddie Ayson
|
John Eddie Ayson
|
||||||
|
John Litborn
|
||||||
John Towler
|
John Towler
|
||||||
|
Jon Parise
|
||||||
Jon Sonesen
|
Jon Sonesen
|
||||||
Jonas Obrist
|
Jonas Obrist
|
||||||
Jordan Guymon
|
Jordan Guymon
|
||||||
|
@ -160,6 +181,7 @@ Josh Karpel
|
||||||
Joshua Bronson
|
Joshua Bronson
|
||||||
Jurko Gospodnetić
|
Jurko Gospodnetić
|
||||||
Justyna Janczyszyn
|
Justyna Janczyszyn
|
||||||
|
Justice Ndou
|
||||||
Kale Kundert
|
Kale Kundert
|
||||||
Kamran Ahmad
|
Kamran Ahmad
|
||||||
Karl O. Pinc
|
Karl O. Pinc
|
||||||
|
@ -168,9 +190,14 @@ Katarzyna Jachim
|
||||||
Katarzyna Król
|
Katarzyna Król
|
||||||
Katerina Koukiou
|
Katerina Koukiou
|
||||||
Keri Volans
|
Keri Volans
|
||||||
|
Kevin C
|
||||||
Kevin Cox
|
Kevin Cox
|
||||||
|
Kevin Hierro Carrasco
|
||||||
Kevin J. Foley
|
Kevin J. Foley
|
||||||
|
Kian Eliasi
|
||||||
|
Kian-Meng Ang
|
||||||
Kodi B. Arfer
|
Kodi B. Arfer
|
||||||
|
Kojo Idrissa
|
||||||
Kostis Anagnostopoulos
|
Kostis Anagnostopoulos
|
||||||
Kristoffer Nordström
|
Kristoffer Nordström
|
||||||
Kyle Altendorf
|
Kyle Altendorf
|
||||||
|
@ -214,6 +241,7 @@ Michael Goerz
|
||||||
Michael Krebs
|
Michael Krebs
|
||||||
Michael Seifert
|
Michael Seifert
|
||||||
Michal Wajszczuk
|
Michal Wajszczuk
|
||||||
|
Michał Zięba
|
||||||
Mihai Capotă
|
Mihai Capotă
|
||||||
Mike Hoyle (hoylemd)
|
Mike Hoyle (hoylemd)
|
||||||
Mike Lundy
|
Mike Lundy
|
||||||
|
@ -227,6 +255,8 @@ Nicholas Murphy
|
||||||
Niclas Olofsson
|
Niclas Olofsson
|
||||||
Nicolas Delaby
|
Nicolas Delaby
|
||||||
Nikolay Kondratyev
|
Nikolay Kondratyev
|
||||||
|
Nipunn Koorapati
|
||||||
|
Olga Matoula
|
||||||
Oleg Pidsadnyi
|
Oleg Pidsadnyi
|
||||||
Oleg Sushchenko
|
Oleg Sushchenko
|
||||||
Oliver Bestwalter
|
Oliver Bestwalter
|
||||||
|
@ -234,7 +264,10 @@ Omar Kohl
|
||||||
Omer Hadari
|
Omer Hadari
|
||||||
Ondřej Súkup
|
Ondřej Súkup
|
||||||
Oscar Benjamin
|
Oscar Benjamin
|
||||||
|
Parth Patel
|
||||||
Patrick Hayes
|
Patrick Hayes
|
||||||
|
Paul Müller
|
||||||
|
Paul Reece
|
||||||
Pauli Virtanen
|
Pauli Virtanen
|
||||||
Pavel Karateev
|
Pavel Karateev
|
||||||
Paweł Adamczak
|
Paweł Adamczak
|
||||||
|
@ -268,6 +301,8 @@ Ross Lawley
|
||||||
Ruaridh Williamson
|
Ruaridh Williamson
|
||||||
Russel Winder
|
Russel Winder
|
||||||
Ryan Wooden
|
Ryan Wooden
|
||||||
|
Saiprasad Kale
|
||||||
|
Samuel Colvin
|
||||||
Samuel Dion-Girardeau
|
Samuel Dion-Girardeau
|
||||||
Samuel Searles-Bryant
|
Samuel Searles-Bryant
|
||||||
Samuele Pedroni
|
Samuele Pedroni
|
||||||
|
@ -276,8 +311,10 @@ Sankt Petersbug
|
||||||
Segev Finer
|
Segev Finer
|
||||||
Serhii Mozghovyi
|
Serhii Mozghovyi
|
||||||
Seth Junot
|
Seth Junot
|
||||||
|
Shantanu Jain
|
||||||
Shubham Adep
|
Shubham Adep
|
||||||
Simon Gomizelj
|
Simon Gomizelj
|
||||||
|
Simon Holesch
|
||||||
Simon Kerr
|
Simon Kerr
|
||||||
Skylar Downes
|
Skylar Downes
|
||||||
Srinivas Reddy Thatiparthy
|
Srinivas Reddy Thatiparthy
|
||||||
|
@ -291,24 +328,30 @@ Sven-Hendrik Haase
|
||||||
Sylvain Marié
|
Sylvain Marié
|
||||||
Tadek Teleżyński
|
Tadek Teleżyński
|
||||||
Takafumi Arakaki
|
Takafumi Arakaki
|
||||||
|
Taneli Hukkinen
|
||||||
Tanvi Mehta
|
Tanvi Mehta
|
||||||
Tarcisio Fischer
|
Tarcisio Fischer
|
||||||
Tareq Alayan
|
Tareq Alayan
|
||||||
|
Tatiana Ovary
|
||||||
Ted Xiao
|
Ted Xiao
|
||||||
|
Terje Runde
|
||||||
Thomas Grainger
|
Thomas Grainger
|
||||||
Thomas Hisch
|
Thomas Hisch
|
||||||
Tim Hoffmann
|
Tim Hoffmann
|
||||||
Tim Strazny
|
Tim Strazny
|
||||||
|
Tobias Diez
|
||||||
Tom Dalton
|
Tom Dalton
|
||||||
Tom Viner
|
Tom Viner
|
||||||
Tomáš Gavenčiak
|
Tomáš Gavenčiak
|
||||||
Tomer Keren
|
Tomer Keren
|
||||||
|
Tony Narlock
|
||||||
Tor Colvin
|
Tor Colvin
|
||||||
Trevor Bekolay
|
Trevor Bekolay
|
||||||
Tyler Goodlet
|
Tyler Goodlet
|
||||||
Tzu-ping Chung
|
Tzu-ping Chung
|
||||||
Vasily Kuznetsov
|
Vasily Kuznetsov
|
||||||
Victor Maryama
|
Victor Maryama
|
||||||
|
Victor Rodriguez
|
||||||
Victor Uriarte
|
Victor Uriarte
|
||||||
Vidar T. Fauske
|
Vidar T. Fauske
|
||||||
Virgil Dupras
|
Virgil Dupras
|
||||||
|
@ -326,6 +369,10 @@ Xixi Zhao
|
||||||
Xuan Luong
|
Xuan Luong
|
||||||
Xuecong Liao
|
Xuecong Liao
|
||||||
Yoav Caspi
|
Yoav Caspi
|
||||||
|
Yuval Shimon
|
||||||
Zac Hatfield-Dodds
|
Zac Hatfield-Dodds
|
||||||
|
Zachary Kneupper
|
||||||
|
Zachary OBrien
|
||||||
|
Zhouxin Qiu
|
||||||
Zoltán Máté
|
Zoltán Máté
|
||||||
Zsolt Cserna
|
Zsolt Cserna
|
||||||
|
|
|
@ -4,4 +4,4 @@ Changelog
|
||||||
|
|
||||||
The pytest CHANGELOG is located `here <https://docs.pytest.org/en/stable/changelog.html>`__.
|
The pytest CHANGELOG is located `here <https://docs.pytest.org/en/stable/changelog.html>`__.
|
||||||
|
|
||||||
The source document can be found at: https://github.com/pytest-dev/pytest/blob/master/doc/en/changelog.rst
|
The source document can be found at: https://github.com/pytest-dev/pytest/blob/main/doc/en/changelog.rst
|
||||||
|
|
|
@ -50,6 +50,8 @@ Fix bugs
|
||||||
--------
|
--------
|
||||||
|
|
||||||
Look through the `GitHub issues for bugs <https://github.com/pytest-dev/pytest/labels/type:%20bug>`_.
|
Look through the `GitHub issues for bugs <https://github.com/pytest-dev/pytest/labels/type:%20bug>`_.
|
||||||
|
See also the `"status: easy" issues <https://github.com/pytest-dev/pytest/labels/status%3A%20easy>`_
|
||||||
|
that are friendly to new contributors.
|
||||||
|
|
||||||
:ref:`Talk <contact>` to developers to find out how you can fix specific bugs. To indicate that you are going
|
:ref:`Talk <contact>` to developers to find out how you can fix specific bugs. To indicate that you are going
|
||||||
to work on a particular issue, add a comment to that effect on the specific issue.
|
to work on a particular issue, add a comment to that effect on the specific issue.
|
||||||
|
@ -160,7 +162,7 @@ the following:
|
||||||
|
|
||||||
- an issue tracker for bug reports and enhancement requests.
|
- an issue tracker for bug reports and enhancement requests.
|
||||||
|
|
||||||
- a `changelog <http://keepachangelog.com/>`_.
|
- a `changelog <https://keepachangelog.com/>`_.
|
||||||
|
|
||||||
If no contributor strongly objects and two agree, the repository can then be
|
If no contributor strongly objects and two agree, the repository can then be
|
||||||
transferred to the ``pytest-dev`` organisation.
|
transferred to the ``pytest-dev`` organisation.
|
||||||
|
@ -221,7 +223,7 @@ changes you want to review and merge. Pull requests are stored on
|
||||||
Once you send a pull request, we can discuss its potential modifications and
|
Once you send a pull request, we can discuss its potential modifications and
|
||||||
even add more commits to it later on. There's an excellent tutorial on how Pull
|
even add more commits to it later on. There's an excellent tutorial on how Pull
|
||||||
Requests work in the
|
Requests work in the
|
||||||
`GitHub Help Center <https://help.github.com/articles/using-pull-requests/>`_.
|
`GitHub Help Center <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests>`_.
|
||||||
|
|
||||||
Here is a simple overview, with pytest-specific bits:
|
Here is a simple overview, with pytest-specific bits:
|
||||||
|
|
||||||
|
@ -234,7 +236,7 @@ Here is a simple overview, with pytest-specific bits:
|
||||||
|
|
||||||
$ git clone git@github.com:YOUR_GITHUB_USERNAME/pytest.git
|
$ git clone git@github.com:YOUR_GITHUB_USERNAME/pytest.git
|
||||||
$ cd pytest
|
$ cd pytest
|
||||||
# now, create your own branch off "master":
|
# now, create your own branch off "main":
|
||||||
|
|
||||||
$ git checkout -b your-bugfix-branch-name main
|
$ git checkout -b your-bugfix-branch-name main
|
||||||
|
|
||||||
|
@ -259,7 +261,7 @@ Here is a simple overview, with pytest-specific bits:
|
||||||
|
|
||||||
Tox is used to run all the tests and will automatically setup virtualenvs
|
Tox is used to run all the tests and will automatically setup virtualenvs
|
||||||
to run the tests in.
|
to run the tests in.
|
||||||
(will implicitly use http://www.virtualenv.org/en/latest/)::
|
(will implicitly use https://virtualenv.pypa.io/en/latest/)::
|
||||||
|
|
||||||
$ pip install tox
|
$ pip install tox
|
||||||
|
|
||||||
|
@ -324,7 +326,7 @@ Here is a simple overview, with pytest-specific bits:
|
||||||
Writing Tests
|
Writing Tests
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
Writing tests for plugins or for pytest itself is often done using the `pytester fixture <https://docs.pytest.org/en/stable/reference.html#pytester>`_, as a "black-box" test.
|
Writing tests for plugins or for pytest itself is often done using the `pytester fixture <https://docs.pytest.org/en/stable/reference/reference.html#pytester>`_, as a "black-box" test.
|
||||||
|
|
||||||
For example, to ensure a simple test passes you can write:
|
For example, to ensure a simple test passes you can write:
|
||||||
|
|
||||||
|
@ -387,15 +389,22 @@ Suppose for example that the latest release was 1.2.3, and you want to include
|
||||||
a bug fix in 1.2.4 (check https://github.com/pytest-dev/pytest/releases for the
|
a bug fix in 1.2.4 (check https://github.com/pytest-dev/pytest/releases for the
|
||||||
actual latest release). The procedure for this is:
|
actual latest release). The procedure for this is:
|
||||||
|
|
||||||
#. First, make sure the bug is fixed the ``master`` branch, with a regular pull
|
#. First, make sure the bug is fixed the ``main`` branch, with a regular pull
|
||||||
request, as described above. An exception to this is if the bug fix is not
|
request, as described above. An exception to this is if the bug fix is not
|
||||||
applicable to ``master`` anymore.
|
applicable to ``main`` anymore.
|
||||||
|
|
||||||
#. ``git checkout origin/1.2.x -b backport-XXXX`` # use the master PR number here
|
Automatic method:
|
||||||
|
|
||||||
|
Add a ``backport 1.2.x`` label to the PR you want to backport. This will create
|
||||||
|
a backport PR against the ``1.2.x`` branch.
|
||||||
|
|
||||||
|
Manual method:
|
||||||
|
|
||||||
|
#. ``git checkout origin/1.2.x -b backport-XXXX`` # use the main PR number here
|
||||||
|
|
||||||
#. Locate the merge commit on the PR, in the *merged* message, for example:
|
#. Locate the merge commit on the PR, in the *merged* message, for example:
|
||||||
|
|
||||||
nicoddemus merged commit 0f8b462 into pytest-dev:master
|
nicoddemus merged commit 0f8b462 into pytest-dev:main
|
||||||
|
|
||||||
#. ``git cherry-pick -x -m1 REVISION`` # use the revision you found above (``0f8b462``).
|
#. ``git cherry-pick -x -m1 REVISION`` # use the revision you found above (``0f8b462``).
|
||||||
|
|
||||||
|
@ -408,8 +417,8 @@ actual latest release). The procedure for this is:
|
||||||
Who does the backporting
|
Who does the backporting
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
As mentioned above, bugs should first be fixed on ``master`` (except in rare occasions
|
As mentioned above, bugs should first be fixed on ``main`` (except in rare occasions
|
||||||
that a bug only happens in a previous release). So who should do the backport procedure described
|
that a bug only happens in a previous release). So, who should do the backport procedure described
|
||||||
above?
|
above?
|
||||||
|
|
||||||
1. If the bug was fixed by a core developer, it is the main responsibility of that core developer
|
1. If the bug was fixed by a core developer, it is the main responsibility of that core developer
|
||||||
|
@ -417,8 +426,8 @@ above?
|
||||||
2. However, often the merge is done by another maintainer, in which case it is nice of them to
|
2. However, often the merge is done by another maintainer, in which case it is nice of them to
|
||||||
do the backport procedure if they have the time.
|
do the backport procedure if they have the time.
|
||||||
3. For bugs submitted by non-maintainers, it is expected that a core developer will to do
|
3. For bugs submitted by non-maintainers, it is expected that a core developer will to do
|
||||||
the backport, normally the one that merged the PR on ``master``.
|
the backport, normally the one that merged the PR on ``main``.
|
||||||
4. If a non-maintainers notices a bug which is fixed on ``master`` but has not been backported
|
4. If a non-maintainers notices a bug which is fixed on ``main`` but has not been backported
|
||||||
(due to maintainers forgetting to apply the *needs backport* label, or just plain missing it),
|
(due to maintainers forgetting to apply the *needs backport* label, or just plain missing it),
|
||||||
they are also welcome to open a PR with the backport. The procedure is simple and really
|
they are also welcome to open a PR with the backport. The procedure is simple and really
|
||||||
helps with the maintenance of the project.
|
helps with the maintenance of the project.
|
||||||
|
@ -447,7 +456,7 @@ can always reopen the issue/pull request in their own time later if it makes sen
|
||||||
When to close
|
When to close
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
Here are a few general rules the maintainers use to decide when to close issues/PRs because
|
Here are a few general rules the maintainers use deciding when to close issues/PRs because
|
||||||
of lack of inactivity:
|
of lack of inactivity:
|
||||||
|
|
||||||
* Issues labeled ``question`` or ``needs information``: closed after 14 days inactive.
|
* Issues labeled ``question`` or ``needs information``: closed after 14 days inactive.
|
||||||
|
@ -459,15 +468,15 @@ The above are **not hard rules**, but merely **guidelines**, and can be (and oft
|
||||||
Closing pull requests
|
Closing pull requests
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When closing a Pull Request, it needs to be acknowledge the time, effort, and interest demonstrated by the person which submitted it. As mentioned previously, it is not the intent of the team to dismiss stalled pull request entirely but to merely to clear up our queue, so a message like the one below is warranted when closing a pull request that went stale:
|
When closing a Pull Request, it needs to be acknowledging the time, effort, and interest demonstrated by the person which submitted it. As mentioned previously, it is not the intent of the team to dismiss a stalled pull request entirely but to merely to clear up our queue, so a message like the one below is warranted when closing a pull request that went stale:
|
||||||
|
|
||||||
Hi <contributor>,
|
Hi <contributor>,
|
||||||
|
|
||||||
First of all we would like to thank you for your time and effort on working on this, the pytest team deeply appreciates it.
|
First of all, we would like to thank you for your time and effort on working on this, the pytest team deeply appreciates it.
|
||||||
|
|
||||||
We noticed it has been awhile since you have updated this PR, however. pytest is a high activity project, with many issues/PRs being opened daily, so it is hard for us maintainers to track which PRs are ready for merging, for review, or need more attention.
|
We noticed it has been awhile since you have updated this PR, however. pytest is a high activity project, with many issues/PRs being opened daily, so it is hard for us maintainers to track which PRs are ready for merging, for review, or need more attention.
|
||||||
|
|
||||||
So for those reasons we think it is best to close the PR for now, but with the only intention to cleanup our queue, it is by no means a rejection of your changes. We still encourage you to re-open this PR (it is just a click of a button away) when you are ready to get back to it.
|
So for those reasons we, think it is best to close the PR for now, but with the only intention to clean up our queue, it is by no means a rejection of your changes. We still encourage you to re-open this PR (it is just a click of a button away) when you are ready to get back to it.
|
||||||
|
|
||||||
Again we appreciate your time for working on this, and hope you might get back to this at a later time!
|
Again we appreciate your time for working on this, and hope you might get back to this at a later time!
|
||||||
|
|
||||||
|
|
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2004-2020 Holger Krekel and others
|
Copyright (c) 2004 Holger Krekel and others
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
31
README.rst
|
@ -20,11 +20,11 @@
|
||||||
:target: https://codecov.io/gh/pytest-dev/pytest
|
:target: https://codecov.io/gh/pytest-dev/pytest
|
||||||
:alt: Code coverage Status
|
:alt: Code coverage Status
|
||||||
|
|
||||||
.. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg
|
.. image:: https://github.com/pytest-dev/pytest/workflows/test/badge.svg
|
||||||
:target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Amain
|
:target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest
|
||||||
|
|
||||||
.. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg
|
.. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg
|
||||||
:target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/master
|
:target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main
|
||||||
:alt: pre-commit.ci status
|
:alt: pre-commit.ci status
|
||||||
|
|
||||||
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
||||||
|
@ -37,6 +37,15 @@
|
||||||
:target: https://pytest.readthedocs.io/en/latest/?badge=latest
|
:target: https://pytest.readthedocs.io/en/latest/?badge=latest
|
||||||
:alt: Documentation Status
|
:alt: Documentation Status
|
||||||
|
|
||||||
|
.. image:: https://img.shields.io/badge/Discord-pytest--dev-blue
|
||||||
|
:target: https://discord.com/invite/pytest-dev
|
||||||
|
:alt: Discord
|
||||||
|
|
||||||
|
.. image:: https://img.shields.io/badge/Libera%20chat-%23pytest-orange
|
||||||
|
:target: https://web.libera.chat/#pytest
|
||||||
|
:alt: Libera chat
|
||||||
|
|
||||||
|
|
||||||
The ``pytest`` framework makes it easy to write small tests, yet
|
The ``pytest`` framework makes it easy to write small tests, yet
|
||||||
scales to support complex functional testing for applications and libraries.
|
scales to support complex functional testing for applications and libraries.
|
||||||
|
|
||||||
|
@ -79,21 +88,21 @@ Due to ``pytest``'s detailed assertion introspection, only plain ``assert`` stat
|
||||||
Features
|
Features
|
||||||
--------
|
--------
|
||||||
|
|
||||||
- Detailed info on failing `assert statements <https://docs.pytest.org/en/stable/assert.html>`_ (no need to remember ``self.assert*`` names)
|
- Detailed info on failing `assert statements <https://docs.pytest.org/en/stable/how-to/assert.html>`_ (no need to remember ``self.assert*`` names)
|
||||||
|
|
||||||
- `Auto-discovery
|
- `Auto-discovery
|
||||||
<https://docs.pytest.org/en/stable/goodpractices.html#python-test-discovery>`_
|
<https://docs.pytest.org/en/stable/explanation/goodpractices.html#python-test-discovery>`_
|
||||||
of test modules and functions
|
of test modules and functions
|
||||||
|
|
||||||
- `Modular fixtures <https://docs.pytest.org/en/stable/fixture.html>`_ for
|
- `Modular fixtures <https://docs.pytest.org/en/stable/explanation/fixtures.html>`_ for
|
||||||
managing small or parametrized long-lived test resources
|
managing small or parametrized long-lived test resources
|
||||||
|
|
||||||
- Can run `unittest <https://docs.pytest.org/en/stable/unittest.html>`_ (or trial),
|
- Can run `unittest <https://docs.pytest.org/en/stable/how-to/unittest.html>`_ (or trial),
|
||||||
`nose <https://docs.pytest.org/en/stable/nose.html>`_ test suites out of the box
|
`nose <https://docs.pytest.org/en/stable/how-to/nose.html>`_ test suites out of the box
|
||||||
|
|
||||||
- Python 3.6+ and PyPy3
|
- Python 3.7+ or PyPy3
|
||||||
|
|
||||||
- Rich plugin architecture, with over 850+ `external plugins <https://docs.pytest.org/en/stable/plugin_list.html>`_ and thriving community
|
- Rich plugin architecture, with over 850+ `external plugins <https://docs.pytest.org/en/latest/reference/plugin_list.html>`_ and thriving community
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
|
@ -151,7 +160,7 @@ Tidelift will coordinate the fix and disclosure.
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Copyright Holger Krekel and others, 2004-2021.
|
Copyright Holger Krekel and others, 2004.
|
||||||
|
|
||||||
Distributed under the terms of the `MIT`_ license, pytest is free and open source software.
|
Distributed under the terms of the `MIT`_ license, pytest is free and open source software.
|
||||||
|
|
||||||
|
|
126
RELEASING.rst
|
@ -14,59 +14,89 @@ Preparing: Automatic Method
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
We have developed an automated workflow for releases, that uses GitHub workflows and is triggered
|
We have developed an automated workflow for releases, that uses GitHub workflows and is triggered
|
||||||
by opening an issue.
|
by `manually running <https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow>`__
|
||||||
|
the `prepare-release-pr workflow <https://github.com/pytest-dev/pytest/actions/workflows/prepare-release-pr.yml>`__
|
||||||
|
on GitHub Actions.
|
||||||
|
|
||||||
Bug-fix releases
|
The automation will decide the new version number based on the following criteria:
|
||||||
^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
A bug-fix release is always done from a maintenance branch, so for example to release bug-fix
|
- If the "major release" input is set to "yes", release a new major release
|
||||||
``5.1.2``, open a new issue and add this comment to the body::
|
(e.g. 7.0.0 -> 8.0.0)
|
||||||
|
- If there are any ``.feature.rst`` or ``.breaking.rst`` files in the
|
||||||
|
``changelog`` directory, release a new minor release (e.g. 7.0.0 -> 7.1.0)
|
||||||
|
- Otherwise, release a bugfix release (e.g. 7.0.0 -> 7.0.1)
|
||||||
|
- If the "prerelease" input is set, append the string to the version number
|
||||||
|
(e.g. 7.0.0 -> 8.0.0rc1), if "major" is set, and "prerelease" is set to `rc1`)
|
||||||
|
|
||||||
@pytestbot please prepare release from 5.1.x
|
Bug-fix and minor releases
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Where ``5.1.x`` is the maintenance branch for the ``5.1`` series.
|
Bug-fix and minor releases are always done from a maintenance branch. First,
|
||||||
|
consider double-checking the ``changelog`` directory to see if there are any
|
||||||
|
breaking changes or new features.
|
||||||
|
|
||||||
The automated workflow will publish a PR for a branch ``release-5.1.2``
|
For a new minor release, first create a new maintenance branch from ``main``::
|
||||||
and notify it as a comment in the issue.
|
|
||||||
|
|
||||||
Minor releases
|
git fetch upstream
|
||||||
|
git branch 7.1.x upstream/main
|
||||||
|
git push upstream 7.1.x
|
||||||
|
|
||||||
|
Then, trigger the workflow with the following inputs:
|
||||||
|
|
||||||
|
- branch: **7.1.x**
|
||||||
|
- major release: **no**
|
||||||
|
- prerelease: empty
|
||||||
|
|
||||||
|
Or via the commandline using `GitHub's cli <https://github.com/cli/cli>`__::
|
||||||
|
|
||||||
|
gh workflow run prepare-release-pr.yml -f branch=7.1.x -f major=no -f prerelease=
|
||||||
|
|
||||||
|
Where ``7.1.x`` is the maintenance branch for the ``7.1`` series. The automated
|
||||||
|
workflow will publish a PR for a branch ``release-7.1.0``.
|
||||||
|
|
||||||
|
Similarly, for a bug-fix release, use the existing maintenance branch and
|
||||||
|
trigger the workflow with e.g. ``branch: 7.0.x`` to get a new ``release-7.0.1``
|
||||||
|
PR.
|
||||||
|
|
||||||
|
Major releases
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
1. Create a new maintenance branch from ``master``::
|
1. Create a new maintenance branch from ``main``::
|
||||||
|
|
||||||
git fetch --all
|
git fetch upstream
|
||||||
git branch 5.2.x upstream/master
|
git branch 8.0.x upstream/main
|
||||||
git push upstream 5.2.x
|
git push upstream 8.0.x
|
||||||
|
|
||||||
2. Open a new issue and add this comment to the body::
|
2. Trigger the workflow with the following inputs:
|
||||||
|
|
||||||
@pytestbot please prepare release from 5.2.x
|
- branch: **8.0.x**
|
||||||
|
- major release: **yes**
|
||||||
|
- prerelease: empty
|
||||||
|
|
||||||
The automated workflow will publish a PR for a branch ``release-5.2.0`` and
|
Or via the commandline::
|
||||||
notify it as a comment in the issue.
|
|
||||||
|
|
||||||
Major and release candidates
|
gh workflow run prepare-release-pr.yml -f branch=8.0.x -f major=yes -f prerelease=
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
1. Create a new maintenance branch from ``master``::
|
The automated workflow will publish a PR for a branch ``release-8.0.0``.
|
||||||
|
|
||||||
git fetch --all
|
|
||||||
git branch 6.0.x upstream/master
|
|
||||||
git push upstream 6.0.x
|
|
||||||
|
|
||||||
2. For a **major release**, open a new issue and add this comment in the body::
|
|
||||||
|
|
||||||
@pytestbot please prepare major release from 6.0.x
|
|
||||||
|
|
||||||
For a **release candidate**, the comment must be (TODO: `#7551 <https://github.com/pytest-dev/pytest/issues/7551>`__)::
|
|
||||||
|
|
||||||
@pytestbot please prepare release candidate from 6.0.x
|
|
||||||
|
|
||||||
The automated workflow will publish a PR for a branch ``release-6.0.0`` and
|
|
||||||
notify it as a comment in the issue.
|
|
||||||
|
|
||||||
At this point on, this follows the same workflow as other maintenance branches: bug-fixes are merged
|
At this point on, this follows the same workflow as other maintenance branches: bug-fixes are merged
|
||||||
into ``master`` and ported back to the maintenance branch, even for release candidates.
|
into ``main`` and ported back to the maintenance branch, even for release candidates.
|
||||||
|
|
||||||
|
Release candidates
|
||||||
|
^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
To release a release candidate, set the "prerelease" input to the version number
|
||||||
|
suffix to use. To release a ``8.0.0rc1``, proceed like under "major releases", but set:
|
||||||
|
|
||||||
|
- branch: 8.0.x
|
||||||
|
- major release: yes
|
||||||
|
- prerelease: **rc1**
|
||||||
|
|
||||||
|
Or via the commandline::
|
||||||
|
|
||||||
|
gh workflow run prepare-release-pr.yml -f branch=8.0.x -f major=yes -f prerelease=rc1
|
||||||
|
|
||||||
|
The automated workflow will publish a PR for a branch ``release-8.0.0rc1``.
|
||||||
|
|
||||||
**A note about release candidates**
|
**A note about release candidates**
|
||||||
|
|
||||||
|
@ -83,7 +113,7 @@ to be executed on that platform.
|
||||||
To release a version ``MAJOR.MINOR.PATCH``, follow these steps:
|
To release a version ``MAJOR.MINOR.PATCH``, follow these steps:
|
||||||
|
|
||||||
#. For major and minor releases, create a new branch ``MAJOR.MINOR.x`` from
|
#. For major and minor releases, create a new branch ``MAJOR.MINOR.x`` from
|
||||||
``upstream/master`` and push it to ``upstream``.
|
``upstream/main`` and push it to ``upstream``.
|
||||||
|
|
||||||
#. Create a branch ``release-MAJOR.MINOR.PATCH`` from the ``MAJOR.MINOR.x`` branch.
|
#. Create a branch ``release-MAJOR.MINOR.PATCH`` from the ``MAJOR.MINOR.x`` branch.
|
||||||
|
|
||||||
|
@ -106,29 +136,31 @@ Both automatic and manual processes described above follow the same steps from t
|
||||||
#. After all tests pass and the PR has been approved, tag the release commit
|
#. After all tests pass and the PR has been approved, tag the release commit
|
||||||
in the ``release-MAJOR.MINOR.PATCH`` branch and push it. This will publish to PyPI::
|
in the ``release-MAJOR.MINOR.PATCH`` branch and push it. This will publish to PyPI::
|
||||||
|
|
||||||
git fetch --all
|
git fetch upstream
|
||||||
git tag MAJOR.MINOR.PATCH upstream/release-MAJOR.MINOR.PATCH
|
git tag MAJOR.MINOR.PATCH upstream/release-MAJOR.MINOR.PATCH
|
||||||
git push git@github.com:pytest-dev/pytest.git MAJOR.MINOR.PATCH
|
git push upstream MAJOR.MINOR.PATCH
|
||||||
|
|
||||||
Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
|
Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
|
||||||
|
|
||||||
#. Merge the PR.
|
#. Merge the PR. **Make sure it's not squash-merged**, so that the tagged commit ends up in the main branch.
|
||||||
|
|
||||||
#. Cherry-pick the CHANGELOG / announce files to the ``master`` branch::
|
#. Cherry-pick the CHANGELOG / announce files to the ``main`` branch::
|
||||||
|
|
||||||
git fetch --all --prune
|
git fetch upstream
|
||||||
git checkout origin/master -b cherry-pick-release
|
git checkout upstream/main -b cherry-pick-release
|
||||||
git cherry-pick -x -m1 upstream/MAJOR.MINOR.x
|
git cherry-pick -x -m1 upstream/MAJOR.MINOR.x
|
||||||
|
|
||||||
#. Open a PR for ``cherry-pick-release`` and merge it once CI passes. No need to wait for approvals if there were no conflicts on the previous step.
|
#. Open a PR for ``cherry-pick-release`` and merge it once CI passes. No need to wait for approvals if there were no conflicts on the previous step.
|
||||||
|
|
||||||
#. For major and minor releases, tag the release cherry-pick merge commit in master with
|
#. For major and minor releases (or the first prerelease of it), tag the release cherry-pick merge commit in main with
|
||||||
a dev tag for the next feature release::
|
a dev tag for the next feature release::
|
||||||
|
|
||||||
git checkout master
|
git checkout main
|
||||||
git pull
|
git pull
|
||||||
git tag MAJOR.{MINOR+1}.0.dev0
|
git tag MAJOR.{MINOR+1}.0.dev0
|
||||||
git push git@github.com:pytest-dev/pytest.git MAJOR.{MINOR+1}.0.dev0
|
git push upstream MAJOR.{MINOR+1}.0.dev0
|
||||||
|
|
||||||
|
#. For major and minor releases, change the default version in the `Read the Docs Settings <https://readthedocs.org/dashboard/pytest/advanced/>`_ to the new branch.
|
||||||
|
|
||||||
#. Send an email announcement with the contents from::
|
#. Send an email announcement with the contents from::
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ The current list of contributors receiving funding are:
|
||||||
|
|
||||||
* `@asottile`_
|
* `@asottile`_
|
||||||
* `@nicoddemus`_
|
* `@nicoddemus`_
|
||||||
|
* `@The-Compiler`_
|
||||||
|
|
||||||
Contributors interested in receiving a part of the funds just need to submit a PR adding their
|
Contributors interested in receiving a part of the funds just need to submit a PR adding their
|
||||||
name to the list. Contributors that want to stop receiving the funds should also submit a PR
|
name to the list. Contributors that want to stop receiving the funds should also submit a PR
|
||||||
|
@ -56,3 +57,4 @@ funds. Just drop a line to one of the `@pytest-dev/tidelift-admins`_ or use the
|
||||||
|
|
||||||
.. _`@asottile`: https://github.com/asottile
|
.. _`@asottile`: https://github.com/asottile
|
||||||
.. _`@nicoddemus`: https://github.com/nicoddemus
|
.. _`@nicoddemus`: https://github.com/nicoddemus
|
||||||
|
.. _`@The-Compiler`: https://github.com/The-Compiler
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8.
|
|
@ -0,0 +1 @@
|
||||||
|
:data:`sys.stdin` now contains all expected methods of a file-like object when capture is enabled.
|
|
@ -0,0 +1,5 @@
|
||||||
|
``@pytest.mark.parametrize()`` (and similar functions) now accepts any ``Sequence[str]`` for the argument names,
|
||||||
|
instead of just ``list[str]`` and ``tuple[str, ...]``.
|
||||||
|
|
||||||
|
(Note that ``str``, which is itself a ``Sequence[str]``, is still treated as a
|
||||||
|
comma-delimited name list, as before).
|
|
@ -0,0 +1,3 @@
|
||||||
|
Made ``_pytest.doctest.DoctestItem`` export ``pytest.DoctestItem`` for
|
||||||
|
type check and runtime purposes. Made `_pytest.doctest` use internal APIs
|
||||||
|
to avoid circular imports.
|
|
@ -0,0 +1,4 @@
|
||||||
|
Deprecate configuring hook specs/impls using attributes/marks.
|
||||||
|
|
||||||
|
Instead use :py:func:`pytest.hookimpl` and :py:func:`pytest.hookspec`.
|
||||||
|
For more details, see the :ref:`docs <legacy-path-hooks-deprecated>`.
|
|
@ -1 +0,0 @@
|
||||||
Add automatically generated :ref:`plugin-list`. The list is updated on a periodic schedule.
|
|
|
@ -1,2 +0,0 @@
|
||||||
Added :meth:`cache.mkdir() <pytest.Cache.mkdir>`, which is similar to the existing :meth:`cache.makedir() <pytest.Cache.makedir>`,
|
|
||||||
but returns a :class:`pathlib.Path` instead of a legacy ``py.path.local``.
|
|
|
@ -0,0 +1 @@
|
||||||
|
A warning is now emitted if a test function returns something other than `None`. This prevents a common mistake among beginners that expect that returning a `bool` (for example `return foo(a, b) == result`) would cause a test to pass or fail, instead of using `assert`.
|
|
@ -1,10 +0,0 @@
|
||||||
Directly constructing the following classes is now deprecated:
|
|
||||||
|
|
||||||
- ``_pytest.mark.structures.Mark``
|
|
||||||
- ``_pytest.mark.structures.MarkDecorator``
|
|
||||||
- ``_pytest.mark.structures.MarkGenerator``
|
|
||||||
- ``_pytest.python.Metafunc``
|
|
||||||
- ``_pytest.runner.CallInfo``
|
|
||||||
- ``_pytest._code.ExceptionInfo``
|
|
||||||
|
|
||||||
These have always been considered private, but now issue a deprecation warning, which may become a hard error in pytest 7.0.0.
|
|
|
@ -1,15 +0,0 @@
|
||||||
The types of objects used in pytest's API are now exported so they may be used in type annotations.
|
|
||||||
|
|
||||||
The newly-exported types are:
|
|
||||||
|
|
||||||
- ``pytest.Mark`` for :class:`marks <pytest.Mark>`.
|
|
||||||
- ``pytest.MarkDecorator`` for :class:`mark decorators <pytest.MarkDecorator>`.
|
|
||||||
- ``pytest.MarkGenerator`` for the :class:`pytest.mark <pytest.MarkGenerator>` singleton.
|
|
||||||
- ``pytest.Metafunc`` for the :class:`metafunc <pytest.MarkGenerator>` argument to the :func:`pytest_generate_tests <pytest.hookspec.pytest_generate_tests>` hook.
|
|
||||||
- ``pytest.CallInfo`` for the :class:`CallInfo <pytest.CallInfo>` type passed to various hooks.
|
|
||||||
- ``pytest.ExceptionInfo`` for the :class:`ExceptionInfo <pytest.ExceptionInfo>` type returned from :func:`pytest.raises` and passed to various hooks.
|
|
||||||
|
|
||||||
Constructing them directly is not supported; they are only meant for use in type annotations.
|
|
||||||
Doing so will emit a deprecation warning, and may become a hard-error in pytest 7.0.
|
|
||||||
|
|
||||||
Subclassing them is also not supported. This is not currently enforced at runtime, but is detected by type-checkers such as mypy.
|
|
|
@ -1 +0,0 @@
|
||||||
Fixed failing staticmethod test cases if they are inherited from a parent test class.
|
|
|
@ -1,7 +0,0 @@
|
||||||
The following hooks now receive an additional ``pathlib.Path`` argument, equivalent to an existing ``py.path.local`` argument:
|
|
||||||
|
|
||||||
- :func:`pytest_ignore_collect <_pytest.hookspec.pytest_ignore_collect>` - The ``fspath`` parameter (equivalent to existing ``path`` parameter).
|
|
||||||
- :func:`pytest_collect_file <_pytest.hookspec.pytest_collect_file>` - The ``fspath`` parameter (equivalent to existing ``path`` parameter).
|
|
||||||
- :func:`pytest_pycollect_makemodule <_pytest.hookspec.pytest_pycollect_makemodule>` - The ``fspath`` parameter (equivalent to existing ``path`` parameter).
|
|
||||||
- :func:`pytest_report_header <_pytest.hookspec.pytest_report_header>` - The ``startpath`` parameter (equivalent to existing ``startdir`` parameter).
|
|
||||||
- :func:`pytest_report_collectionfinish <_pytest.hookspec.pytest_report_collectionfinish>` - The ``startpath`` parameter (equivalent to existing ``startdir`` parameter).
|
|
|
@ -1,6 +0,0 @@
|
||||||
The following changes have been made to internal pytest types/functions:
|
|
||||||
|
|
||||||
- The ``path`` property of ``_pytest.code.Code`` returns ``Path`` instead of ``py.path.local``.
|
|
||||||
- The ``path`` property of ``_pytest.code.TracebackEntry`` returns ``Path`` instead of ``py.path.local``.
|
|
||||||
- The ``_pytest.code.getfslineno()`` function returns ``Path`` instead of ``py.path.local``.
|
|
||||||
- The ``_pytest.python.path_matches_patterns()`` function takes ``Path`` instead of ``py.path.local``.
|
|
|
@ -1,3 +0,0 @@
|
||||||
``testdir.makefile`` now silently accepts values which don't start with ``.`` to maintain backward compatibility with older pytest versions.
|
|
||||||
|
|
||||||
``pytester.makefile`` now issues a clearer error if the ``.`` is missing in the ``ext`` argument.
|
|
|
@ -1,7 +0,0 @@
|
||||||
Raising :class:`unittest.SkipTest` to skip collection of tests during the
|
|
||||||
pytest collection phase is deprecated. Use :func:`pytest.skip` instead.
|
|
||||||
|
|
||||||
Note: This deprecation only relates to using `unittest.SkipTest` during test
|
|
||||||
collection. You are probably not doing that. Ordinary usage of
|
|
||||||
:class:`unittest.SkipTest` / :meth:`unittest.TestCase.skipTest` /
|
|
||||||
:func:`unittest.skip` in unittest test cases is fully supported.
|
|
|
@ -1 +0,0 @@
|
||||||
Internal Restructure: let python.PyObjMixing inherit from nodes.Node to carry over typing information.
|
|
|
@ -1 +0,0 @@
|
||||||
Deprecate ``Node.fspath`` as we plan to move off `py.path.local <https://py.readthedocs.io/en/latest/path.html>`__ and switch to :mod:``pathlib``.
|
|
|
@ -1 +0,0 @@
|
||||||
Implement ``Node.path`` as a ``pathlib.Path``.
|
|
|
@ -1,3 +0,0 @@
|
||||||
Fixed issue where pytest's ``faulthandler`` support would not dump traceback on crashes
|
|
||||||
if the :mod:`faulthandler` module was already enabled during pytest startup (using
|
|
||||||
``python -X dev -m pytest`` for example).
|
|
|
@ -1,5 +0,0 @@
|
||||||
Several behaviors of :meth:`Parser.addoption <_pytest.config.argparsing.Parser.addoption>` are now
|
|
||||||
scheduled for removal in pytest 7 (deprecated since pytest 2.4.0):
|
|
||||||
|
|
||||||
- ``parser.addoption(..., help=".. %default ..")`` - use ``%(default)s`` instead.
|
|
||||||
- ``parser.addoption(..., type="int/string/float/complex")`` - use ``type=int`` etc. instead.
|
|
|
@ -1 +0,0 @@
|
||||||
Fixed an issue where illegal directory characters derived from ``getpass.getuser()`` raised an ``OSError``.
|
|
|
@ -1 +0,0 @@
|
||||||
Fix ``Class.from_parent`` so it forwards extra keyword arguments to the constructor.
|
|
|
@ -1 +0,0 @@
|
||||||
The ``@pytest.mark.skip`` decorator now correctly handles its arguments. When the ``reason`` argument is accidentally given both positional and as a keyword (e.g. because it was confused with ``skipif``), a ``TypeError`` now occurs. Before, such tests were silently skipped, and the positional argument ignored. Additionally, ``reason`` is now documented correctly as positional or keyword (rather than keyword-only).
|
|
|
@ -1 +0,0 @@
|
||||||
Use private names for internal fixtures that handle classic setup/teardown so that they don't show up with the default ``--fixtures`` invocation (but they still show up with ``--fixtures -v``).
|
|
|
@ -1 +0,0 @@
|
||||||
Assert the outcomes for the issue 518 test and fix the test.
|
|
|
@ -1 +0,0 @@
|
||||||
:func:`pytest.approx` now works on :class:`~decimal.Decimal` within mappings/dicts and sequences/lists.
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Introduce multiline display for warning matching via :py:func:`pytest.warns` and
|
||||||
|
enhance match comparison for :py:func:`_pytest._code.ExceptionInfo.match` as returned by :py:func:`pytest.raises`.
|
|
@ -0,0 +1,2 @@
|
||||||
|
Improve :py:func:`pytest.raises`. Previously passing an empty tuple would give a confusing
|
||||||
|
error. We now raise immediately with a more helpful message.
|
|
@ -0,0 +1 @@
|
||||||
|
Showing inner exceptions by forcing native display in ``ExceptionGroups`` even when using display options other than ``--tb=native``. A temporary step before full implementation of pytest-native display for inner exceptions in ``ExceptionGroups``.
|
|
@ -0,0 +1 @@
|
||||||
|
The documentation is now built using Sphinx 5.x (up from 3.x previously).
|
|
@ -0,0 +1 @@
|
||||||
|
Update documentation on how :func:`pytest.warns` affects :class:`DeprecationWarning`.
|
|
@ -0,0 +1,3 @@
|
||||||
|
On Python 3.11, use the standard library's :mod:`tomllib` to parse TOML.
|
||||||
|
|
||||||
|
:mod:`tomli`` is no longer a dependency on Python 3.11.
|
|
@ -0,0 +1 @@
|
||||||
|
Display assertion message without escaped newline characters with ``-vv``.
|
|
@ -0,0 +1 @@
|
||||||
|
Improved error message that is shown when no collector is found for a given file.
|
|
@ -0,0 +1 @@
|
||||||
|
Some coloring has been added to the short test summary.
|
|
@ -0,0 +1 @@
|
||||||
|
Ensure ``caplog.get_records(when)`` returns current/correct data after invoking ``caplog.clear()``.
|
|
@ -0,0 +1 @@
|
||||||
|
Normalize the help description of all command-line options.
|
|
@ -0,0 +1 @@
|
||||||
|
Added shell-style wildcard support to ``testpaths``.
|
|
@ -0,0 +1 @@
|
||||||
|
Made ``_pytest.compat`` re-export ``importlib_metadata`` in the eyes of type checkers.
|
|
@ -0,0 +1 @@
|
||||||
|
Fix default encoding warning (``EncodingWarning``) in ``cacheprovider``
|
|
@ -0,0 +1 @@
|
||||||
|
Display full crash messages in ``short test summary info``, when runng in a CI environment.
|
|
@ -0,0 +1,4 @@
|
||||||
|
Improve the error message when we attempt to access a fixture that has been
|
||||||
|
torn down.
|
||||||
|
Add an additional sentence to the docstring explaining when it's not a good
|
||||||
|
idea to call getfixturevalue.
|
|
@ -0,0 +1 @@
|
||||||
|
Added support for hidden configuration file by allowing ``.pytest.ini`` as an alternative to ``pytest.ini``.
|
|
@ -34,6 +34,10 @@ REGENDOC_ARGS := \
|
||||||
|
|
||||||
regen: REGENDOC_FILES:=*.rst */*.rst
|
regen: REGENDOC_FILES:=*.rst */*.rst
|
||||||
regen:
|
regen:
|
||||||
PYTHONDONTWRITEBYTECODE=1 PYTEST_ADDOPTS="-pno:hypothesis -Wignore::pytest.PytestUnknownMarkWarning" COLUMNS=76 regendoc --update ${REGENDOC_FILES} ${REGENDOC_ARGS}
|
# need to reset cachedir to the non-tox default
|
||||||
|
PYTHONDONTWRITEBYTECODE=1 \
|
||||||
|
PYTEST_ADDOPTS="-pno:hypothesis -p no:hypothesispytest -Wignore::pytest.PytestUnknownMarkWarning -o cache_dir=.pytest_cache" \
|
||||||
|
COLUMNS=76 \
|
||||||
|
regendoc --update ${REGENDOC_FILES} ${REGENDOC_ARGS}
|
||||||
|
|
||||||
.PHONY: regen
|
.PHONY: regen
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
<li><a href="{{ pathto('changelog') }}">Changelog</a></li>
|
<li><a href="{{ pathto('changelog') }}">Changelog</a></li>
|
||||||
<li><a href="{{ pathto('contributing') }}">Contributing</a></li>
|
<li><a href="{{ pathto('contributing') }}">Contributing</a></li>
|
||||||
<li><a href="{{ pathto('backwards-compatibility') }}">Backwards Compatibility</a></li>
|
<li><a href="{{ pathto('backwards-compatibility') }}">Backwards Compatibility</a></li>
|
||||||
<li><a href="{{ pathto('py27-py34-deprecation') }}">Python 2.7 and 3.4 Support</a></li>
|
|
||||||
<li><a href="{{ pathto('sponsor') }}">Sponsor</a></li>
|
<li><a href="{{ pathto('sponsor') }}">Sponsor</a></li>
|
||||||
<li><a href="{{ pathto('tidelift') }}">pytest for Enterprise</a></li>
|
<li><a href="{{ pathto('tidelift') }}">pytest for Enterprise</a></li>
|
||||||
<li><a href="{{ pathto('license') }}">License</a></li>
|
<li><a href="{{ pathto('license') }}">License</a></li>
|
||||||
|
@ -30,5 +29,3 @@
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<a href="{{ pathto('genindex') }}">Index</a>
|
|
||||||
<hr>
|
|
||||||
|
|
|
@ -10,10 +10,9 @@ Are you an enthusiastic pytest user, the local testing guru in your workplace? O
|
||||||
|
|
||||||
We will pair experienced pytest users with open source projects, for a month's effort of getting new development teams started with pytest.
|
We will pair experienced pytest users with open source projects, for a month's effort of getting new development teams started with pytest.
|
||||||
|
|
||||||
In 2015 we are trying this for the first time. In February and March 2015 we will gather volunteers on both sides, in April we will do the work, and in May we will evaluate how it went. This effort is being coordinated by Brianna Laugher. If you have any questions or comments, you can raise them on the `@pytestdotorg twitter account <https://twitter.com/pytestdotorg>`_ the `issue tracker`_ or the `pytest-dev mailing list`_.
|
In 2015 we are trying this for the first time. In February and March 2015 we will gather volunteers on both sides, in April we will do the work, and in May we will evaluate how it went. This effort is being coordinated by Brianna Laugher. If you have any questions or comments, you can raise them on the `@pytestdotorg twitter account <https://twitter.com/pytestdotorg>`_\, the :issue:`issue tracker <676>` or the `pytest-dev mailing list`_.
|
||||||
|
|
||||||
|
|
||||||
.. _`issue tracker`: https://github.com/pytest-dev/pytest/issues/676
|
|
||||||
.. _`pytest-dev mailing list`: https://mail.python.org/mailman/listinfo/pytest-dev
|
.. _`pytest-dev mailing list`: https://mail.python.org/mailman/listinfo/pytest-dev
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,16 @@ Release announcements
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
|
|
||||||
|
release-7.1.3
|
||||||
|
release-7.1.2
|
||||||
|
release-7.1.1
|
||||||
|
release-7.1.0
|
||||||
|
release-7.0.1
|
||||||
|
release-7.0.0
|
||||||
|
release-7.0.0rc1
|
||||||
|
release-6.2.5
|
||||||
|
release-6.2.4
|
||||||
|
release-6.2.3
|
||||||
release-6.2.2
|
release-6.2.2
|
||||||
release-6.2.1
|
release-6.2.1
|
||||||
release-6.2.0
|
release-6.2.0
|
||||||
|
|
|
@ -36,12 +36,12 @@ New Features
|
||||||
|
|
||||||
import pytest ; pytest.main(arglist, pluginlist)
|
import pytest ; pytest.main(arglist, pluginlist)
|
||||||
|
|
||||||
see http://pytest.org/en/stable/usage.html for details.
|
see http://pytest.org/en/stable/how-to/usage.html for details.
|
||||||
|
|
||||||
- new and better reporting information in assert expressions
|
- new and better reporting information in assert expressions
|
||||||
if comparing lists, sequences or strings.
|
if comparing lists, sequences or strings.
|
||||||
|
|
||||||
see http://pytest.org/en/stable/assert.html#newreport
|
see http://pytest.org/en/stable/how-to/assert.html#newreport
|
||||||
|
|
||||||
- new configuration through ini-files (setup.cfg or tox.ini recognized),
|
- new configuration through ini-files (setup.cfg or tox.ini recognized),
|
||||||
for example::
|
for example::
|
||||||
|
@ -50,7 +50,7 @@ New Features
|
||||||
norecursedirs = .hg data* # don't ever recurse in such dirs
|
norecursedirs = .hg data* # don't ever recurse in such dirs
|
||||||
addopts = -x --pyargs # add these command line options by default
|
addopts = -x --pyargs # add these command line options by default
|
||||||
|
|
||||||
see http://pytest.org/en/stable/customize.html
|
see http://pytest.org/en/stable/reference/customize.html
|
||||||
|
|
||||||
- improved standard unittest support. In general py.test should now
|
- improved standard unittest support. In general py.test should now
|
||||||
better be able to run custom unittest.TestCases like twisted trial
|
better be able to run custom unittest.TestCases like twisted trial
|
||||||
|
|
|
@ -57,7 +57,7 @@ Changes between 2.0.0 and 2.0.1
|
||||||
- refinements to "collecting" output on non-ttys
|
- refinements to "collecting" output on non-ttys
|
||||||
- refine internal plugin registration and --traceconfig output
|
- refine internal plugin registration and --traceconfig output
|
||||||
- introduce a mechanism to prevent/unregister plugins from the
|
- introduce a mechanism to prevent/unregister plugins from the
|
||||||
command line, see http://pytest.org/en/stable/plugins.html#cmdunregister
|
command line, see http://pytest.org/en/stable/how-to/plugins.html#cmdunregister
|
||||||
- activate resultlog plugin by default
|
- activate resultlog plugin by default
|
||||||
- fix regression wrt yielded tests which due to the
|
- fix regression wrt yielded tests which due to the
|
||||||
collection-before-running semantics were not
|
collection-before-running semantics were not
|
||||||
|
|
|
@ -12,7 +12,7 @@ courtesy of Benjamin Peterson. You can now safely use ``assert``
|
||||||
statements in test modules without having to worry about side effects
|
statements in test modules without having to worry about side effects
|
||||||
or python optimization ("-OO") options. This is achieved by rewriting
|
or python optimization ("-OO") options. This is achieved by rewriting
|
||||||
assert statements in test modules upon import, using a PEP302 hook.
|
assert statements in test modules upon import, using a PEP302 hook.
|
||||||
See https://docs.pytest.org/en/stable/assert.html for
|
See https://docs.pytest.org/en/stable/how-to/assert.html for
|
||||||
detailed information. The work has been partly sponsored by my company,
|
detailed information. The work has been partly sponsored by my company,
|
||||||
merlinux GmbH.
|
merlinux GmbH.
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ If you want to install or upgrade pytest, just type one of::
|
||||||
easy_install -U pytest
|
easy_install -U pytest
|
||||||
|
|
||||||
best,
|
best,
|
||||||
holger krekel / http://merlinux.eu
|
holger krekel / https://merlinux.eu/
|
||||||
|
|
||||||
Changes between 2.0.3 and 2.1.0
|
Changes between 2.0.3 and 2.1.0
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
|
|
|
@ -20,7 +20,7 @@ If you want to install or upgrade pytest, just type one of::
|
||||||
easy_install -U pytest
|
easy_install -U pytest
|
||||||
|
|
||||||
best,
|
best,
|
||||||
holger krekel / http://merlinux.eu
|
holger krekel / https://merlinux.eu/
|
||||||
|
|
||||||
Changes between 2.1.0 and 2.1.1
|
Changes between 2.1.0 and 2.1.1
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
|
|
|
@ -19,7 +19,7 @@ If you want to install or upgrade pytest, just type one of::
|
||||||
easy_install -U pytest
|
easy_install -U pytest
|
||||||
|
|
||||||
best,
|
best,
|
||||||
holger krekel / http://merlinux.eu
|
holger krekel / https://merlinux.eu/
|
||||||
|
|
||||||
Changes between 2.1.1 and 2.1.2
|
Changes between 2.1.1 and 2.1.2
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
|
@ -9,7 +9,7 @@ with these improvements:
|
||||||
|
|
||||||
- new @pytest.mark.parametrize decorator to run tests with different arguments
|
- new @pytest.mark.parametrize decorator to run tests with different arguments
|
||||||
- new metafunc.parametrize() API for parametrizing arguments independently
|
- new metafunc.parametrize() API for parametrizing arguments independently
|
||||||
- see examples at http://pytest.org/en/stable/example/parametrize.html
|
- see examples at http://pytest.org/en/stable/example/how-to/parametrize.html
|
||||||
- NOTE that parametrize() related APIs are still a bit experimental
|
- NOTE that parametrize() related APIs are still a bit experimental
|
||||||
and might change in future releases.
|
and might change in future releases.
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ Changes between 2.1.3 and 2.2.0
|
||||||
or through plugin hooks. Also introduce a "--strict" option which
|
or through plugin hooks. Also introduce a "--strict" option which
|
||||||
will treat unregistered markers as errors
|
will treat unregistered markers as errors
|
||||||
allowing to avoid typos and maintain a well described set of markers
|
allowing to avoid typos and maintain a well described set of markers
|
||||||
for your test suite. See examples at http://pytest.org/en/stable/mark.html
|
for your test suite. See examples at http://pytest.org/en/stable/how-to/mark.html
|
||||||
and its links.
|
and its links.
|
||||||
- issue50: introduce "-m marker" option to select tests based on markers
|
- issue50: introduce "-m marker" option to select tests based on markers
|
||||||
(this is a stricter and more predictable version of "-k" in that "-m"
|
(this is a stricter and more predictable version of "-k" in that "-m"
|
||||||
|
|
|
@ -13,12 +13,12 @@ re-usable fixture design.
|
||||||
|
|
||||||
For detailed info and tutorial-style examples, see:
|
For detailed info and tutorial-style examples, see:
|
||||||
|
|
||||||
http://pytest.org/en/stable/fixture.html
|
http://pytest.org/en/stable/explanation/fixtures.html
|
||||||
|
|
||||||
Moreover, there is now support for using pytest fixtures/funcargs with
|
Moreover, there is now support for using pytest fixtures/funcargs with
|
||||||
unittest-style suites, see here for examples:
|
unittest-style suites, see here for examples:
|
||||||
|
|
||||||
http://pytest.org/en/stable/unittest.html
|
http://pytest.org/en/stable/how-to/unittest.html
|
||||||
|
|
||||||
Besides, more unittest-test suites are now expected to "simply work"
|
Besides, more unittest-test suites are now expected to "simply work"
|
||||||
with pytest.
|
with pytest.
|
||||||
|
|
|
@ -16,7 +16,7 @@ comes with the following fixes and features:
|
||||||
- yielded test functions will now have autouse-fixtures active but
|
- yielded test functions will now have autouse-fixtures active but
|
||||||
cannot accept fixtures as funcargs - it's anyway recommended to
|
cannot accept fixtures as funcargs - it's anyway recommended to
|
||||||
rather use the post-2.0 parametrize features instead of yield, see:
|
rather use the post-2.0 parametrize features instead of yield, see:
|
||||||
http://pytest.org/en/stable/example/parametrize.html
|
http://pytest.org/en/stable/example/how-to/parametrize.html
|
||||||
- fix autouse-issue where autouse-fixtures would not be discovered
|
- fix autouse-issue where autouse-fixtures would not be discovered
|
||||||
if defined in an a/conftest.py file and tests in a/tests/test_some.py
|
if defined in an a/conftest.py file and tests in a/tests/test_some.py
|
||||||
- fix issue226 - LIFO ordering for fixture teardowns
|
- fix issue226 - LIFO ordering for fixture teardowns
|
||||||
|
|
|
@ -23,14 +23,13 @@ a full list of details. A few feature highlights:
|
||||||
called if the corresponding setup method succeeded.
|
called if the corresponding setup method succeeded.
|
||||||
|
|
||||||
- integrate tab-completion on command line options if you
|
- integrate tab-completion on command line options if you
|
||||||
have `argcomplete <https://pypi.org/project/argcomplete/>`_
|
have :pypi:`argcomplete` configured.
|
||||||
configured.
|
|
||||||
|
|
||||||
- allow boolean expression directly with skipif/xfail
|
- allow boolean expression directly with skipif/xfail
|
||||||
if a "reason" is also specified.
|
if a "reason" is also specified.
|
||||||
|
|
||||||
- a new hook ``pytest_load_initial_conftests`` allows plugins like
|
- a new hook ``pytest_load_initial_conftests`` allows plugins like
|
||||||
`pytest-django <https://pypi.org/project/pytest-django/>`_ to
|
:pypi:`pytest-django` to
|
||||||
influence the environment before conftest files import ``django``.
|
influence the environment before conftest files import ``django``.
|
||||||
|
|
||||||
- reporting: color the last line red or green depending if
|
- reporting: color the last line red or green depending if
|
||||||
|
|
|
@ -11,7 +11,7 @@ clear information about the circumstances and a simple example which
|
||||||
reproduces the problem.
|
reproduces the problem.
|
||||||
|
|
||||||
The issue tracker is of course not empty now. We have many remaining
|
The issue tracker is of course not empty now. We have many remaining
|
||||||
"enhacement" issues which we'll hopefully can tackle in 2014 with your
|
"enhancement" issues which we'll hopefully can tackle in 2014 with your
|
||||||
help.
|
help.
|
||||||
|
|
||||||
For those who use older Python versions, please note that pytest is not
|
For those who use older Python versions, please note that pytest is not
|
||||||
|
|
|
@ -45,29 +45,29 @@ The py.test Development Team
|
||||||
**New Features**
|
**New Features**
|
||||||
|
|
||||||
* New ``pytest.mark.skip`` mark, which unconditionally skips marked tests.
|
* New ``pytest.mark.skip`` mark, which unconditionally skips marked tests.
|
||||||
Thanks `@MichaelAquilina`_ for the complete PR (`#1040`_).
|
Thanks :user:`MichaelAquilina` for the complete PR (:pull:`1040`).
|
||||||
|
|
||||||
* ``--doctest-glob`` may now be passed multiple times in the command-line.
|
* ``--doctest-glob`` may now be passed multiple times in the command-line.
|
||||||
Thanks `@jab`_ and `@nicoddemus`_ for the PR.
|
Thanks :user:`jab` and :user:`nicoddemus` for the PR.
|
||||||
|
|
||||||
* New ``-rp`` and ``-rP`` reporting options give the summary and full output
|
* New ``-rp`` and ``-rP`` reporting options give the summary and full output
|
||||||
of passing tests, respectively. Thanks to `@codewarrior0`_ for the PR.
|
of passing tests, respectively. Thanks to :user:`codewarrior0` for the PR.
|
||||||
|
|
||||||
* ``pytest.mark.xfail`` now has a ``strict`` option which makes ``XPASS``
|
* ``pytest.mark.xfail`` now has a ``strict`` option which makes ``XPASS``
|
||||||
tests to fail the test suite, defaulting to ``False``. There's also a
|
tests to fail the test suite, defaulting to ``False``. There's also a
|
||||||
``xfail_strict`` ini option that can be used to configure it project-wise.
|
``xfail_strict`` ini option that can be used to configure it project-wise.
|
||||||
Thanks `@rabbbit`_ for the request and `@nicoddemus`_ for the PR (`#1355`_).
|
Thanks :user:`rabbbit` for the request and :user:`nicoddemus` for the PR (:issue:`1355`).
|
||||||
|
|
||||||
* ``Parser.addini`` now supports options of type ``bool``. Thanks
|
* ``Parser.addini`` now supports options of type ``bool``. Thanks
|
||||||
`@nicoddemus`_ for the PR.
|
:user:`nicoddemus` for the PR.
|
||||||
|
|
||||||
* New ``ALLOW_BYTES`` doctest option strips ``b`` prefixes from byte strings
|
* New ``ALLOW_BYTES`` doctest option strips ``b`` prefixes from byte strings
|
||||||
in doctest output (similar to ``ALLOW_UNICODE``).
|
in doctest output (similar to ``ALLOW_UNICODE``).
|
||||||
Thanks `@jaraco`_ for the request and `@nicoddemus`_ for the PR (`#1287`_).
|
Thanks :user:`jaraco` for the request and :user:`nicoddemus` for the PR (:issue:`1287`).
|
||||||
|
|
||||||
* give a hint on KeyboardInterrupt to use the --fulltrace option to show the errors,
|
* give a hint on KeyboardInterrupt to use the --fulltrace option to show the errors,
|
||||||
this fixes `#1366`_.
|
this fixes :issue:`1366`.
|
||||||
Thanks to `@hpk42`_ for the report and `@RonnyPfannschmidt`_ for the PR.
|
Thanks to :user:`hpk42` for the report and :user:`RonnyPfannschmidt` for the PR.
|
||||||
|
|
||||||
* catch IndexError exceptions when getting exception source location. This fixes
|
* catch IndexError exceptions when getting exception source location. This fixes
|
||||||
pytest internal error for dynamically generated code (fixtures and tests)
|
pytest internal error for dynamically generated code (fixtures and tests)
|
||||||
|
@ -91,69 +91,44 @@ The py.test Development Team
|
||||||
`pylib <https://pylib.readthedocs.io/en/stable/>`_.
|
`pylib <https://pylib.readthedocs.io/en/stable/>`_.
|
||||||
|
|
||||||
* ``pytest_enter_pdb`` now optionally receives the pytest config object.
|
* ``pytest_enter_pdb`` now optionally receives the pytest config object.
|
||||||
Thanks `@nicoddemus`_ for the PR.
|
Thanks :user:`nicoddemus` for the PR.
|
||||||
|
|
||||||
* Removed code and documentation for Python 2.5 or lower versions,
|
* Removed code and documentation for Python 2.5 or lower versions,
|
||||||
including removal of the obsolete ``_pytest.assertion.oldinterpret`` module.
|
including removal of the obsolete ``_pytest.assertion.oldinterpret`` module.
|
||||||
Thanks `@nicoddemus`_ for the PR (`#1226`_).
|
Thanks :user:`nicoddemus` for the PR (:issue:`1226`).
|
||||||
|
|
||||||
* Comparisons now always show up in full when ``CI`` or ``BUILD_NUMBER`` is
|
* Comparisons now always show up in full when ``CI`` or ``BUILD_NUMBER`` is
|
||||||
found in the environment, even when -vv isn't used.
|
found in the environment, even when -vv isn't used.
|
||||||
Thanks `@The-Compiler`_ for the PR.
|
Thanks :user:`The-Compiler` for the PR.
|
||||||
|
|
||||||
* ``--lf`` and ``--ff`` now support long names: ``--last-failed`` and
|
* ``--lf`` and ``--ff`` now support long names: ``--last-failed`` and
|
||||||
``--failed-first`` respectively.
|
``--failed-first`` respectively.
|
||||||
Thanks `@MichaelAquilina`_ for the PR.
|
Thanks :user:`MichaelAquilina` for the PR.
|
||||||
|
|
||||||
* Added expected exceptions to pytest.raises fail message
|
* Added expected exceptions to pytest.raises fail message
|
||||||
|
|
||||||
* Collection only displays progress ("collecting X items") when in a terminal.
|
* Collection only displays progress ("collecting X items") when in a terminal.
|
||||||
This avoids cluttering the output when using ``--color=yes`` to obtain
|
This avoids cluttering the output when using ``--color=yes`` to obtain
|
||||||
colors in CI integrations systems (`#1397`_).
|
colors in CI integrations systems (:issue:`1397`).
|
||||||
|
|
||||||
**Bug Fixes**
|
**Bug Fixes**
|
||||||
|
|
||||||
* The ``-s`` and ``-c`` options should now work under ``xdist``;
|
* The ``-s`` and ``-c`` options should now work under ``xdist``;
|
||||||
``Config.fromdictargs`` now represents its input much more faithfully.
|
``Config.fromdictargs`` now represents its input much more faithfully.
|
||||||
Thanks to `@bukzor`_ for the complete PR (`#680`_).
|
Thanks to :user:`bukzor` for the complete PR (:issue:`680`).
|
||||||
|
|
||||||
* Fix (`#1290`_): support Python 3.5's ``@`` operator in assertion rewriting.
|
* Fix (:issue:`1290`): support Python 3.5's ``@`` operator in assertion rewriting.
|
||||||
Thanks `@Shinkenjoe`_ for report with test case and `@tomviner`_ for the PR.
|
Thanks :user:`Shinkenjoe` for report with test case and :user:`tomviner` for the PR.
|
||||||
|
|
||||||
* Fix formatting utf-8 explanation messages (`#1379`_).
|
* Fix formatting utf-8 explanation messages (:issue:`1379`).
|
||||||
Thanks `@biern`_ for the PR.
|
Thanks :user:`biern` for the PR.
|
||||||
|
|
||||||
* Fix `traceback style docs`_ to describe all of the available options
|
* Fix `traceback style docs`_ to describe all of the available options
|
||||||
(auto/long/short/line/native/no), with ``auto`` being the default since v2.6.
|
(auto/long/short/line/native/no), with ``auto`` being the default since v2.6.
|
||||||
Thanks `@hackebrot`_ for the PR.
|
Thanks :user:`hackebrot` for the PR.
|
||||||
|
|
||||||
* Fix (`#1422`_): junit record_xml_property doesn't allow multiple records
|
* Fix (:issue:`1422`): junit record_xml_property doesn't allow multiple records
|
||||||
with same name.
|
with same name.
|
||||||
|
|
||||||
|
|
||||||
.. _`traceback style docs`: https://pytest.org/en/stable/usage.html#modifying-python-traceback-printing
|
.. _`traceback style docs`: https://pytest.org/en/stable/how-to/output.html#modifying-python-traceback-printing
|
||||||
|
|
||||||
.. _#1422: https://github.com/pytest-dev/pytest/issues/1422
|
|
||||||
.. _#1379: https://github.com/pytest-dev/pytest/issues/1379
|
|
||||||
.. _#1366: https://github.com/pytest-dev/pytest/issues/1366
|
|
||||||
.. _#1040: https://github.com/pytest-dev/pytest/pull/1040
|
|
||||||
.. _#680: https://github.com/pytest-dev/pytest/issues/680
|
|
||||||
.. _#1287: https://github.com/pytest-dev/pytest/pull/1287
|
|
||||||
.. _#1226: https://github.com/pytest-dev/pytest/pull/1226
|
|
||||||
.. _#1290: https://github.com/pytest-dev/pytest/pull/1290
|
|
||||||
.. _#1355: https://github.com/pytest-dev/pytest/pull/1355
|
|
||||||
.. _#1397: https://github.com/pytest-dev/pytest/issues/1397
|
|
||||||
.. _@biern: https://github.com/biern
|
|
||||||
.. _@MichaelAquilina: https://github.com/MichaelAquilina
|
|
||||||
.. _@bukzor: https://github.com/bukzor
|
|
||||||
.. _@hpk42: https://github.com/hpk42
|
|
||||||
.. _@nicoddemus: https://github.com/nicoddemus
|
|
||||||
.. _@jab: https://github.com/jab
|
|
||||||
.. _@codewarrior0: https://github.com/codewarrior0
|
|
||||||
.. _@jaraco: https://github.com/jaraco
|
|
||||||
.. _@The-Compiler: https://github.com/The-Compiler
|
|
||||||
.. _@Shinkenjoe: https://github.com/Shinkenjoe
|
|
||||||
.. _@tomviner: https://github.com/tomviner
|
|
||||||
.. _@RonnyPfannschmidt: https://github.com/RonnyPfannschmidt
|
|
||||||
.. _@rabbbit: https://github.com/rabbbit
|
|
||||||
.. _@hackebrot: https://github.com/hackebrot
|
|
||||||
|
|
|
@ -37,31 +37,21 @@ The py.test Development Team
|
||||||
**Bug Fixes**
|
**Bug Fixes**
|
||||||
|
|
||||||
* Improve error message when a plugin fails to load.
|
* Improve error message when a plugin fails to load.
|
||||||
Thanks `@nicoddemus`_ for the PR.
|
Thanks :user:`nicoddemus` for the PR.
|
||||||
|
|
||||||
* Fix (`#1178 <https://github.com/pytest-dev/pytest/issues/1178>`_):
|
* Fix (:issue:`1178`):
|
||||||
``pytest.fail`` with non-ascii characters raises an internal pytest error.
|
``pytest.fail`` with non-ascii characters raises an internal pytest error.
|
||||||
Thanks `@nicoddemus`_ for the PR.
|
Thanks :user:`nicoddemus` for the PR.
|
||||||
|
|
||||||
* Fix (`#469`_): junit parses report.nodeid incorrectly, when params IDs
|
* Fix (:issue:`469`): junit parses report.nodeid incorrectly, when params IDs
|
||||||
contain ``::``. Thanks `@tomviner`_ for the PR (`#1431`_).
|
contain ``::``. Thanks :user:`tomviner` for the PR (:pull:`1431`).
|
||||||
|
|
||||||
* Fix (`#578 <https://github.com/pytest-dev/pytest/issues/578>`_): SyntaxErrors
|
* Fix (:issue:`578`): SyntaxErrors
|
||||||
containing non-ascii lines at the point of failure generated an internal
|
containing non-ascii lines at the point of failure generated an internal
|
||||||
py.test error.
|
py.test error.
|
||||||
Thanks `@asottile`_ for the report and `@nicoddemus`_ for the PR.
|
Thanks :user:`asottile` for the report and :user:`nicoddemus` for the PR.
|
||||||
|
|
||||||
* Fix (`#1437`_): When passing in a bytestring regex pattern to parameterize
|
* Fix (:issue:`1437`): When passing in a bytestring regex pattern to parameterize
|
||||||
attempt to decode it as utf-8 ignoring errors.
|
attempt to decode it as utf-8 ignoring errors.
|
||||||
|
|
||||||
* Fix (`#649`_): parametrized test nodes cannot be specified to run on the command line.
|
* Fix (:issue:`649`): parametrized test nodes cannot be specified to run on the command line.
|
||||||
|
|
||||||
|
|
||||||
.. _#1437: https://github.com/pytest-dev/pytest/issues/1437
|
|
||||||
.. _#469: https://github.com/pytest-dev/pytest/issues/469
|
|
||||||
.. _#1431: https://github.com/pytest-dev/pytest/pull/1431
|
|
||||||
.. _#649: https://github.com/pytest-dev/pytest/issues/649
|
|
||||||
|
|
||||||
.. _@asottile: https://github.com/asottile
|
|
||||||
.. _@nicoddemus: https://github.com/nicoddemus
|
|
||||||
.. _@tomviner: https://github.com/tomviner
|
|
||||||
|
|
|
@ -39,40 +39,27 @@ The py.test Development Team
|
||||||
|
|
||||||
**Bug Fixes**
|
**Bug Fixes**
|
||||||
|
|
||||||
* fix `#510`_: skip tests where one parameterize dimension was empty
|
* fix :issue:`510`: skip tests where one parameterize dimension was empty
|
||||||
thanks Alex Stapleton for the Report and `@RonnyPfannschmidt`_ for the PR
|
thanks Alex Stapleton for the Report and :user:`RonnyPfannschmidt` for the PR
|
||||||
|
|
||||||
* Fix Xfail does not work with condition keyword argument.
|
* Fix Xfail does not work with condition keyword argument.
|
||||||
Thanks `@astraw38`_ for reporting the issue (`#1496`_) and `@tomviner`_
|
Thanks :user:`astraw38` for reporting the issue (:issue:`1496`) and :user:`tomviner`
|
||||||
for PR the (`#1524`_).
|
for PR the (:pull:`1524`).
|
||||||
|
|
||||||
* Fix win32 path issue when putting custom config file with absolute path
|
* Fix win32 path issue when putting custom config file with absolute path
|
||||||
in ``pytest.main("-c your_absolute_path")``.
|
in ``pytest.main("-c your_absolute_path")``.
|
||||||
|
|
||||||
* Fix maximum recursion depth detection when raised error class is not aware
|
* Fix maximum recursion depth detection when raised error class is not aware
|
||||||
of unicode/encoded bytes.
|
of unicode/encoded bytes.
|
||||||
Thanks `@prusse-martin`_ for the PR (`#1506`_).
|
Thanks :user:`prusse-martin` for the PR (:pull:`1506`).
|
||||||
|
|
||||||
* Fix ``pytest.mark.skip`` mark when used in strict mode.
|
* Fix ``pytest.mark.skip`` mark when used in strict mode.
|
||||||
Thanks `@pquentin`_ for the PR and `@RonnyPfannschmidt`_ for
|
Thanks :user:`pquentin` for the PR and :user:`RonnyPfannschmidt` for
|
||||||
showing how to fix the bug.
|
showing how to fix the bug.
|
||||||
|
|
||||||
* Minor improvements and fixes to the documentation.
|
* Minor improvements and fixes to the documentation.
|
||||||
Thanks `@omarkohl`_ for the PR.
|
Thanks :user:`omarkohl` for the PR.
|
||||||
|
|
||||||
* Fix ``--fixtures`` to show all fixture definitions as opposed to just
|
* Fix ``--fixtures`` to show all fixture definitions as opposed to just
|
||||||
one per fixture name.
|
one per fixture name.
|
||||||
Thanks to `@hackebrot`_ for the PR.
|
Thanks to :user:`hackebrot` for the PR.
|
||||||
|
|
||||||
.. _#510: https://github.com/pytest-dev/pytest/issues/510
|
|
||||||
.. _#1506: https://github.com/pytest-dev/pytest/pull/1506
|
|
||||||
.. _#1496: https://github.com/pytest-dev/pytest/issues/1496
|
|
||||||
.. _#1524: https://github.com/pytest-dev/pytest/pull/1524
|
|
||||||
|
|
||||||
.. _@astraw38: https://github.com/astraw38
|
|
||||||
.. _@hackebrot: https://github.com/hackebrot
|
|
||||||
.. _@omarkohl: https://github.com/omarkohl
|
|
||||||
.. _@pquentin: https://github.com/pquentin
|
|
||||||
.. _@prusse-martin: https://github.com/prusse-martin
|
|
||||||
.. _@RonnyPfannschmidt: https://github.com/RonnyPfannschmidt
|
|
||||||
.. _@tomviner: https://github.com/tomviner
|
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
pytest-6.2.3
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
pytest 6.2.3 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/stable/changelog.html.
|
||||||
|
|
||||||
|
Thanks to all of the contributors to this release:
|
||||||
|
|
||||||
|
* Bruno Oliveira
|
||||||
|
* Ran Benita
|
||||||
|
|
||||||
|
|
||||||
|
Happy testing,
|
||||||
|
The pytest Development Team
|
|
@ -0,0 +1,22 @@
|
||||||
|
pytest-6.2.4
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
pytest 6.2.4 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/stable/changelog.html.
|
||||||
|
|
||||||
|
Thanks to all of the contributors to this release:
|
||||||
|
|
||||||
|
* Anthony Sottile
|
||||||
|
* Bruno Oliveira
|
||||||
|
* Christian Maurer
|
||||||
|
* Florian Bruhin
|
||||||
|
* Ran Benita
|
||||||
|
|
||||||
|
|
||||||
|
Happy testing,
|
||||||
|
The pytest Development Team
|
|
@ -0,0 +1,30 @@
|
||||||
|
pytest-6.2.5
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
pytest 6.2.5 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/stable/changelog.html.
|
||||||
|
|
||||||
|
Thanks to all of the contributors to this release:
|
||||||
|
|
||||||
|
* Anthony Sottile
|
||||||
|
* Bruno Oliveira
|
||||||
|
* Brylie Christopher Oxley
|
||||||
|
* Daniel Asztalos
|
||||||
|
* Florian Bruhin
|
||||||
|
* Jason Haugen
|
||||||
|
* MapleCCC
|
||||||
|
* Michał Górny
|
||||||
|
* Miro Hrončok
|
||||||
|
* Ran Benita
|
||||||
|
* Ronny Pfannschmidt
|
||||||
|
* Sylvain Bellemare
|
||||||
|
* Thomas Güttler
|
||||||
|
|
||||||
|
|
||||||
|
Happy testing,
|
||||||
|
The pytest Development Team
|
|
@ -0,0 +1,74 @@
|
||||||
|
pytest-7.0.0
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
The pytest team is proud to announce the 7.0.0 release!
|
||||||
|
|
||||||
|
This release contains new features, improvements, bug fixes, and breaking changes, so users
|
||||||
|
are encouraged to take a look at the CHANGELOG carefully:
|
||||||
|
|
||||||
|
https://docs.pytest.org/en/stable/changelog.html
|
||||||
|
|
||||||
|
For complete documentation, please visit:
|
||||||
|
|
||||||
|
https://docs.pytest.org/en/stable/
|
||||||
|
|
||||||
|
As usual, you can upgrade from PyPI via:
|
||||||
|
|
||||||
|
pip install -U pytest
|
||||||
|
|
||||||
|
Thanks to all of the contributors to this release:
|
||||||
|
|
||||||
|
* Adam J. Stewart
|
||||||
|
* Alexander King
|
||||||
|
* Amin Alaee
|
||||||
|
* Andrew Neitsch
|
||||||
|
* Anthony Sottile
|
||||||
|
* Ben Davies
|
||||||
|
* Bernát Gábor
|
||||||
|
* Brian Okken
|
||||||
|
* Bruno Oliveira
|
||||||
|
* Cristian Vera
|
||||||
|
* Dan Alvizu
|
||||||
|
* David Szotten
|
||||||
|
* Eddie
|
||||||
|
* Emmanuel Arias
|
||||||
|
* Emmanuel Meric de Bellefon
|
||||||
|
* Eric Liu
|
||||||
|
* Florian Bruhin
|
||||||
|
* GergelyKalmar
|
||||||
|
* Graeme Smecher
|
||||||
|
* Harshna
|
||||||
|
* Hugo van Kemenade
|
||||||
|
* Jakub Kulík
|
||||||
|
* James Myatt
|
||||||
|
* Jeff Rasley
|
||||||
|
* Kale Kundert
|
||||||
|
* Kian Meng, Ang
|
||||||
|
* Miro Hrončok
|
||||||
|
* Naveen-Pratap
|
||||||
|
* Oleg Höfling
|
||||||
|
* Olga Matoula
|
||||||
|
* Ran Benita
|
||||||
|
* Ronny Pfannschmidt
|
||||||
|
* Simon K
|
||||||
|
* Srip
|
||||||
|
* Sören Wegener
|
||||||
|
* Taneli Hukkinen
|
||||||
|
* Terje Runde
|
||||||
|
* Thomas Grainger
|
||||||
|
* Thomas Hisch
|
||||||
|
* William Jamir Silva
|
||||||
|
* Yuval Shimon
|
||||||
|
* Zac Hatfield-Dodds
|
||||||
|
* andrewdotn
|
||||||
|
* denivyruck
|
||||||
|
* ericluoliu
|
||||||
|
* oleg.hoefling
|
||||||
|
* symonk
|
||||||
|
* ziebam
|
||||||
|
* Éloi Rivard
|
||||||
|
* Éric
|
||||||
|
|
||||||
|
|
||||||
|
Happy testing,
|
||||||
|
The pytest Development Team
|
|
@ -0,0 +1,74 @@
|
||||||
|
pytest-7.0.0rc1
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
The pytest team is proud to announce the 7.0.0rc1 prerelease!
|
||||||
|
|
||||||
|
This is a prerelease, not intended for production use, but to test the upcoming features and improvements
|
||||||
|
in order to catch any major problems before the final version is released to the major public.
|
||||||
|
|
||||||
|
We appreciate your help testing this out before the final release, making sure to report any
|
||||||
|
regressions to our issue tracker:
|
||||||
|
|
||||||
|
https://github.com/pytest-dev/pytest/issues
|
||||||
|
|
||||||
|
When doing so, please include the string ``[prerelease]`` in the title.
|
||||||
|
|
||||||
|
You can upgrade from PyPI via:
|
||||||
|
|
||||||
|
pip install pytest==7.0.0rc1
|
||||||
|
|
||||||
|
Users are encouraged to take a look at the CHANGELOG carefully:
|
||||||
|
|
||||||
|
https://docs.pytest.org/en/7.0.x/changelog.html
|
||||||
|
|
||||||
|
Thanks to all the contributors to this release:
|
||||||
|
|
||||||
|
* Adam J. Stewart
|
||||||
|
* Alexander King
|
||||||
|
* Amin Alaee
|
||||||
|
* Andrew Neitsch
|
||||||
|
* Anthony Sottile
|
||||||
|
* Ben Davies
|
||||||
|
* Bernát Gábor
|
||||||
|
* Brian Okken
|
||||||
|
* Bruno Oliveira
|
||||||
|
* Cristian Vera
|
||||||
|
* David Szotten
|
||||||
|
* Eddie
|
||||||
|
* Emmanuel Arias
|
||||||
|
* Emmanuel Meric de Bellefon
|
||||||
|
* Eric Liu
|
||||||
|
* Florian Bruhin
|
||||||
|
* GergelyKalmar
|
||||||
|
* Graeme Smecher
|
||||||
|
* Harshna
|
||||||
|
* Hugo van Kemenade
|
||||||
|
* Jakub Kulík
|
||||||
|
* James Myatt
|
||||||
|
* Jeff Rasley
|
||||||
|
* Kale Kundert
|
||||||
|
* Miro Hrončok
|
||||||
|
* Naveen-Pratap
|
||||||
|
* Oleg Höfling
|
||||||
|
* Ran Benita
|
||||||
|
* Ronny Pfannschmidt
|
||||||
|
* Simon K
|
||||||
|
* Srip
|
||||||
|
* Sören Wegener
|
||||||
|
* Taneli Hukkinen
|
||||||
|
* Terje Runde
|
||||||
|
* Thomas Grainger
|
||||||
|
* Thomas Hisch
|
||||||
|
* William Jamir Silva
|
||||||
|
* Zac Hatfield-Dodds
|
||||||
|
* andrewdotn
|
||||||
|
* denivyruck
|
||||||
|
* ericluoliu
|
||||||
|
* oleg.hoefling
|
||||||
|
* symonk
|
||||||
|
* ziebam
|
||||||
|
* Éloi Rivard
|
||||||
|
|
||||||
|
|
||||||
|
Happy testing,
|
||||||
|
The pytest Development Team
|
|
@ -0,0 +1,20 @@
|
||||||
|
pytest-7.0.1
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
pytest 7.0.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/stable/changelog.html.
|
||||||
|
|
||||||
|
Thanks to all of the contributors to this release:
|
||||||
|
|
||||||
|
* Anthony Sottile
|
||||||
|
* Bruno Oliveira
|
||||||
|
* Ran Benita
|
||||||
|
|
||||||
|
|
||||||
|
Happy testing,
|
||||||
|
The pytest Development Team
|
|
@ -0,0 +1,48 @@
|
||||||
|
pytest-7.1.0
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
The pytest team is proud to announce the 7.1.0 release!
|
||||||
|
|
||||||
|
This release contains new features, improvements, and bug fixes,
|
||||||
|
the full list of changes is available in the changelog:
|
||||||
|
|
||||||
|
https://docs.pytest.org/en/stable/changelog.html
|
||||||
|
|
||||||
|
For complete documentation, please visit:
|
||||||
|
|
||||||
|
https://docs.pytest.org/en/stable/
|
||||||
|
|
||||||
|
As usual, you can upgrade from PyPI via:
|
||||||
|
|
||||||
|
pip install -U pytest
|
||||||
|
|
||||||
|
Thanks to all of the contributors to this release:
|
||||||
|
|
||||||
|
* Akuli
|
||||||
|
* Andrew Svetlov
|
||||||
|
* Anthony Sottile
|
||||||
|
* Brett Holman
|
||||||
|
* Bruno Oliveira
|
||||||
|
* Chris NeJame
|
||||||
|
* Dan Alvizu
|
||||||
|
* Elijah DeLee
|
||||||
|
* Emmanuel Arias
|
||||||
|
* Fabian Egli
|
||||||
|
* Florian Bruhin
|
||||||
|
* Gabor Szabo
|
||||||
|
* Hasan Ramezani
|
||||||
|
* Hugo van Kemenade
|
||||||
|
* Kian Meng, Ang
|
||||||
|
* Kojo Idrissa
|
||||||
|
* Masaru Tsuchiyama
|
||||||
|
* Olga Matoula
|
||||||
|
* P. L. Lim
|
||||||
|
* Ran Benita
|
||||||
|
* Tobias Deiminger
|
||||||
|
* Yuval Shimon
|
||||||
|
* eduardo naufel schettino
|
||||||
|
* Éric
|
||||||
|
|
||||||
|
|
||||||
|
Happy testing,
|
||||||
|
The pytest Development Team
|
|
@ -0,0 +1,18 @@
|
||||||
|
pytest-7.1.1
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
pytest 7.1.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/stable/changelog.html.
|
||||||
|
|
||||||
|
Thanks to all of the contributors to this release:
|
||||||
|
|
||||||
|
* Ran Benita
|
||||||
|
|
||||||
|
|
||||||
|
Happy testing,
|
||||||
|
The pytest Development Team
|
|
@ -0,0 +1,23 @@
|
||||||
|
pytest-7.1.2
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
pytest 7.1.2 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/stable/changelog.html.
|
||||||
|
|
||||||
|
Thanks to all of the contributors to this release:
|
||||||
|
|
||||||
|
* Anthony Sottile
|
||||||
|
* Bruno Oliveira
|
||||||
|
* Hugo van Kemenade
|
||||||
|
* Kian Eliasi
|
||||||
|
* Ran Benita
|
||||||
|
* Zac Hatfield-Dodds
|
||||||
|
|
||||||
|
|
||||||
|
Happy testing,
|
||||||
|
The pytest Development Team
|
|
@ -0,0 +1,28 @@
|
||||||
|
pytest-7.1.3
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
pytest 7.1.3 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/stable/changelog.html.
|
||||||
|
|
||||||
|
Thanks to all of the contributors to this release:
|
||||||
|
|
||||||
|
* Anthony Sottile
|
||||||
|
* Bruno Oliveira
|
||||||
|
* Gergely Kalmár
|
||||||
|
* Nipunn Koorapati
|
||||||
|
* Pax
|
||||||
|
* Sviatoslav Sydorenko
|
||||||
|
* Tim Hoffmann
|
||||||
|
* Tony Narlock
|
||||||
|
* Wolfremium
|
||||||
|
* Zach OBrien
|
||||||
|
* aizpurua23a
|
||||||
|
|
||||||
|
|
||||||
|
Happy testing,
|
||||||
|
The pytest Development Team
|
|
@ -22,7 +22,9 @@ b) transitional: the old and new API don't conflict
|
||||||
|
|
||||||
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).
|
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.
|
A deprecated feature scheduled to be removed in major version X will use the warning class `PytestRemovedInXWarning` (a subclass of :class:`~pytest.PytestDeprecationwarning`).
|
||||||
|
|
||||||
|
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 `PytestRemovedInXWarning` (e.g. `PytestRemovedIn4Warning`) 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.
|
||||||
|
|
||||||
|
|
||||||
c) true breakage: should only be considered when normal transition is unreasonably unsustainable and would offset important development/features by years.
|
c) true breakage: should only be considered when normal transition is unreasonably unsustainable and would offset important development/features by years.
|
||||||
|
@ -30,15 +32,15 @@ c) true breakage: should only be considered when normal transition is unreasonab
|
||||||
|
|
||||||
Examples for such upcoming changes:
|
Examples for such upcoming changes:
|
||||||
|
|
||||||
* removal of ``pytest_runtest_protocol/nextitem`` - `#895`_
|
* removal of ``pytest_runtest_protocol/nextitem`` - :issue:`895`
|
||||||
* rearranging of the node tree to include ``FunctionDefinition``
|
* rearranging of the node tree to include ``FunctionDefinition``
|
||||||
* rearranging of ``SetupState`` `#895`_
|
* rearranging of ``SetupState`` :issue:`895`
|
||||||
|
|
||||||
True breakages must be announced first in an issue containing:
|
True breakages must be announced first in an issue containing:
|
||||||
|
|
||||||
* Detailed description of the change
|
* Detailed description of the change
|
||||||
* Rationale
|
* Rationale
|
||||||
* Expected impact on users and plugin authors (example in `#895`_)
|
* Expected impact on users and plugin authors (example in :issue:`895`)
|
||||||
|
|
||||||
After there's no hard *-1* on the issue it should be followed up by an initial proof-of-concept Pull Request.
|
After there's no hard *-1* on the issue it should be followed up by an initial proof-of-concept Pull Request.
|
||||||
|
|
||||||
|
@ -77,4 +79,16 @@ Features currently deprecated and removed in previous releases can be found in :
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||
.. _`#895`: https://github.com/pytest-dev/pytest/issues/895
|
Python version support
|
||||||
|
======================
|
||||||
|
|
||||||
|
Released pytest versions support all Python versions that are actively maintained at the time of the release:
|
||||||
|
|
||||||
|
============== ===================
|
||||||
|
pytest version min. Python version
|
||||||
|
============== ===================
|
||||||
|
7.1+ 3.7+
|
||||||
|
6.2 - 7.0 3.6+
|
||||||
|
5.0 - 6.1 3.5+
|
||||||
|
3.3 - 4.6 2.7, 3.4+
|
||||||
|
============== ===================
|
||||||
|
|
|
@ -16,8 +16,13 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
|
||||||
|
|
||||||
.. code-block:: pytest
|
.. code-block:: pytest
|
||||||
|
|
||||||
$ pytest -q --fixtures
|
$ pytest --fixtures -v
|
||||||
cache
|
=========================== test session starts ============================
|
||||||
|
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python
|
||||||
|
cachedir: .pytest_cache
|
||||||
|
rootdir: /home/sweet/project
|
||||||
|
collected 0 items
|
||||||
|
cache -- .../_pytest/cacheprovider.py:510
|
||||||
Return a cache object that can persist state between testing sessions.
|
Return a cache object that can persist state between testing sessions.
|
||||||
|
|
||||||
cache.get(key, default)
|
cache.get(key, default)
|
||||||
|
@ -28,40 +33,95 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
|
||||||
|
|
||||||
Values can be any object handled by the json stdlib module.
|
Values can be any object handled by the json stdlib module.
|
||||||
|
|
||||||
capsys
|
capsys -- .../_pytest/capture.py:878
|
||||||
Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``.
|
Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``.
|
||||||
|
|
||||||
The captured output is made available via ``capsys.readouterr()`` method
|
The captured output is made available via ``capsys.readouterr()`` method
|
||||||
calls, which return a ``(out, err)`` namedtuple.
|
calls, which return a ``(out, err)`` namedtuple.
|
||||||
``out`` and ``err`` will be ``text`` objects.
|
``out`` and ``err`` will be ``text`` objects.
|
||||||
|
|
||||||
capsysbinary
|
Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def test_output(capsys):
|
||||||
|
print("hello")
|
||||||
|
captured = capsys.readouterr()
|
||||||
|
assert captured.out == "hello\n"
|
||||||
|
|
||||||
|
capsysbinary -- .../_pytest/capture.py:906
|
||||||
Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``.
|
Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``.
|
||||||
|
|
||||||
The captured output is made available via ``capsysbinary.readouterr()``
|
The captured output is made available via ``capsysbinary.readouterr()``
|
||||||
method calls, which return a ``(out, err)`` namedtuple.
|
method calls, which return a ``(out, err)`` namedtuple.
|
||||||
``out`` and ``err`` will be ``bytes`` objects.
|
``out`` and ``err`` will be ``bytes`` objects.
|
||||||
|
|
||||||
capfd
|
Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def test_output(capsysbinary):
|
||||||
|
print("hello")
|
||||||
|
captured = capsysbinary.readouterr()
|
||||||
|
assert captured.out == b"hello\n"
|
||||||
|
|
||||||
|
capfd -- .../_pytest/capture.py:934
|
||||||
Enable text capturing of writes to file descriptors ``1`` and ``2``.
|
Enable text capturing of writes to file descriptors ``1`` and ``2``.
|
||||||
|
|
||||||
The captured output is made available via ``capfd.readouterr()`` method
|
The captured output is made available via ``capfd.readouterr()`` method
|
||||||
calls, which return a ``(out, err)`` namedtuple.
|
calls, which return a ``(out, err)`` namedtuple.
|
||||||
``out`` and ``err`` will be ``text`` objects.
|
``out`` and ``err`` will be ``text`` objects.
|
||||||
|
|
||||||
capfdbinary
|
Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def test_system_echo(capfd):
|
||||||
|
os.system('echo "hello"')
|
||||||
|
captured = capfd.readouterr()
|
||||||
|
assert captured.out == "hello\n"
|
||||||
|
|
||||||
|
capfdbinary -- .../_pytest/capture.py:962
|
||||||
Enable bytes capturing of writes to file descriptors ``1`` and ``2``.
|
Enable bytes capturing of writes to file descriptors ``1`` and ``2``.
|
||||||
|
|
||||||
The captured output is made available via ``capfd.readouterr()`` method
|
The captured output is made available via ``capfd.readouterr()`` method
|
||||||
calls, which return a ``(out, err)`` namedtuple.
|
calls, which return a ``(out, err)`` namedtuple.
|
||||||
``out`` and ``err`` will be ``byte`` objects.
|
``out`` and ``err`` will be ``byte`` objects.
|
||||||
|
|
||||||
doctest_namespace [session scope]
|
Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def test_system_echo(capfdbinary):
|
||||||
|
os.system('echo "hello"')
|
||||||
|
captured = capfdbinary.readouterr()
|
||||||
|
assert captured.out == b"hello\n"
|
||||||
|
|
||||||
|
doctest_namespace [session scope] -- .../_pytest/doctest.py:735
|
||||||
Fixture that returns a :py:class:`dict` that will be injected into the
|
Fixture that returns a :py:class:`dict` that will be injected into the
|
||||||
namespace of doctests.
|
namespace of doctests.
|
||||||
|
|
||||||
pytestconfig [session scope]
|
Usually this fixture is used in conjunction with another ``autouse`` fixture:
|
||||||
Session-scoped fixture that returns the :class:`_pytest.config.Config` object.
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def add_np(doctest_namespace):
|
||||||
|
doctest_namespace["np"] = numpy
|
||||||
|
|
||||||
|
For more details: :ref:`doctest_namespace`.
|
||||||
|
|
||||||
|
pytestconfig [session scope] -- .../_pytest/fixtures.py:1344
|
||||||
|
Session-scoped fixture that returns the session's :class:`pytest.Config`
|
||||||
|
object.
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
|
@ -69,7 +129,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
|
||||||
if pytestconfig.getoption("verbose") > 0:
|
if pytestconfig.getoption("verbose") > 0:
|
||||||
...
|
...
|
||||||
|
|
||||||
record_property
|
record_property -- .../_pytest/junitxml.py:282
|
||||||
Add extra properties to the calling test.
|
Add extra properties to the calling test.
|
||||||
|
|
||||||
User properties become part of the test report and are available to the
|
User properties become part of the test report and are available to the
|
||||||
|
@ -83,13 +143,13 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
|
||||||
def test_function(record_property):
|
def test_function(record_property):
|
||||||
record_property("example_key", 1)
|
record_property("example_key", 1)
|
||||||
|
|
||||||
record_xml_attribute
|
record_xml_attribute -- .../_pytest/junitxml.py:305
|
||||||
Add extra xml attributes to the tag for the calling test.
|
Add extra xml attributes to the tag for the calling test.
|
||||||
|
|
||||||
The fixture is callable with ``name, value``. The value is
|
The fixture is callable with ``name, value``. The value is
|
||||||
automatically XML-encoded.
|
automatically XML-encoded.
|
||||||
|
|
||||||
record_testsuite_property [session scope]
|
record_testsuite_property [session scope] -- .../_pytest/junitxml.py:343
|
||||||
Record a new ``<property>`` tag as child of the root ``<testsuite>``.
|
Record a new ``<property>`` tag as child of the root ``<testsuite>``.
|
||||||
|
|
||||||
This is suitable to writing global information regarding the entire test
|
This is suitable to writing global information regarding the entire test
|
||||||
|
@ -108,10 +168,32 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
Currently this fixture **does not work** with the
|
Currently this fixture **does not work** with the
|
||||||
`pytest-xdist <https://github.com/pytest-dev/pytest-xdist>`__ plugin. See issue
|
`pytest-xdist <https://github.com/pytest-dev/pytest-xdist>`__ plugin. See
|
||||||
`#7767 <https://github.com/pytest-dev/pytest/issues/7767>`__ for details.
|
:issue:`7767` for details.
|
||||||
|
|
||||||
caplog
|
tmpdir_factory [session scope] -- .../_pytest/legacypath.py:302
|
||||||
|
Return a :class:`pytest.TempdirFactory` instance for the test session.
|
||||||
|
|
||||||
|
tmpdir -- .../_pytest/legacypath.py:309
|
||||||
|
Return a temporary directory path object which is unique to each test
|
||||||
|
function invocation, created as a sub directory of the base temporary
|
||||||
|
directory.
|
||||||
|
|
||||||
|
By default, a new base temporary directory is created each test session,
|
||||||
|
and old bases are removed after 3 sessions, to aid in debugging. If
|
||||||
|
``--basetemp`` is used then it is cleared each session. See :ref:`base
|
||||||
|
temporary directory`.
|
||||||
|
|
||||||
|
The returned object is a `legacy_path`_ object.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
These days, it is preferred to use ``tmp_path``.
|
||||||
|
|
||||||
|
:ref:`About the tmpdir and tmpdir_factory fixtures<tmpdir and tmpdir_factory>`.
|
||||||
|
|
||||||
|
.. _legacy_path: https://py.readthedocs.io/en/latest/path.html
|
||||||
|
|
||||||
|
caplog -- .../_pytest/logging.py:487
|
||||||
Access and control log capturing.
|
Access and control log capturing.
|
||||||
|
|
||||||
Captured logs are available through the following properties/methods::
|
Captured logs are available through the following properties/methods::
|
||||||
|
@ -122,52 +204,40 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
|
||||||
* caplog.record_tuples -> list of (logger_name, level, message) tuples
|
* caplog.record_tuples -> list of (logger_name, level, message) tuples
|
||||||
* caplog.clear() -> clear captured records and formatted log output string
|
* caplog.clear() -> clear captured records and formatted log output string
|
||||||
|
|
||||||
monkeypatch
|
monkeypatch -- .../_pytest/monkeypatch.py:29
|
||||||
A convenient fixture for monkey-patching.
|
A convenient fixture for monkey-patching.
|
||||||
|
|
||||||
The fixture provides these methods to modify objects, dictionaries or
|
The fixture provides these methods to modify objects, dictionaries, or
|
||||||
os.environ::
|
:data:`os.environ`:
|
||||||
|
|
||||||
monkeypatch.setattr(obj, name, value, raising=True)
|
* :meth:`monkeypatch.setattr(obj, name, value, raising=True) <pytest.MonkeyPatch.setattr>`
|
||||||
monkeypatch.delattr(obj, name, raising=True)
|
* :meth:`monkeypatch.delattr(obj, name, raising=True) <pytest.MonkeyPatch.delattr>`
|
||||||
monkeypatch.setitem(mapping, name, value)
|
* :meth:`monkeypatch.setitem(mapping, name, value) <pytest.MonkeyPatch.setitem>`
|
||||||
monkeypatch.delitem(obj, name, raising=True)
|
* :meth:`monkeypatch.delitem(obj, name, raising=True) <pytest.MonkeyPatch.delitem>`
|
||||||
monkeypatch.setenv(name, value, prepend=False)
|
* :meth:`monkeypatch.setenv(name, value, prepend=None) <pytest.MonkeyPatch.setenv>`
|
||||||
monkeypatch.delenv(name, raising=True)
|
* :meth:`monkeypatch.delenv(name, raising=True) <pytest.MonkeyPatch.delenv>`
|
||||||
monkeypatch.syspath_prepend(path)
|
* :meth:`monkeypatch.syspath_prepend(path) <pytest.MonkeyPatch.syspath_prepend>`
|
||||||
monkeypatch.chdir(path)
|
* :meth:`monkeypatch.chdir(path) <pytest.MonkeyPatch.chdir>`
|
||||||
|
* :meth:`monkeypatch.context() <pytest.MonkeyPatch.context>`
|
||||||
|
|
||||||
All modifications will be undone after the requesting test function or
|
All modifications will be undone after the requesting test function or
|
||||||
fixture has finished. The ``raising`` parameter determines if a KeyError
|
fixture has finished. The ``raising`` parameter determines if a :class:`KeyError`
|
||||||
or AttributeError will be raised if the set/deletion operation has no target.
|
or :class:`AttributeError` will be raised if the set/deletion operation does not have the
|
||||||
|
specified target.
|
||||||
|
|
||||||
recwarn
|
To undo modifications done by the fixture in a contained scope,
|
||||||
|
use :meth:`context() <pytest.MonkeyPatch.context>`.
|
||||||
|
|
||||||
|
recwarn -- .../_pytest/recwarn.py:29
|
||||||
Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions.
|
Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions.
|
||||||
|
|
||||||
See http://docs.python.org/library/warnings.html for information
|
See https://docs.python.org/library/how-to/capture-warnings.html for information
|
||||||
on warning categories.
|
on warning categories.
|
||||||
|
|
||||||
tmpdir_factory [session scope]
|
tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:184
|
||||||
Return a :class:`pytest.TempdirFactory` instance for the test session.
|
|
||||||
|
|
||||||
tmp_path_factory [session scope]
|
|
||||||
Return a :class:`pytest.TempPathFactory` instance for the test session.
|
Return a :class:`pytest.TempPathFactory` instance for the test session.
|
||||||
|
|
||||||
tmpdir
|
tmp_path -- .../_pytest/tmpdir.py:199
|
||||||
Return a temporary directory path object which is unique to each test
|
|
||||||
function invocation, created as a sub directory of the base temporary
|
|
||||||
directory.
|
|
||||||
|
|
||||||
By default, a new base temporary directory is created each test session,
|
|
||||||
and old bases are removed after 3 sessions, to aid in debugging. If
|
|
||||||
``--basetemp`` is used then it is cleared each session. See :ref:`base
|
|
||||||
temporary directory`.
|
|
||||||
|
|
||||||
The returned object is a `py.path.local`_ path object.
|
|
||||||
|
|
||||||
.. _`py.path.local`: https://py.readthedocs.io/en/latest/path.html
|
|
||||||
|
|
||||||
tmp_path
|
|
||||||
Return a temporary directory path object which is unique to each test
|
Return a temporary directory path object which is unique to each test
|
||||||
function invocation, created as a sub directory of the base temporary
|
function invocation, created as a sub directory of the base temporary
|
||||||
directory.
|
directory.
|
||||||
|
@ -180,7 +250,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
|
||||||
The returned object is a :class:`pathlib.Path` object.
|
The returned object is a :class:`pathlib.Path` object.
|
||||||
|
|
||||||
|
|
||||||
no tests ran in 0.12s
|
========================== no tests ran in 0.12s ===========================
|
||||||
|
|
||||||
You can also interactively ask for help, e.g. by typing on the Python interactive prompt something like:
|
You can also interactively ask for help, e.g. by typing on the Python interactive prompt something like:
|
||||||
|
|
||||||
|
|
3960
doc/en/changelog.rst
|
@ -17,7 +17,9 @@
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
import ast
|
import ast
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
from textwrap import dedent
|
||||||
from typing import List
|
from typing import List
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
@ -36,8 +38,26 @@ release = ".".join(version.split(".")[:2])
|
||||||
|
|
||||||
autodoc_member_order = "bysource"
|
autodoc_member_order = "bysource"
|
||||||
autodoc_typehints = "description"
|
autodoc_typehints = "description"
|
||||||
|
autodoc_typehints_description_target = "documented"
|
||||||
todo_include_todos = 1
|
todo_include_todos = 1
|
||||||
|
|
||||||
|
latex_engine = "lualatex"
|
||||||
|
|
||||||
|
latex_elements = {
|
||||||
|
"preamble": dedent(
|
||||||
|
r"""
|
||||||
|
\directlua{
|
||||||
|
luaotfload.add_fallback("fallbacks", {
|
||||||
|
"Noto Serif CJK SC:style=Regular;",
|
||||||
|
"Symbola:Style=Regular;"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
\setmainfont{FreeSerif}[RawFeature={fallback=fallbacks}]
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# -- General configuration -----------------------------------------------------
|
# -- General configuration -----------------------------------------------------
|
||||||
|
|
||||||
# If your documentation needs a minimal Sphinx version, state it here.
|
# If your documentation needs a minimal Sphinx version, state it here.
|
||||||
|
@ -50,6 +70,7 @@ extensions = [
|
||||||
"pygments_pytest",
|
"pygments_pytest",
|
||||||
"sphinx.ext.autodoc",
|
"sphinx.ext.autodoc",
|
||||||
"sphinx.ext.autosummary",
|
"sphinx.ext.autosummary",
|
||||||
|
"sphinx.ext.extlinks",
|
||||||
"sphinx.ext.intersphinx",
|
"sphinx.ext.intersphinx",
|
||||||
"sphinx.ext.todo",
|
"sphinx.ext.todo",
|
||||||
"sphinx.ext.viewcode",
|
"sphinx.ext.viewcode",
|
||||||
|
@ -57,6 +78,13 @@ extensions = [
|
||||||
"sphinxcontrib_trio",
|
"sphinxcontrib_trio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Building PDF docs on readthedocs requires inkscape for svg to pdf
|
||||||
|
# conversion. The relevant plugin is not useful for normal HTML builds, but
|
||||||
|
# it still raises warnings and fails CI if inkscape is not available. So
|
||||||
|
# only use the plugin if inkscape is actually available.
|
||||||
|
if shutil.which("inkscape"):
|
||||||
|
extensions.append("sphinxcontrib.inkscapeconverter")
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ["_templates"]
|
templates_path = ["_templates"]
|
||||||
|
|
||||||
|
@ -71,7 +99,7 @@ master_doc = "contents"
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = "pytest"
|
project = "pytest"
|
||||||
copyright = "2015–2020, holger krekel and pytest-dev team"
|
copyright = "2015, holger krekel and pytest-dev team"
|
||||||
|
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
|
@ -123,7 +151,6 @@ pygments_style = "sphinx"
|
||||||
# A list of regular expressions that match URIs that should not be checked when
|
# A list of regular expressions that match URIs that should not be checked when
|
||||||
# doing a linkcheck.
|
# doing a linkcheck.
|
||||||
linkcheck_ignore = [
|
linkcheck_ignore = [
|
||||||
"https://github.com/numpy/numpy/blob/master/doc/release/1.16.0-notes.rst#new-deprecations",
|
|
||||||
"https://blogs.msdn.microsoft.com/bharry/2017/06/28/testing-in-a-cloud-delivery-cadence/",
|
"https://blogs.msdn.microsoft.com/bharry/2017/06/28/testing-in-a-cloud-delivery-cadence/",
|
||||||
"http://pythontesting.net/framework/pytest-introduction/",
|
"http://pythontesting.net/framework/pytest-introduction/",
|
||||||
r"https://github.com/pytest-dev/pytest/issues/\d+",
|
r"https://github.com/pytest-dev/pytest/issues/\d+",
|
||||||
|
@ -134,6 +161,16 @@ linkcheck_ignore = [
|
||||||
linkcheck_workers = 5
|
linkcheck_workers = 5
|
||||||
|
|
||||||
|
|
||||||
|
_repo = "https://github.com/pytest-dev/pytest"
|
||||||
|
extlinks = {
|
||||||
|
"bpo": ("https://bugs.python.org/issue%s", "bpo-%s"),
|
||||||
|
"pypi": ("https://pypi.org/project/%s/", "%s"),
|
||||||
|
"issue": (f"{_repo}/issues/%s", "issue #%s"),
|
||||||
|
"pull": (f"{_repo}/pull/%s", "pull request #%s"),
|
||||||
|
"user": ("https://github.com/%s", "@%s"),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTML output ---------------------------------------------------
|
# -- Options for HTML output ---------------------------------------------------
|
||||||
|
|
||||||
sys.path.append(os.path.abspath("_themes"))
|
sys.path.append(os.path.abspath("_themes"))
|
||||||
|
@ -211,7 +248,7 @@ html_sidebars = {
|
||||||
html_domain_indices = True
|
html_domain_indices = True
|
||||||
|
|
||||||
# If false, no index is generated.
|
# If false, no index is generated.
|
||||||
html_use_index = True
|
html_use_index = False
|
||||||
|
|
||||||
# If true, the index is split into individual pages for each letter.
|
# If true, the index is split into individual pages for each letter.
|
||||||
# html_split_index = False
|
# html_split_index = False
|
||||||
|
@ -252,7 +289,7 @@ latex_documents = [
|
||||||
"contents",
|
"contents",
|
||||||
"pytest.tex",
|
"pytest.tex",
|
||||||
"pytest Documentation",
|
"pytest Documentation",
|
||||||
"holger krekel, trainer and consultant, http://merlinux.eu",
|
"holger krekel, trainer and consultant, https://merlinux.eu/",
|
||||||
"manual",
|
"manual",
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
@ -284,7 +321,9 @@ latex_domain_indices = False
|
||||||
|
|
||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [("usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1)]
|
man_pages = [
|
||||||
|
("how-to/usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
# -- Options for Epub output ---------------------------------------------------
|
# -- Options for Epub output ---------------------------------------------------
|
||||||
|
@ -293,7 +332,7 @@ man_pages = [("usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"
|
||||||
epub_title = "pytest"
|
epub_title = "pytest"
|
||||||
epub_author = "holger krekel at merlinux eu"
|
epub_author = "holger krekel at merlinux eu"
|
||||||
epub_publisher = "holger krekel at merlinux eu"
|
epub_publisher = "holger krekel at merlinux eu"
|
||||||
epub_copyright = "2013-2020, holger krekel et alii"
|
epub_copyright = "2013, holger krekel et alii"
|
||||||
|
|
||||||
# The language of the text. It defaults to the language option
|
# The language of the text. It defaults to the language option
|
||||||
# or en if the language is not set.
|
# or en if the language is not set.
|
||||||
|
@ -346,10 +385,15 @@ texinfo_documents = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
# Example configuration for intersphinx: refer to the Python standard library.
|
|
||||||
intersphinx_mapping = {
|
intersphinx_mapping = {
|
||||||
"pluggy": ("https://pluggy.readthedocs.io/en/latest", None),
|
"pluggy": ("https://pluggy.readthedocs.io/en/stable", None),
|
||||||
"python": ("https://docs.python.org/3", None),
|
"python": ("https://docs.python.org/3", None),
|
||||||
|
"numpy": ("https://numpy.org/doc/stable", None),
|
||||||
|
"pip": ("https://pip.pypa.io/en/stable", None),
|
||||||
|
"tox": ("https://tox.wiki/en/stable", None),
|
||||||
|
"virtualenv": ("https://virtualenv.pypa.io/en/stable", None),
|
||||||
|
"setuptools": ("https://setuptools.pypa.io/en/stable", None),
|
||||||
|
"packaging": ("https://packaging.python.org/en/latest", None),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -377,8 +421,6 @@ def configure_logging(app: "sphinx.application.Sphinx") -> None:
|
||||||
|
|
||||||
|
|
||||||
def setup(app: "sphinx.application.Sphinx") -> None:
|
def setup(app: "sphinx.application.Sphinx") -> None:
|
||||||
# from sphinx.ext.autodoc import cut_lines
|
|
||||||
# app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))
|
|
||||||
app.add_crossref_type(
|
app.add_crossref_type(
|
||||||
"fixture",
|
"fixture",
|
||||||
"fixture",
|
"fixture",
|
||||||
|
@ -400,6 +442,13 @@ def setup(app: "sphinx.application.Sphinx") -> None:
|
||||||
indextemplate="pair: %s; global variable interpreted by pytest",
|
indextemplate="pair: %s; global variable interpreted by pytest",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
app.add_crossref_type(
|
||||||
|
directivename="hook",
|
||||||
|
rolename="hook",
|
||||||
|
objname="pytest hook",
|
||||||
|
indextemplate="pair: %s; hook",
|
||||||
|
)
|
||||||
|
|
||||||
configure_logging(app)
|
configure_logging(app)
|
||||||
|
|
||||||
# Make Sphinx mark classes with "final" when decorated with @final.
|
# Make Sphinx mark classes with "final" when decorated with @final.
|
||||||
|
@ -420,3 +469,7 @@ def setup(app: "sphinx.application.Sphinx") -> None:
|
||||||
)
|
)
|
||||||
|
|
||||||
sphinx.pycode.parser.VariableCommentPicker.is_final = patched_is_final
|
sphinx.pycode.parser.VariableCommentPicker.is_final = patched_is_final
|
||||||
|
|
||||||
|
# legacypath.py monkey-patches pytest.Testdir in. Import the file so
|
||||||
|
# that autodoc can discover references to it.
|
||||||
|
import _pytest.legacypath # noqa: F401
|
||||||
|
|
|
@ -7,21 +7,24 @@ Contact channels
|
||||||
|
|
||||||
- `pytest issue tracker`_ to report bugs or suggest features (for version
|
- `pytest issue tracker`_ to report bugs or suggest features (for version
|
||||||
2.0 and above).
|
2.0 and above).
|
||||||
|
- `pytest discussions`_ at github for general questions.
|
||||||
|
- `pytest discord server <https://discord.com/invite/pytest-dev>`_
|
||||||
|
for pytest development visibility and general assistance.
|
||||||
- `pytest on stackoverflow.com <http://stackoverflow.com/search?q=pytest>`_
|
- `pytest on stackoverflow.com <http://stackoverflow.com/search?q=pytest>`_
|
||||||
to post questions with the tag ``pytest``. New Questions will usually
|
to post precise questions with the tag ``pytest``. New Questions will usually
|
||||||
be seen by pytest users or developers and answered quickly.
|
be seen by pytest users or developers and answered quickly.
|
||||||
|
|
||||||
- `Testing In Python`_: a mailing list for Python testing tools and discussion.
|
- `Testing In Python`_: a mailing list for Python testing tools and discussion.
|
||||||
|
|
||||||
- `pytest-dev at python.org (mailing list)`_ pytest specific announcements and discussions.
|
- `pytest-dev at python.org (mailing list)`_ pytest specific announcements and discussions.
|
||||||
|
|
||||||
- `pytest-commit at python.org (mailing list)`_: for commits and new issues
|
|
||||||
|
|
||||||
- :doc:`contribution guide <contributing>` for help on submitting pull
|
- :doc:`contribution guide <contributing>` for help on submitting pull
|
||||||
requests to GitHub.
|
requests to GitHub.
|
||||||
|
|
||||||
- ``#pylib`` on irc.freenode.net IRC channel for random questions.
|
- ``#pytest`` `on irc.libera.chat <ircs://irc.libera.chat:6697/#pytest>`_ IRC
|
||||||
|
channel for random questions (using an IRC client, `via webchat
|
||||||
|
<https://web.libera.chat/#pytest>`_, or `via Matrix
|
||||||
|
<https://matrix.to/#/%23pytest:libera.chat>`_).
|
||||||
|
|
||||||
- private mail to Holger.Krekel at gmail com if you want to communicate sensitive issues
|
- private mail to Holger.Krekel at gmail com if you want to communicate sensitive issues
|
||||||
|
|
||||||
|
@ -30,19 +33,21 @@ Contact channels
|
||||||
consulting.
|
consulting.
|
||||||
|
|
||||||
.. _`pytest issue tracker`: https://github.com/pytest-dev/pytest/issues
|
.. _`pytest issue tracker`: https://github.com/pytest-dev/pytest/issues
|
||||||
.. _`old issue tracker`: http://bitbucket.org/hpk42/py-trunk/issues/
|
.. _`old issue tracker`: https://bitbucket.org/hpk42/py-trunk/issues/
|
||||||
|
|
||||||
.. _`merlinux.eu`: http://merlinux.eu
|
.. _`pytest discussions`: https://github.com/pytest-dev/pytest/discussions
|
||||||
|
|
||||||
|
.. _`merlinux.eu`: https://merlinux.eu/
|
||||||
|
|
||||||
.. _`get an account`:
|
.. _`get an account`:
|
||||||
|
|
||||||
.. _tetamap: http://tetamap.wordpress.com
|
.. _tetamap: https://tetamap.wordpress.com/
|
||||||
|
|
||||||
.. _`@pylibcommit`: http://twitter.com/pylibcommit
|
.. _`@pylibcommit`: https://twitter.com/pylibcommit
|
||||||
|
|
||||||
|
|
||||||
.. _`Testing in Python`: http://lists.idyll.org/listinfo/testing-in-python
|
.. _`Testing in Python`: http://lists.idyll.org/listinfo/testing-in-python
|
||||||
.. _FOAF: http://en.wikipedia.org/wiki/FOAF
|
.. _FOAF: https://en.wikipedia.org/wiki/FOAF
|
||||||
.. _`py-dev`:
|
.. _`py-dev`:
|
||||||
.. _`development mailing list`:
|
.. _`development mailing list`:
|
||||||
.. _`pytest-dev at python.org (mailing list)`: http://mail.python.org/mailman/listinfo/pytest-dev
|
.. _`pytest-dev at python.org (mailing list)`: http://mail.python.org/mailman/listinfo/pytest-dev
|
||||||
|
|
|
@ -28,7 +28,7 @@ How-to guides
|
||||||
how-to/fixtures
|
how-to/fixtures
|
||||||
how-to/mark
|
how-to/mark
|
||||||
how-to/parametrize
|
how-to/parametrize
|
||||||
how-to/tmpdir
|
how-to/tmp_path
|
||||||
how-to/monkeypatch
|
how-to/monkeypatch
|
||||||
how-to/doctest
|
how-to/doctest
|
||||||
how-to/cache
|
how-to/cache
|
||||||
|
@ -85,7 +85,6 @@ Further topics
|
||||||
|
|
||||||
backwards-compatibility
|
backwards-compatibility
|
||||||
deprecations
|
deprecations
|
||||||
py27-py34-deprecation
|
|
||||||
|
|
||||||
contributing
|
contributing
|
||||||
development_guide
|
development_guide
|
||||||
|
@ -95,9 +94,9 @@ Further topics
|
||||||
license
|
license
|
||||||
contact
|
contact
|
||||||
|
|
||||||
|
history
|
||||||
historical-notes
|
historical-notes
|
||||||
talks
|
talks
|
||||||
projects
|
|
||||||
|
|
||||||
|
|
||||||
.. only:: html
|
.. only:: html
|
||||||
|
|
|
@ -16,18 +16,262 @@ Deprecated Features
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
Below is a complete list of all pytest features which are considered deprecated. Using those features will issue
|
Below is a complete list of all pytest features which are considered deprecated. Using those features will issue
|
||||||
:class:`PytestWarning` or subclasses, which can be filtered using :ref:`standard warning filters <warnings>`.
|
:class:`~pytest.PytestWarning` or subclasses, which can be filtered using :ref:`standard warning filters <warnings>`.
|
||||||
|
|
||||||
|
.. _instance-collector-deprecation:
|
||||||
|
|
||||||
|
The ``pytest.Instance`` collector
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. versionremoved:: 7.0
|
||||||
|
|
||||||
|
The ``pytest.Instance`` collector type has been removed.
|
||||||
|
|
||||||
|
Previously, Python test methods were collected as :class:`~pytest.Class` -> ``Instance`` -> :class:`~pytest.Function`.
|
||||||
|
Now :class:`~pytest.Class` collects the test methods directly.
|
||||||
|
|
||||||
|
Most plugins which reference ``Instance`` do so in order to ignore or skip it,
|
||||||
|
using a check such as ``if isinstance(node, Instance): return``.
|
||||||
|
Such plugins should simply remove consideration of ``Instance`` on pytest>=7.
|
||||||
|
However, to keep such uses working, a dummy type has been instanted in ``pytest.Instance`` and ``_pytest.python.Instance``,
|
||||||
|
and importing it emits a deprecation warning. This will be removed in pytest 8.
|
||||||
|
|
||||||
|
|
||||||
``Node.fspath`` in favor of ``pathlib`` and ``Node.path``
|
.. _node-ctor-fspath-deprecation:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
.. deprecated:: 6.3
|
``fspath`` argument for Node constructors replaced with ``pathlib.Path``
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
As pytest tries to move off `py.path.local <https://py.readthedocs.io/en/latest/path.html>`__ we ported most of the node internals to :mod:`pathlib`.
|
.. deprecated:: 7.0
|
||||||
|
|
||||||
Pytest will provide compatibility for quite a while.
|
In order to support the transition from ``py.path.local`` to :mod:`pathlib`,
|
||||||
|
the ``fspath`` argument to :class:`~_pytest.nodes.Node` constructors like
|
||||||
|
:func:`pytest.Function.from_parent()` and :func:`pytest.Class.from_parent()`
|
||||||
|
is now deprecated.
|
||||||
|
|
||||||
|
Plugins which construct nodes should pass the ``path`` argument, of type
|
||||||
|
:class:`pathlib.Path`, instead of the ``fspath`` argument.
|
||||||
|
|
||||||
|
Plugins which implement custom items and collectors are encouraged to replace
|
||||||
|
``fspath`` parameters (``py.path.local``) with ``path`` parameters
|
||||||
|
(``pathlib.Path``), and drop any other usage of the ``py`` library if possible.
|
||||||
|
|
||||||
|
If possible, plugins with custom items should use :ref:`cooperative
|
||||||
|
constructors <uncooperative-constructors-deprecated>` to avoid hardcoding
|
||||||
|
arguments they only pass on to the superclass.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the
|
||||||
|
new attribute being ``path``) is **the opposite** of the situation for
|
||||||
|
hooks, :ref:`outlined below <legacy-path-hooks-deprecated>` (the old
|
||||||
|
argument being ``path``).
|
||||||
|
|
||||||
|
This is an unfortunate artifact due to historical reasons, which should be
|
||||||
|
resolved in future versions as we slowly get rid of the :pypi:`py`
|
||||||
|
dependency (see :issue:`9283` for a longer discussion).
|
||||||
|
|
||||||
|
Due to the ongoing migration of methods like :meth:`~_pytest.Item.reportinfo`
|
||||||
|
which still is expected to return a ``py.path.local`` object, nodes still have
|
||||||
|
both ``fspath`` (``py.path.local``) and ``path`` (``pathlib.Path``) attributes,
|
||||||
|
no matter what argument was used in the constructor. We expect to deprecate the
|
||||||
|
``fspath`` attribute in a future release.
|
||||||
|
|
||||||
|
.. _legacy-path-hooks-deprecated:
|
||||||
|
|
||||||
|
Configuring hook specs/impls using markers
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Before pluggy, pytest's plugin library, was its own package and had a clear API,
|
||||||
|
pytest just used ``pytest.mark`` to configure hooks.
|
||||||
|
|
||||||
|
The :py:func:`pytest.hookimpl` and :py:func:`pytest.hookspec` decorators
|
||||||
|
have been available since years and should be used instead.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
@pytest.mark.tryfirst
|
||||||
|
def pytest_runtest_call():
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
# or
|
||||||
|
def pytest_runtest_call():
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
pytest_runtest_call.tryfirst = True
|
||||||
|
|
||||||
|
should be changed to:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
@pytest.hookimpl(tryfirst=True)
|
||||||
|
def pytest_runtest_call():
|
||||||
|
...
|
||||||
|
|
||||||
|
Changed ``hookimpl`` attributes:
|
||||||
|
|
||||||
|
* ``tryfirst``
|
||||||
|
* ``trylast``
|
||||||
|
* ``optionalhook``
|
||||||
|
* ``hookwrapper``
|
||||||
|
|
||||||
|
Changed ``hookwrapper`` attributes:
|
||||||
|
|
||||||
|
* ``firstresult``
|
||||||
|
* ``historic``
|
||||||
|
|
||||||
|
|
||||||
|
``py.path.local`` arguments for hooks replaced with ``pathlib.Path``
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. deprecated:: 7.0
|
||||||
|
|
||||||
|
In order to support the transition from ``py.path.local`` to :mod:`pathlib`, the following hooks now receive additional arguments:
|
||||||
|
|
||||||
|
* :hook:`pytest_ignore_collect(collection_path: pathlib.Path) <pytest_ignore_collect>` as equivalent to ``path``
|
||||||
|
* :hook:`pytest_collect_file(file_path: pathlib.Path) <pytest_collect_file>` as equivalent to ``path``
|
||||||
|
* :hook:`pytest_pycollect_makemodule(module_path: pathlib.Path) <pytest_pycollect_makemodule>` as equivalent to ``path``
|
||||||
|
* :hook:`pytest_report_header(start_path: pathlib.Path) <pytest_report_header>` as equivalent to ``startdir``
|
||||||
|
* :hook:`pytest_report_collectionfinish(start_path: pathlib.Path) <pytest_report_collectionfinish>` as equivalent to ``startdir``
|
||||||
|
|
||||||
|
The accompanying ``py.path.local`` based paths have been deprecated: plugins which manually invoke those hooks should only pass the new ``pathlib.Path`` arguments, and users should change their hook implementations to use the new ``pathlib.Path`` arguments.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
The name of the :class:`~_pytest.nodes.Node` arguments and attributes,
|
||||||
|
:ref:`outlined above <node-ctor-fspath-deprecation>` (the new attribute
|
||||||
|
being ``path``) is **the opposite** of the situation for hooks (the old
|
||||||
|
argument being ``path``).
|
||||||
|
|
||||||
|
This is an unfortunate artifact due to historical reasons, which should be
|
||||||
|
resolved in future versions as we slowly get rid of the :pypi:`py`
|
||||||
|
dependency (see :issue:`9283` for a longer discussion).
|
||||||
|
|
||||||
|
Directly constructing internal classes
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. deprecated:: 7.0
|
||||||
|
|
||||||
|
Directly constructing the following classes is now deprecated:
|
||||||
|
|
||||||
|
- ``_pytest.mark.structures.Mark``
|
||||||
|
- ``_pytest.mark.structures.MarkDecorator``
|
||||||
|
- ``_pytest.mark.structures.MarkGenerator``
|
||||||
|
- ``_pytest.python.Metafunc``
|
||||||
|
- ``_pytest.runner.CallInfo``
|
||||||
|
- ``_pytest._code.ExceptionInfo``
|
||||||
|
- ``_pytest.config.argparsing.Parser``
|
||||||
|
- ``_pytest.config.argparsing.OptionGroup``
|
||||||
|
- ``_pytest.pytester.HookRecorder``
|
||||||
|
|
||||||
|
These constructors have always been considered private, but now issue a deprecation warning, which may become a hard error in pytest 8.
|
||||||
|
|
||||||
|
.. _cmdline-preparse-deprecated:
|
||||||
|
|
||||||
|
Passing ``msg=`` to ``pytest.skip``, ``pytest.fail`` or ``pytest.exit``
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. deprecated:: 7.0
|
||||||
|
|
||||||
|
Passing the keyword argument ``msg`` to :func:`pytest.skip`, :func:`pytest.fail` or :func:`pytest.exit`
|
||||||
|
is now deprecated and ``reason`` should be used instead. This change is to bring consistency between these
|
||||||
|
functions and the ``@pytest.mark.skip`` and ``@pytest.mark.xfail`` markers which already accept a ``reason`` argument.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def test_fail_example():
|
||||||
|
# old
|
||||||
|
pytest.fail(msg="foo")
|
||||||
|
# new
|
||||||
|
pytest.fail(reason="bar")
|
||||||
|
|
||||||
|
|
||||||
|
def test_skip_example():
|
||||||
|
# old
|
||||||
|
pytest.skip(msg="foo")
|
||||||
|
# new
|
||||||
|
pytest.skip(reason="bar")
|
||||||
|
|
||||||
|
|
||||||
|
def test_exit_example():
|
||||||
|
# old
|
||||||
|
pytest.exit(msg="foo")
|
||||||
|
# new
|
||||||
|
pytest.exit(reason="bar")
|
||||||
|
|
||||||
|
|
||||||
|
Implementing the ``pytest_cmdline_preparse`` hook
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. deprecated:: 7.0
|
||||||
|
|
||||||
|
Implementing the :hook:`pytest_cmdline_preparse` hook has been officially deprecated.
|
||||||
|
Implement the :hook:`pytest_load_initial_conftests` hook instead.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def pytest_cmdline_preparse(config: Config, args: List[str]) -> None:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
# becomes:
|
||||||
|
|
||||||
|
|
||||||
|
def pytest_load_initial_conftests(
|
||||||
|
early_config: Config, parser: Parser, args: List[str]
|
||||||
|
) -> None:
|
||||||
|
...
|
||||||
|
|
||||||
|
.. _diamond-inheritance-deprecated:
|
||||||
|
|
||||||
|
Diamond inheritance between :class:`pytest.Collector` and :class:`pytest.Item`
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. deprecated:: 7.0
|
||||||
|
|
||||||
|
Defining a custom pytest node type which is both an :class:`pytest.Item <Item>` and a :class:`pytest.Collector <Collector>` (e.g. :class:`pytest.File <File>`) now issues a warning.
|
||||||
|
It was never sanely supported and triggers hard to debug errors.
|
||||||
|
|
||||||
|
Some plugins providing linting/code analysis have been using this as a hack.
|
||||||
|
Instead, a separate collector node should be used, which collects the item. See
|
||||||
|
:ref:`non-python tests` for an example, as well as an `example pr fixing inheritance`_.
|
||||||
|
|
||||||
|
.. _example pr fixing inheritance: https://github.com/asmeurer/pytest-flakes/pull/40/files
|
||||||
|
|
||||||
|
|
||||||
|
.. _uncooperative-constructors-deprecated:
|
||||||
|
|
||||||
|
Constructors of custom :class:`pytest.Node` subclasses should take ``**kwargs``
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. deprecated:: 7.0
|
||||||
|
|
||||||
|
If custom subclasses of nodes like :class:`pytest.Item` override the
|
||||||
|
``__init__`` method, they should take ``**kwargs``. Thus,
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
class CustomItem(pytest.Item):
|
||||||
|
def __init__(self, name, parent, additional_arg):
|
||||||
|
super().__init__(name, parent)
|
||||||
|
self.additional_arg = additional_arg
|
||||||
|
|
||||||
|
should be turned into:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
class CustomItem(pytest.Item):
|
||||||
|
def __init__(self, *, additional_arg, **kwargs):
|
||||||
|
super().__init__(**kwargs)
|
||||||
|
self.additional_arg = additional_arg
|
||||||
|
|
||||||
|
to avoid hard-coding the arguments pytest can pass to the superclass.
|
||||||
|
See :ref:`non-python tests` for a full example.
|
||||||
|
|
||||||
|
For cases without conflicts, no deprecation warning is emitted. For cases with
|
||||||
|
conflicts (such as :class:`pytest.File` now taking ``path`` instead of
|
||||||
|
``fspath``, as :ref:`outlined above <node-ctor-fspath-deprecation>`), a
|
||||||
|
deprecation warning is now raised.
|
||||||
|
|
||||||
Applying a mark to a fixture function
|
Applying a mark to a fixture function
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
@ -42,25 +286,63 @@ Backward compatibilities in ``Parser.addoption``
|
||||||
|
|
||||||
.. deprecated:: 2.4
|
.. deprecated:: 2.4
|
||||||
|
|
||||||
Several behaviors of :meth:`Parser.addoption <_pytest.config.argparsing.Parser.addoption>` are now
|
Several behaviors of :meth:`Parser.addoption <pytest.Parser.addoption>` are now
|
||||||
scheduled for removal in pytest 7 (deprecated since pytest 2.4.0):
|
scheduled for removal in pytest 8 (deprecated since pytest 2.4.0):
|
||||||
|
|
||||||
- ``parser.addoption(..., help=".. %default ..")`` - use ``%(default)s`` instead.
|
- ``parser.addoption(..., help=".. %default ..")`` - use ``%(default)s`` instead.
|
||||||
- ``parser.addoption(..., type="int/string/float/complex")`` - use ``type=int`` etc. instead.
|
- ``parser.addoption(..., type="int/string/float/complex")`` - use ``type=int`` etc. instead.
|
||||||
|
|
||||||
|
|
||||||
Raising ``unittest.SkipTest`` during collection
|
Using ``pytest.warns(None)``
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. deprecated:: 6.3
|
.. deprecated:: 7.0
|
||||||
|
|
||||||
Raising :class:`unittest.SkipTest` to skip collection of tests during the
|
:func:`pytest.warns(None) <pytest.warns>` is now deprecated because it was frequently misused.
|
||||||
pytest collection phase is deprecated. Use :func:`pytest.skip` instead.
|
Its correct usage was checking that the code emits at least one warning of any type - like ``pytest.warns()``
|
||||||
|
or ``pytest.warns(Warning)``.
|
||||||
|
|
||||||
Note: This deprecation only relates to using `unittest.SkipTest` during test
|
See :ref:`warns use cases` for examples.
|
||||||
collection. You are probably not doing that. Ordinary usage of
|
|
||||||
:class:`unittest.SkipTest` / :meth:`unittest.TestCase.skipTest` /
|
|
||||||
:func:`unittest.skip` in unittest test cases is fully supported.
|
Returning non-None value in test functions
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. deprecated:: 7.2
|
||||||
|
|
||||||
|
A :class:`pytest.PytestReturnNotNoneWarning` is now emitted if a test function returns something other than `None`.
|
||||||
|
|
||||||
|
This prevents a common mistake among beginners that expect that returning a `bool` would cause a test to pass or fail, for example:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
["a", "b", "result"],
|
||||||
|
[
|
||||||
|
[1, 2, 5],
|
||||||
|
[2, 3, 8],
|
||||||
|
[5, 3, 18],
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_foo(a, b, result):
|
||||||
|
return foo(a, b) == result
|
||||||
|
|
||||||
|
Given that pytest ignores the return value, this might be surprising that it will never fail.
|
||||||
|
|
||||||
|
The proper fix is to change the `return` to an `assert`:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
["a", "b", "result"],
|
||||||
|
[
|
||||||
|
[1, 2, 5],
|
||||||
|
[2, 3, 8],
|
||||||
|
[5, 3, 18],
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_foo(a, b, result):
|
||||||
|
assert foo(a, b) == result
|
||||||
|
|
||||||
|
|
||||||
The ``--strict`` command-line option
|
The ``--strict`` command-line option
|
||||||
|
@ -86,29 +368,42 @@ The ``yield_fixture`` function/decorator
|
||||||
It has been so for a very long time, so can be search/replaced safely.
|
It has been so for a very long time, so can be search/replaced safely.
|
||||||
|
|
||||||
|
|
||||||
The ``pytest_warning_captured`` hook
|
Removed Features
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
----------------
|
||||||
|
|
||||||
.. deprecated:: 6.0
|
As stated in our :ref:`backwards-compatibility` policy, deprecated features are removed only in major releases after
|
||||||
|
an appropriate period of deprecation has passed.
|
||||||
|
|
||||||
This hook has an `item` parameter which cannot be serialized by ``pytest-xdist``.
|
|
||||||
|
|
||||||
Use the ``pytest_warning_recored`` hook instead, which replaces the ``item`` parameter
|
|
||||||
by a ``nodeid`` parameter.
|
|
||||||
|
|
||||||
The ``pytest.collect`` module
|
The ``pytest.collect`` module
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. deprecated:: 6.0
|
.. deprecated:: 6.0
|
||||||
|
.. versionremoved:: 7.0
|
||||||
|
|
||||||
The ``pytest.collect`` module is no longer part of the public API, all its names
|
The ``pytest.collect`` module is no longer part of the public API, all its names
|
||||||
should now be imported from ``pytest`` directly instead.
|
should now be imported from ``pytest`` directly instead.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The ``pytest_warning_captured`` hook
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. deprecated:: 6.0
|
||||||
|
.. versionremoved:: 7.0
|
||||||
|
|
||||||
|
This hook has an `item` parameter which cannot be serialized by ``pytest-xdist``.
|
||||||
|
|
||||||
|
Use the ``pytest_warning_recorded`` hook instead, which replaces the ``item`` parameter
|
||||||
|
by a ``nodeid`` parameter.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
The ``pytest._fillfuncargs`` function
|
The ``pytest._fillfuncargs`` function
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. deprecated:: 6.0
|
.. deprecated:: 6.0
|
||||||
|
.. versionremoved:: 7.0
|
||||||
|
|
||||||
This function was kept for backward compatibility with an older plugin.
|
This function was kept for backward compatibility with an older plugin.
|
||||||
|
|
||||||
|
@ -117,12 +412,6 @@ it, use `function._request._fillfixtures()` instead, though note this is not
|
||||||
a public API and may break in the future.
|
a public API and may break in the future.
|
||||||
|
|
||||||
|
|
||||||
Removed Features
|
|
||||||
----------------
|
|
||||||
|
|
||||||
As stated in our :ref:`backwards-compatibility` policy, deprecated features are removed only in major releases after
|
|
||||||
an appropriate period of deprecation has passed.
|
|
||||||
|
|
||||||
``--no-print-logs`` command-line option
|
``--no-print-logs`` command-line option
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -137,6 +426,7 @@ A ``--show-capture`` command-line option was added in ``pytest 3.5.0`` which all
|
||||||
display captured output when tests fail: ``no``, ``stdout``, ``stderr``, ``log`` or ``all`` (the default).
|
display captured output when tests fail: ``no``, ``stdout``, ``stderr``, ``log`` or ``all`` (the default).
|
||||||
|
|
||||||
|
|
||||||
|
.. _resultlog deprecated:
|
||||||
|
|
||||||
Result log (``--result-log``)
|
Result log (``--result-log``)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -159,8 +449,8 @@ at some point, depending on the plans for the plugins and number of users using
|
||||||
|
|
||||||
.. versionremoved:: 6.0
|
.. versionremoved:: 6.0
|
||||||
|
|
||||||
The ``pytest_collect_directory`` has not worked properly for years (it was called
|
The ``pytest_collect_directory`` hook has not worked properly for years (it was called
|
||||||
but the results were ignored). Users may consider using :func:`pytest_collection_modifyitems <_pytest.hookspec.pytest_collection_modifyitems>` instead.
|
but the results were ignored). Users may consider using :hook:`pytest_collection_modifyitems` instead.
|
||||||
|
|
||||||
TerminalReporter.writer
|
TerminalReporter.writer
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -174,6 +464,8 @@ with ``py.io.TerminalWriter``.
|
||||||
Plugins that used ``TerminalReporter.writer`` directly should instead use ``TerminalReporter``
|
Plugins that used ``TerminalReporter.writer`` directly should instead use ``TerminalReporter``
|
||||||
methods that provide the same functionality.
|
methods that provide the same functionality.
|
||||||
|
|
||||||
|
.. _junit-family changed default value:
|
||||||
|
|
||||||
``junit_family`` default value change to "xunit2"
|
``junit_family`` default value change to "xunit2"
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -261,6 +553,8 @@ in places where we or plugin authors must distinguish between fixture names and
|
||||||
names supplied by non-fixture things such as ``pytest.mark.parametrize``.
|
names supplied by non-fixture things such as ``pytest.mark.parametrize``.
|
||||||
|
|
||||||
|
|
||||||
|
.. _pytest.config global deprecated:
|
||||||
|
|
||||||
``pytest.config`` global
|
``pytest.config`` global
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -305,7 +599,7 @@ Becomes:
|
||||||
|
|
||||||
|
|
||||||
If you still have concerns about this deprecation and future removal, please comment on
|
If you still have concerns about this deprecation and future removal, please comment on
|
||||||
`issue #3974 <https://github.com/pytest-dev/pytest/issues/3974>`__.
|
:issue:`3974`.
|
||||||
|
|
||||||
|
|
||||||
.. _raises-warns-exec:
|
.. _raises-warns-exec:
|
||||||
|
@ -358,6 +652,8 @@ This issue should affect only advanced plugins who create new collection types,
|
||||||
message please contact the authors so they can change the code.
|
message please contact the authors so they can change the code.
|
||||||
|
|
||||||
|
|
||||||
|
.. _marks in pytest.parametrize deprecated:
|
||||||
|
|
||||||
marks in ``pytest.mark.parametrize``
|
marks in ``pytest.mark.parametrize``
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -406,6 +702,8 @@ To update the code, use ``pytest.param``:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
|
.. _pytest_funcarg__ prefix deprecated:
|
||||||
|
|
||||||
``pytest_funcarg__`` prefix
|
``pytest_funcarg__`` prefix
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -437,6 +735,8 @@ Switch over to the ``@pytest.fixture`` decorator:
|
||||||
to avoid conflicts with other distutils commands.
|
to avoid conflicts with other distutils commands.
|
||||||
|
|
||||||
|
|
||||||
|
.. _metafunc.addcall deprecated:
|
||||||
|
|
||||||
Metafunc.addcall
|
Metafunc.addcall
|
||||||
~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -461,6 +761,8 @@ Becomes:
|
||||||
metafunc.parametrize("i", [1, 2], ids=["1", "2"])
|
metafunc.parametrize("i", [1, 2], ids=["1", "2"])
|
||||||
|
|
||||||
|
|
||||||
|
.. _cached_setup deprecated:
|
||||||
|
|
||||||
``cached_setup``
|
``cached_setup``
|
||||||
~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -489,10 +791,12 @@ This should be updated to make use of standard fixture mechanisms:
|
||||||
session.close()
|
session.close()
|
||||||
|
|
||||||
|
|
||||||
You can consult `funcarg comparison section in the docs <https://docs.pytest.org/en/stable/funcarg_compare.html>`_ for
|
You can consult :std:doc:`funcarg comparison section in the docs <funcarg_compare>` for
|
||||||
more information.
|
more information.
|
||||||
|
|
||||||
|
|
||||||
|
.. _pytest_plugins in non-top-level conftest files deprecated:
|
||||||
|
|
||||||
pytest_plugins in non-top-level conftest files
|
pytest_plugins in non-top-level conftest files
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -503,6 +807,8 @@ files because they will activate referenced plugins *globally*, which is surpris
|
||||||
features ``conftest.py`` files are only *active* for tests at or below it.
|
features ``conftest.py`` files are only *active* for tests at or below it.
|
||||||
|
|
||||||
|
|
||||||
|
.. _config.warn and node.warn deprecated:
|
||||||
|
|
||||||
``Config.warn`` and ``Node.warn``
|
``Config.warn`` and ``Node.warn``
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -530,6 +836,8 @@ Becomes:
|
||||||
|
|
||||||
* ``node.warn("CI", "some message")``: this code/message form has been **removed** and should be converted to the warning instance form above.
|
* ``node.warn("CI", "some message")``: this code/message form has been **removed** and should be converted to the warning instance form above.
|
||||||
|
|
||||||
|
.. _record_xml_property deprecated:
|
||||||
|
|
||||||
record_xml_property
|
record_xml_property
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -553,6 +861,8 @@ Change to:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
|
.. _passing command-line string to pytest.main deprecated:
|
||||||
|
|
||||||
Passing command-line string to ``pytest.main()``
|
Passing command-line string to ``pytest.main()``
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -575,6 +885,8 @@ By passing a string, users expect that pytest will interpret that command-line u
|
||||||
on (for example ``bash`` or ``Powershell``), but this is very hard/impossible to do in a portable way.
|
on (for example ``bash`` or ``Powershell``), but this is very hard/impossible to do in a portable way.
|
||||||
|
|
||||||
|
|
||||||
|
.. _calling fixtures directly deprecated:
|
||||||
|
|
||||||
Calling fixtures directly
|
Calling fixtures directly
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -628,6 +940,8 @@ with the ``name`` parameter:
|
||||||
return cell()
|
return cell()
|
||||||
|
|
||||||
|
|
||||||
|
.. _yield tests deprecated:
|
||||||
|
|
||||||
``yield`` tests
|
``yield`` tests
|
||||||
~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -656,6 +970,8 @@ This form of test function doesn't support fixtures properly, and users should s
|
||||||
def test_squared(x, y):
|
def test_squared(x, y):
|
||||||
assert x ** x == y
|
assert x ** x == y
|
||||||
|
|
||||||
|
.. _internal classes accessed through node deprecated:
|
||||||
|
|
||||||
Internal classes accessed through ``Node``
|
Internal classes accessed through ``Node``
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -690,6 +1006,8 @@ As part of a large :ref:`marker-revamp` we already deprecated using ``MarkInfo``
|
||||||
the only correct way to get markers of an element is via ``node.iter_markers(name)``.
|
the only correct way to get markers of an element is via ``node.iter_markers(name)``.
|
||||||
|
|
||||||
|
|
||||||
|
.. _pytest.namespace deprecated:
|
||||||
|
|
||||||
``pytest_namespace``
|
``pytest_namespace``
|
||||||
~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ example: specifying and selecting acceptance tests
|
||||||
self.tmpdir = request.config.mktemp(request.function.__name__, numbered=True)
|
self.tmpdir = request.config.mktemp(request.function.__name__, numbered=True)
|
||||||
|
|
||||||
def run(self, *cmd):
|
def run(self, *cmd):
|
||||||
""" called by test code to execute an acceptance test. """
|
"""called by test code to execute an acceptance test."""
|
||||||
self.tmpdir.chdir()
|
self.tmpdir.chdir()
|
||||||
return subprocess.check_output(cmd).decode()
|
return subprocess.check_output(cmd).decode()
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="572" height="542">
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="572" height="542">
|
||||||
<style>
|
<style>
|
||||||
text {
|
text {
|
||||||
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
<path d="M 26,271 A 260 260 0 0 1 546 271" id="testp"/>
|
<path d="M 26,271 A 260 260 0 0 1 546 271" id="testp"/>
|
||||||
</defs>
|
</defs>
|
||||||
<text class="package">
|
<text class="package">
|
||||||
<textPath href="#testp" startOffset="50%">tests</textPath>
|
<textPath xlink:href="#testp" startOffset="50%">tests</textPath>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<!-- subpackage -->
|
<!-- subpackage -->
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
<path d="M 56,271 A 130 130 0 0 1 316 271" id="subpackage"/>
|
<path d="M 56,271 A 130 130 0 0 1 316 271" id="subpackage"/>
|
||||||
</defs>
|
</defs>
|
||||||
<text class="package">
|
<text class="package">
|
||||||
<textPath href="#subpackage" startOffset="50%">subpackage</textPath>
|
<textPath xlink:href="#subpackage" startOffset="50%">subpackage</textPath>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<!-- test_subpackage.py -->
|
<!-- test_subpackage.py -->
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
<path d="M 106,311 A 80 80 0 0 1 266 311" id="testSubpackage"/>
|
<path d="M 106,311 A 80 80 0 0 1 266 311" id="testSubpackage"/>
|
||||||
</defs>
|
</defs>
|
||||||
<text class="module">
|
<text class="module">
|
||||||
<textPath href="#testSubpackage" startOffset="50%">test_subpackage.py</textPath>
|
<textPath xlink:href="#testSubpackage" startOffset="50%">test_subpackage.py</textPath>
|
||||||
</text>
|
</text>
|
||||||
<!-- innermost -->
|
<!-- innermost -->
|
||||||
<line x1="186" x2="186" y1="271" y2="351"/>
|
<line x1="186" x2="186" y1="271" y2="351"/>
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
<path d="M 366,271 A 75 75 0 0 1 516 271" id="testTop"/>
|
<path d="M 366,271 A 75 75 0 0 1 516 271" id="testTop"/>
|
||||||
</defs>
|
</defs>
|
||||||
<text class="module">
|
<text class="module">
|
||||||
<textPath href="#testTop" startOffset="50%">test_top.py</textPath>
|
<textPath xlink:href="#testTop" startOffset="50%">test_top.py</textPath>
|
||||||
</text>
|
</text>
|
||||||
<!-- innermost -->
|
<!-- innermost -->
|
||||||
<line x1="441" x2="441" y1="306" y2="236"/>
|
<line x1="441" x2="441" y1="306" y2="236"/>
|
||||||
|
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 5.0 KiB |
|
@ -1,4 +1,4 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="587" height="382">
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="587" height="382">
|
||||||
<style>
|
<style>
|
||||||
text {
|
text {
|
||||||
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
<path d="M 411,86 A 75 75 0 0 1 561 86" id="pluginA"/>
|
<path d="M 411,86 A 75 75 0 0 1 561 86" id="pluginA"/>
|
||||||
</defs>
|
</defs>
|
||||||
<text class="plugin">
|
<text class="plugin">
|
||||||
<textPath href="#pluginA" startOffset="50%">plugin_a</textPath>
|
<textPath xlink:href="#pluginA" startOffset="50%">plugin_a</textPath>
|
||||||
</text>
|
</text>
|
||||||
<!-- scope order number -->
|
<!-- scope order number -->
|
||||||
<mask id="pluginAOrderMask">
|
<mask id="pluginAOrderMask">
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
<path d="M 411,296 A 75 75 0 0 1 561 296" id="pluginB"/>
|
<path d="M 411,296 A 75 75 0 0 1 561 296" id="pluginB"/>
|
||||||
</defs>
|
</defs>
|
||||||
<text class="plugin">
|
<text class="plugin">
|
||||||
<textPath href="#pluginB" startOffset="50%">plugin_b</textPath>
|
<textPath xlink:href="#pluginB" startOffset="50%">plugin_b</textPath>
|
||||||
</text>
|
</text>
|
||||||
<!-- scope order number -->
|
<!-- scope order number -->
|
||||||
<mask id="pluginBOrderMask">
|
<mask id="pluginBOrderMask">
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
<path d="M 11,191 A 180 180 0 0 1 371 191" id="testp"/>
|
<path d="M 11,191 A 180 180 0 0 1 371 191" id="testp"/>
|
||||||
</defs>
|
</defs>
|
||||||
<text class="package">
|
<text class="package">
|
||||||
<textPath href="#testp" startOffset="50%">tests</textPath>
|
<textPath xlink:href="#testp" startOffset="50%">tests</textPath>
|
||||||
</text>
|
</text>
|
||||||
<!-- scope order number -->
|
<!-- scope order number -->
|
||||||
<mask id="mainOrderMask">
|
<mask id="mainOrderMask">
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
<path d="M 61,231 A 130 130 0 0 1 321 231" id="subpackage"/>
|
<path d="M 61,231 A 130 130 0 0 1 321 231" id="subpackage"/>
|
||||||
</defs>
|
</defs>
|
||||||
<text class="package">
|
<text class="package">
|
||||||
<textPath href="#subpackage" startOffset="50%">subpackage</textPath>
|
<textPath xlink:href="#subpackage" startOffset="50%">subpackage</textPath>
|
||||||
</text>
|
</text>
|
||||||
<!-- scope order number -->
|
<!-- scope order number -->
|
||||||
<mask id="subpackageOrderMask">
|
<mask id="subpackageOrderMask">
|
||||||
|
@ -106,7 +106,7 @@
|
||||||
<path d="M 111,271 A 80 80 0 0 1 271 271" id="testSubpackage"/>
|
<path d="M 111,271 A 80 80 0 0 1 271 271" id="testSubpackage"/>
|
||||||
</defs>
|
</defs>
|
||||||
<text class="module">
|
<text class="module">
|
||||||
<textPath href="#testSubpackage" startOffset="50%">test_subpackage.py</textPath>
|
<textPath xlink:href="#testSubpackage" startOffset="50%">test_subpackage.py</textPath>
|
||||||
</text>
|
</text>
|
||||||
<!-- scope order number -->
|
<!-- scope order number -->
|
||||||
<mask id="testSubpackageOrderMask">
|
<mask id="testSubpackageOrderMask">
|
||||||
|
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.4 KiB |
|
@ -0,0 +1,56 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="112" height="682">
|
||||||
|
<style>
|
||||||
|
text {
|
||||||
|
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
||||||
|
dominant-baseline: middle;
|
||||||
|
text-anchor: middle;
|
||||||
|
fill: #062886;
|
||||||
|
font-size: medium;
|
||||||
|
}
|
||||||
|
ellipse.fixture, rect.test {
|
||||||
|
fill: #eeffcc;
|
||||||
|
stroke: #007020;
|
||||||
|
stroke-width: 2;
|
||||||
|
}
|
||||||
|
text.fixture {
|
||||||
|
color: #06287e;
|
||||||
|
}
|
||||||
|
circle.class {
|
||||||
|
fill: #c3e0ec;
|
||||||
|
stroke: #0e84b5;
|
||||||
|
stroke-width: 2;
|
||||||
|
}
|
||||||
|
text.class {
|
||||||
|
fill: #0e84b5;
|
||||||
|
}
|
||||||
|
path, line {
|
||||||
|
stroke: black;
|
||||||
|
stroke-width: 2;
|
||||||
|
fill: none;
|
||||||
|
}
|
||||||
|
rect.autouse {
|
||||||
|
fill: #ca7f3d;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<line x1="56" x2="56" y1="681" y2="26" />
|
||||||
|
<ellipse class="fixture" rx="50" ry="25" cx="56" cy="26" />
|
||||||
|
<text x="56" y="26">order</text>
|
||||||
|
<ellipse class="fixture" rx="25" ry="25" cx="56" cy="96" />
|
||||||
|
<text x="56" y="96">a</text>
|
||||||
|
<ellipse class="fixture" rx="25" ry="25" cx="56" cy="166" />
|
||||||
|
<text x="56" y="166">b</text>
|
||||||
|
<ellipse class="fixture" rx="25" ry="25" cx="56" cy="236" />
|
||||||
|
<text x="56" y="236">c</text>
|
||||||
|
<rect class="autouse" width="112" height="40" x="0" y="286" />
|
||||||
|
<text x="56" y="306">autouse</text>
|
||||||
|
<ellipse class="fixture" rx="25" ry="25" cx="56" cy="376" />
|
||||||
|
<text x="56" y="376">d</text>
|
||||||
|
<ellipse class="fixture" rx="25" ry="25" cx="56" cy="446" />
|
||||||
|
<text x="56" y="446">e</text>
|
||||||
|
<ellipse class="fixture" rx="25" ry="25" cx="56" cy="516" />
|
||||||
|
<text x="56" y="516">f</text>
|
||||||
|
<ellipse class="fixture" rx="25" ry="25" cx="56" cy="586" />
|
||||||
|
<text x="56" y="586">g</text>
|
||||||
|
<rect class="test" width="110" height="50" x="1" y="631" />
|
||||||
|
<text x="56" y="656">test_order</text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
|
@ -1,4 +1,4 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="862" height="402">
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="862" height="402">
|
||||||
<style>
|
<style>
|
||||||
text {
|
text {
|
||||||
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
<path d="M31,201 A 190 190 0 0 1 411 201" id="testClassWith"/>
|
<path d="M31,201 A 190 190 0 0 1 411 201" id="testClassWith"/>
|
||||||
</defs>
|
</defs>
|
||||||
<text class="class">
|
<text class="class">
|
||||||
<textPath href="#testClassWith" startOffset="50%">TestWithC1Request</textPath>
|
<textPath xlink:href="#testClassWith" startOffset="50%">TestWithC1Request</textPath>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<!-- TestWithoutC1Request -->
|
<!-- TestWithoutC1Request -->
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
<path d="M451,201 A 190 190 0 0 1 831 201" id="testClassWithout"/>
|
<path d="M451,201 A 190 190 0 0 1 831 201" id="testClassWithout"/>
|
||||||
</defs>
|
</defs>
|
||||||
<text class="class">
|
<text class="class">
|
||||||
<textPath href="#testClassWithout" startOffset="50%">TestWithoutC1Request</textPath>
|
<textPath xlink:href="#testClassWithout" startOffset="50%">TestWithoutC1Request</textPath>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<rect class="autouse" width="862" height="40" x="1" y="181" />
|
<rect class="autouse" width="862" height="40" x="1" y="181" />
|
||||||
|
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |