Compare commits
1 Commits
update-plu
...
update-plu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97eb0c0c9c |
6
.github/dependabot.yml
vendored
6
.github/dependabot.yml
vendored
@@ -9,9 +9,3 @@ updates:
|
|||||||
allow:
|
allow:
|
||||||
- dependency-type: direct
|
- dependency-type: direct
|
||||||
- dependency-type: indirect
|
- dependency-type: indirect
|
||||||
- package-ecosystem: github-actions
|
|
||||||
directory: /
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
time: "03:00"
|
|
||||||
open-pull-requests-limit: 10
|
|
||||||
|
|||||||
51
.github/workflows/backport.yml
vendored
51
.github/workflows/backport.yml
vendored
@@ -1,51 +0,0 @@
|
|||||||
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@v3
|
|
||||||
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 }}
|
|
||||||
55
.github/workflows/deploy.yml
vendored
55
.github/workflows/deploy.yml
vendored
@@ -1,55 +0,0 @@
|
|||||||
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@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
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@release/v1
|
|
||||||
with:
|
|
||||||
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
|
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
name: test
|
name: main
|
||||||
|
|
||||||
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]+"
|
||||||
@@ -24,7 +23,7 @@ permissions: {}
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 45
|
timeout-minutes: 30
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
@@ -32,26 +31,24 @@ jobs:
|
|||||||
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-py39",
|
||||||
"windows-py310",
|
"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-py310",
|
||||||
"ubuntu-py311",
|
|
||||||
"ubuntu-pypy3",
|
"ubuntu-pypy3",
|
||||||
|
|
||||||
"macos-py37",
|
"macos-py37",
|
||||||
"macos-py38",
|
"macos-py38",
|
||||||
"macos-py39",
|
|
||||||
"macos-py310",
|
|
||||||
|
|
||||||
"docs",
|
"docs",
|
||||||
"doctesting",
|
"doctesting",
|
||||||
@@ -59,6 +56,10 @@ 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
|
||||||
@@ -66,7 +67,7 @@ jobs:
|
|||||||
- name: "windows-py37-pluggy"
|
- name: "windows-py37-pluggy"
|
||||||
python: "3.7"
|
python: "3.7"
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
tox_env: "py37-pluggymain-pylib-xdist"
|
tox_env: "py37-pluggymain-xdist"
|
||||||
- name: "windows-py38"
|
- name: "windows-py38"
|
||||||
python: "3.8"
|
python: "3.8"
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
@@ -77,14 +78,14 @@ jobs:
|
|||||||
os: windows-latest
|
os: windows-latest
|
||||||
tox_env: "py39-xdist"
|
tox_env: "py39-xdist"
|
||||||
- name: "windows-py310"
|
- name: "windows-py310"
|
||||||
python: "3.10"
|
python: "3.10-dev"
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
tox_env: "py310-xdist"
|
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
|
||||||
@@ -93,7 +94,7 @@ jobs:
|
|||||||
- name: "ubuntu-py37-pluggy"
|
- name: "ubuntu-py37-pluggy"
|
||||||
python: "3.7"
|
python: "3.7"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
tox_env: "py37-pluggymain-pylib-xdist"
|
tox_env: "py37-pluggymain-xdist"
|
||||||
- name: "ubuntu-py37-freeze"
|
- name: "ubuntu-py37-freeze"
|
||||||
python: "3.7"
|
python: "3.7"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
@@ -107,14 +108,9 @@ jobs:
|
|||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
tox_env: "py39-xdist"
|
tox_env: "py39-xdist"
|
||||||
- name: "ubuntu-py310"
|
- name: "ubuntu-py310"
|
||||||
python: "3.10"
|
python: "3.10-dev"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
tox_env: "py310-xdist"
|
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
|
||||||
@@ -129,17 +125,9 @@ 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.9"
|
python: "3.7"
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
tox_env: "plugins"
|
tox_env: "plugins"
|
||||||
|
|
||||||
@@ -154,13 +142,13 @@ jobs:
|
|||||||
use_coverage: true
|
use_coverage: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python }}
|
- name: Set up Python ${{ matrix.python }}
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
@@ -183,9 +171,51 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
if: "matrix.use_coverage"
|
if: "matrix.use_coverage"
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v2
|
||||||
continue-on-error: true
|
|
||||||
with:
|
with:
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
files: ./coverage.xml
|
files: ./coverage.xml
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest'
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
needs: [build]
|
||||||
|
|
||||||
|
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
|
||||||
4
.github/workflows/prepare-release-pr.yml
vendored
4
.github/workflows/prepare-release-pr.yml
vendored
@@ -27,12 +27,12 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: "3.8"
|
python-version: "3.8"
|
||||||
|
|
||||||
|
|||||||
9
.github/workflows/update-plugin-list.yml
vendored
9
.github/workflows/update-plugin-list.yml
vendored
@@ -11,8 +11,7 @@ on:
|
|||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-plugin-list:
|
createPullRequest:
|
||||||
if: github.repository_owner == 'pytest-dev'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -20,12 +19,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.8
|
python-version: 3.8
|
||||||
|
|
||||||
@@ -38,7 +37,7 @@ jobs:
|
|||||||
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@2b011faafdcbc9ceb11414d64d0573f37c774b04
|
uses: peter-evans/create-pull-request@2455e1596942c2902952003bbb574afbbe2ab2e6
|
||||||
with:
|
with:
|
||||||
commit-message: '[automated] Update plugin list'
|
commit-message: '[automated] Update plugin list'
|
||||||
author: 'pytest bot <pytestbot@users.noreply.github.com>'
|
author: 'pytest bot <pytestbot@users.noreply.github.com>'
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -50,7 +50,6 @@ coverage.xml
|
|||||||
.project
|
.project
|
||||||
.settings
|
.settings
|
||||||
.vscode
|
.vscode
|
||||||
__pycache__/
|
|
||||||
|
|
||||||
# generated by pip
|
# generated by pip
|
||||||
pip-wheel-metadata/
|
pip-wheel-metadata/
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
default_language_version:
|
|
||||||
python: "3.10"
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 22.12.0
|
rev: 21.10b0
|
||||||
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.12.1
|
rev: v1.11.0
|
||||||
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: v4.4.0
|
rev: v4.0.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
@@ -22,56 +20,47 @@ 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://github.com/PyCQA/autoflake
|
|
||||||
rev: v2.0.0
|
|
||||||
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
|
- repo: https://github.com/PyCQA/flake8
|
||||||
rev: 6.0.0
|
rev: 4.0.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
language_version: python3
|
language_version: python3
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- flake8-typing-imports==1.12.0
|
- flake8-typing-imports==1.9.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: v3.9.0
|
rev: v2.6.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: reorder-python-imports
|
- id: reorder-python-imports
|
||||||
args: ['--application-directories=.:src', --py37-plus]
|
args: ['--application-directories=.:src', --py36-plus]
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v3.3.1
|
rev: v2.29.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py37-plus]
|
args: [--py36-plus]
|
||||||
- repo: https://github.com/asottile/setup-cfg-fmt
|
- repo: https://github.com/asottile/setup-cfg-fmt
|
||||||
rev: v2.2.0
|
rev: v1.19.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: setup-cfg-fmt
|
- id: setup-cfg-fmt
|
||||||
args: ["--max-py-version=3.11", "--include-version-classifiers"]
|
args: [--max-py-version=3.10]
|
||||||
- repo: https://github.com/pre-commit/pygrep-hooks
|
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||||
rev: v1.9.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.991
|
rev: v0.910-1
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
files: ^(src/|testing/)
|
files: ^(src/|testing/)
|
||||||
args: []
|
args: []
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- iniconfig>=1.1.0
|
- iniconfig>=1.1.0
|
||||||
|
- py>=1.8.2
|
||||||
- attrs>=19.2.0
|
- attrs>=19.2.0
|
||||||
- packaging
|
- packaging
|
||||||
- tomli
|
- tomli
|
||||||
|
- types-atomicwrites
|
||||||
- types-pkg_resources
|
- 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
|
||||||
@@ -104,7 +93,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
|
exclude: docs|src/_pytest/deprecated.py|testing/deprecated_test.py
|
||||||
language: pygrep
|
language: pygrep
|
||||||
entry: \bpy\.path\.local
|
entry: \bpy\.path\.local
|
||||||
types: [python]
|
types: [python]
|
||||||
|
|||||||
@@ -2,12 +2,9 @@ version: 2
|
|||||||
|
|
||||||
python:
|
python:
|
||||||
install:
|
install:
|
||||||
# Install pytest first, then doc/en/requirements.txt.
|
- requirements: doc/en/requirements.txt
|
||||||
# This order is important to honor any pins in doc/en/requirements.txt
|
- method: pip
|
||||||
# when the pinned library is also a dependency of pytest.
|
path: .
|
||||||
- method: pip
|
|
||||||
path: .
|
|
||||||
- requirements: doc/en/requirements.txt
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
@@ -19,4 +16,3 @@ build:
|
|||||||
formats:
|
formats:
|
||||||
- epub
|
- epub
|
||||||
- pdf
|
- pdf
|
||||||
- htmlzip
|
|
||||||
|
|||||||
42
AUTHORS
42
AUTHORS
@@ -15,7 +15,6 @@ Alan Velasco
|
|||||||
Alexander Johnson
|
Alexander Johnson
|
||||||
Alexander King
|
Alexander King
|
||||||
Alexei Kozlenok
|
Alexei Kozlenok
|
||||||
Alice Purcell
|
|
||||||
Allan Feldman
|
Allan Feldman
|
||||||
Aly Sivji
|
Aly Sivji
|
||||||
Amir Elkess
|
Amir Elkess
|
||||||
@@ -43,10 +42,8 @@ Ariel Pillemer
|
|||||||
Armin Rigo
|
Armin Rigo
|
||||||
Aron Coyle
|
Aron Coyle
|
||||||
Aron Curzon
|
Aron Curzon
|
||||||
Ashish Kurmi
|
|
||||||
Aviral Verma
|
Aviral Verma
|
||||||
Aviv Palivoda
|
Aviv Palivoda
|
||||||
Babak Keyvani
|
|
||||||
Barney Gale
|
Barney Gale
|
||||||
Ben Gartner
|
Ben Gartner
|
||||||
Ben Webb
|
Ben Webb
|
||||||
@@ -58,7 +55,6 @@ Brian Maissy
|
|||||||
Brian Okken
|
Brian Okken
|
||||||
Brianna Laugher
|
Brianna Laugher
|
||||||
Bruno Oliveira
|
Bruno Oliveira
|
||||||
Cal Jacobson
|
|
||||||
Cal Leeming
|
Cal Leeming
|
||||||
Carl Friedrich Bolz
|
Carl Friedrich Bolz
|
||||||
Carlos Jenkins
|
Carlos Jenkins
|
||||||
@@ -66,11 +62,9 @@ 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 Rose
|
||||||
Chris Wheeler
|
|
||||||
Christian Boelsen
|
Christian Boelsen
|
||||||
Christian Fetzer
|
Christian Fetzer
|
||||||
Christian Neumüller
|
Christian Neumüller
|
||||||
@@ -89,8 +83,6 @@ Damian Skrzypczak
|
|||||||
Daniel Grana
|
Daniel Grana
|
||||||
Daniel Hahler
|
Daniel Hahler
|
||||||
Daniel Nuri
|
Daniel Nuri
|
||||||
Daniel Sánchez Castelló
|
|
||||||
Daniel Valenzuela Zenteno
|
|
||||||
Daniel Wandschneider
|
Daniel Wandschneider
|
||||||
Daniele Procida
|
Daniele Procida
|
||||||
Danielle Jenkins
|
Danielle Jenkins
|
||||||
@@ -132,13 +124,11 @@ Feng Ma
|
|||||||
Florian Bruhin
|
Florian Bruhin
|
||||||
Florian Dahlitz
|
Florian Dahlitz
|
||||||
Floris Bruynooghe
|
Floris Bruynooghe
|
||||||
Gabriel Landau
|
|
||||||
Gabriel Reis
|
Gabriel Reis
|
||||||
Garvit Shubham
|
Garvit Shubham
|
||||||
Gene Wood
|
Gene Wood
|
||||||
George Kussumoto
|
George Kussumoto
|
||||||
Georgy Dyuldin
|
Georgy Dyuldin
|
||||||
Gergely Kalmár
|
|
||||||
Gleb Nikonorov
|
Gleb Nikonorov
|
||||||
Graeme Smecher
|
Graeme Smecher
|
||||||
Graham Horler
|
Graham Horler
|
||||||
@@ -158,7 +148,6 @@ Ian Bicking
|
|||||||
Ian Lesperance
|
Ian Lesperance
|
||||||
Ilya Konstantinov
|
Ilya Konstantinov
|
||||||
Ionuț Turturică
|
Ionuț Turturică
|
||||||
Itxaso Aizpurua
|
|
||||||
Iwan Briquemont
|
Iwan Briquemont
|
||||||
Jaap Broekhuizen
|
Jaap Broekhuizen
|
||||||
Jakob van Santen
|
Jakob van Santen
|
||||||
@@ -173,9 +162,7 @@ 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
|
||||||
@@ -185,8 +172,8 @@ Joseph Hunkeler
|
|||||||
Josh Karpel
|
Josh Karpel
|
||||||
Joshua Bronson
|
Joshua Bronson
|
||||||
Jurko Gospodnetić
|
Jurko Gospodnetić
|
||||||
Justice Ndou
|
|
||||||
Justyna Janczyszyn
|
Justyna Janczyszyn
|
||||||
|
Justice Ndou
|
||||||
Kale Kundert
|
Kale Kundert
|
||||||
Kamran Ahmad
|
Kamran Ahmad
|
||||||
Karl O. Pinc
|
Karl O. Pinc
|
||||||
@@ -195,14 +182,9 @@ 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
|
||||||
@@ -225,7 +207,6 @@ Marcin Bachry
|
|||||||
Marco Gorelli
|
Marco Gorelli
|
||||||
Mark Abramowitz
|
Mark Abramowitz
|
||||||
Mark Dickinson
|
Mark Dickinson
|
||||||
Marko Pacak
|
|
||||||
Markus Unterwaditzer
|
Markus Unterwaditzer
|
||||||
Martijn Faassen
|
Martijn Faassen
|
||||||
Martin Altmayer
|
Martin Altmayer
|
||||||
@@ -239,6 +220,7 @@ Matthias Hafner
|
|||||||
Maxim Filipenko
|
Maxim Filipenko
|
||||||
Maximilian Cosmo Sitter
|
Maximilian Cosmo Sitter
|
||||||
mbyt
|
mbyt
|
||||||
|
Mickey Pashov
|
||||||
Michael Aquilina
|
Michael Aquilina
|
||||||
Michael Birtwell
|
Michael Birtwell
|
||||||
Michael Droettboom
|
Michael Droettboom
|
||||||
@@ -247,7 +229,6 @@ Michael Krebs
|
|||||||
Michael Seifert
|
Michael Seifert
|
||||||
Michal Wajszczuk
|
Michal Wajszczuk
|
||||||
Michał Zięba
|
Michał Zięba
|
||||||
Mickey Pashov
|
|
||||||
Mihai Capotă
|
Mihai Capotă
|
||||||
Mike Hoyle (hoylemd)
|
Mike Hoyle (hoylemd)
|
||||||
Mike Lundy
|
Mike Lundy
|
||||||
@@ -261,10 +242,9 @@ 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
|
||||||
Olga Matoula
|
|
||||||
Oliver Bestwalter
|
Oliver Bestwalter
|
||||||
Omar Kohl
|
Omar Kohl
|
||||||
Omer Hadari
|
Omer Hadari
|
||||||
@@ -272,15 +252,12 @@ Ondřej Súkup
|
|||||||
Oscar Benjamin
|
Oscar Benjamin
|
||||||
Parth Patel
|
Parth Patel
|
||||||
Patrick Hayes
|
Patrick Hayes
|
||||||
Paul Müller
|
|
||||||
Paul Reece
|
|
||||||
Pauli Virtanen
|
Pauli Virtanen
|
||||||
Pavel Karateev
|
Pavel Karateev
|
||||||
Paweł Adamczak
|
Paweł Adamczak
|
||||||
Pedro Algarvio
|
Pedro Algarvio
|
||||||
Petter Strandmark
|
Petter Strandmark
|
||||||
Philipp Loose
|
Philipp Loose
|
||||||
Pierre Sassoulas
|
|
||||||
Pieter Mulder
|
Pieter Mulder
|
||||||
Piotr Banaszkiewicz
|
Piotr Banaszkiewicz
|
||||||
Piotr Helm
|
Piotr Helm
|
||||||
@@ -291,8 +268,8 @@ Pulkit Goyal
|
|||||||
Punyashloka Biswal
|
Punyashloka Biswal
|
||||||
Quentin Pradet
|
Quentin Pradet
|
||||||
Ralf Schmitt
|
Ralf Schmitt
|
||||||
Ralph Giles
|
|
||||||
Ram Rachum
|
Ram Rachum
|
||||||
|
Ralph Giles
|
||||||
Ran Benita
|
Ran Benita
|
||||||
Raphael Castaneda
|
Raphael Castaneda
|
||||||
Raphael Pierzina
|
Raphael Pierzina
|
||||||
@@ -309,7 +286,6 @@ Ruaridh Williamson
|
|||||||
Russel Winder
|
Russel Winder
|
||||||
Ryan Wooden
|
Ryan Wooden
|
||||||
Saiprasad Kale
|
Saiprasad Kale
|
||||||
Samuel Colvin
|
|
||||||
Samuel Dion-Girardeau
|
Samuel Dion-Girardeau
|
||||||
Samuel Searles-Bryant
|
Samuel Searles-Bryant
|
||||||
Samuele Pedroni
|
Samuele Pedroni
|
||||||
@@ -321,7 +297,6 @@ Seth Junot
|
|||||||
Shantanu Jain
|
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
|
||||||
@@ -339,31 +314,26 @@ Taneli Hukkinen
|
|||||||
Tanvi Mehta
|
Tanvi Mehta
|
||||||
Tarcisio Fischer
|
Tarcisio Fischer
|
||||||
Tareq Alayan
|
Tareq Alayan
|
||||||
Tatiana Ovary
|
|
||||||
Ted Xiao
|
Ted Xiao
|
||||||
Terje Runde
|
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
|
||||||
Vitaly Lashmanov
|
Vitaly Lashmanov
|
||||||
Vivaan Verma
|
|
||||||
Vlad Dragos
|
Vlad Dragos
|
||||||
Vlad Radziuk
|
Vlad Radziuk
|
||||||
Vladyslav Rachek
|
Vladyslav Rachek
|
||||||
@@ -377,11 +347,7 @@ Xixi Zhao
|
|||||||
Xuan Luong
|
Xuan Luong
|
||||||
Xuecong Liao
|
Xuecong Liao
|
||||||
Yoav Caspi
|
Yoav Caspi
|
||||||
Yusuke Kadowaki
|
|
||||||
Yuval Shimon
|
|
||||||
Zac Hatfield-Dodds
|
Zac Hatfield-Dodds
|
||||||
Zachary Kneupper
|
Zachary Kneupper
|
||||||
Zachary OBrien
|
|
||||||
Zhouxin Qiu
|
|
||||||
Zoltán Máté
|
Zoltán Máté
|
||||||
Zsolt Cserna
|
Zsolt Cserna
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ 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.
|
||||||
@@ -223,7 +221,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://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests>`_.
|
`GitHub Help Center <https://help.github.com/articles/using-pull-requests/>`_.
|
||||||
|
|
||||||
Here is a simple overview, with pytest-specific bits:
|
Here is a simple overview, with pytest-specific bits:
|
||||||
|
|
||||||
@@ -244,11 +242,6 @@ Here is a simple overview, with pytest-specific bits:
|
|||||||
be released in micro releases whereas features will be released in
|
be released in micro releases whereas features will be released in
|
||||||
minor releases and incompatible changes in major releases.
|
minor releases and incompatible changes in major releases.
|
||||||
|
|
||||||
You will need the tags to test locally, so be sure you have the tags from the main repository. If you suspect you don't, set the main repository as upstream and fetch the tags::
|
|
||||||
|
|
||||||
$ git remote add upstream https://github.com/pytest-dev/pytest
|
|
||||||
$ git fetch upstream --tags
|
|
||||||
|
|
||||||
If you need some help with Git, follow this quick start
|
If you need some help with Git, follow this quick start
|
||||||
guide: https://git.wiki.kernel.org/index.php/QuickStart
|
guide: https://git.wiki.kernel.org/index.php/QuickStart
|
||||||
|
|
||||||
@@ -385,7 +378,7 @@ them.
|
|||||||
Backporting bug fixes for the next patch release
|
Backporting bug fixes for the next patch release
|
||||||
------------------------------------------------
|
------------------------------------------------
|
||||||
|
|
||||||
Pytest makes a feature release every few weeks or months. In between, patch releases
|
Pytest makes feature release every few weeks or months. In between, patch releases
|
||||||
are made to the previous feature release, containing bug fixes only. The bug fixes
|
are made to the previous feature release, containing bug fixes only. The bug fixes
|
||||||
usually fix regressions, but may be any change that should reach users before the
|
usually fix regressions, but may be any change that should reach users before the
|
||||||
next feature release.
|
next feature release.
|
||||||
@@ -394,17 +387,10 @@ 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 in the ``main`` 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 ``main`` anymore.
|
applicable to ``main`` anymore.
|
||||||
|
|
||||||
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
|
#. ``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:
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2004 Holger Krekel and others
|
Copyright (c) 2004-2021 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
|
||||||
|
|||||||
10
README.rst
10
README.rst
@@ -20,8 +20,8 @@
|
|||||||
: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/test/badge.svg
|
.. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg
|
||||||
:target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest
|
:target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Amain
|
||||||
|
|
||||||
.. 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/main
|
:target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main
|
||||||
@@ -88,7 +88,7 @@ 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/how-to/assert.html>`_ (no need to remember ``self.assert*`` names)
|
- Detailed info on failing `assert statements <https://docs.pytest.org/en/stable/assert.html>`_ (no need to remember ``self.assert*`` names)
|
||||||
|
|
||||||
- `Auto-discovery
|
- `Auto-discovery
|
||||||
<https://docs.pytest.org/en/stable/explanation/goodpractices.html#python-test-discovery>`_
|
<https://docs.pytest.org/en/stable/explanation/goodpractices.html#python-test-discovery>`_
|
||||||
@@ -100,7 +100,7 @@ Features
|
|||||||
- Can run `unittest <https://docs.pytest.org/en/stable/how-to/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/how-to/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.7+ or PyPy3
|
- Python 3.6+ and PyPy3
|
||||||
|
|
||||||
- Rich plugin architecture, with over 850+ `external plugins <https://docs.pytest.org/en/latest/reference/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
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ Tidelift will coordinate the fix and disclosure.
|
|||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Copyright Holger Krekel and others, 2004.
|
Copyright Holger Krekel and others, 2004-2021.
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ breaking changes or new features.
|
|||||||
|
|
||||||
For a new minor release, first create a new maintenance branch from ``main``::
|
For a new minor release, first create a new maintenance branch from ``main``::
|
||||||
|
|
||||||
git fetch upstream
|
git fetch --all
|
||||||
git branch 7.1.x upstream/main
|
git branch 7.1.x upstream/main
|
||||||
git push upstream 7.1.x
|
git push upstream 7.1.x
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ Major releases
|
|||||||
|
|
||||||
1. Create a new maintenance branch from ``main``::
|
1. Create a new maintenance branch from ``main``::
|
||||||
|
|
||||||
git fetch upstream
|
git fetch --all
|
||||||
git branch 8.0.x upstream/main
|
git branch 8.0.x upstream/main
|
||||||
git push upstream 8.0.x
|
git push upstream 8.0.x
|
||||||
|
|
||||||
@@ -136,31 +136,29 @@ 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 upstream
|
git fetch --all
|
||||||
git tag MAJOR.MINOR.PATCH upstream/release-MAJOR.MINOR.PATCH
|
git tag MAJOR.MINOR.PATCH upstream/release-MAJOR.MINOR.PATCH
|
||||||
git push upstream MAJOR.MINOR.PATCH
|
git push git@github.com:pytest-dev/pytest.git MAJOR.MINOR.PATCH
|
||||||
|
|
||||||
Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
|
Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
|
||||||
|
|
||||||
#. Merge the PR. **Make sure it's not squash-merged**, so that the tagged commit ends up in the main branch.
|
#. Merge the PR.
|
||||||
|
|
||||||
#. Cherry-pick the CHANGELOG / announce files to the ``main`` branch::
|
#. Cherry-pick the CHANGELOG / announce files to the ``main`` branch::
|
||||||
|
|
||||||
git fetch upstream
|
git fetch --all --prune
|
||||||
git checkout upstream/main -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 (or the first prerelease of it), tag the release cherry-pick merge commit in main with
|
#. For major and minor releases, 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 main
|
git checkout main
|
||||||
git pull
|
git pull
|
||||||
git tag MAJOR.{MINOR+1}.0.dev0
|
git tag MAJOR.{MINOR+1}.0.dev0
|
||||||
git push upstream MAJOR.{MINOR+1}.0.dev0
|
git push git@github.com:pytest-dev/pytest.git 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::
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
If multiple errors are raised in teardown, we now re-raise an ``ExceptionGroup`` of them instead of discarding all but the last.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix 'importlib.abc.TraversableResources' deprecation warning in Python 3.12.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
If a test is skipped from inside a fixture, the test summary now shows the test location instead of the fixture location.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Fix bug where sometimes pytest would use the file system root directory as :ref:`rootdir <rootdir>` on Windows.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Test methods decorated with ``@classmethod`` can now be discovered as tests, following the same rules as normal methods. This fills the gap that static methods were discoverable as tests but not class methods.
|
|
||||||
1
changelog/4320.doc.rst
Normal file
1
changelog/4320.doc.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Improved docs for `pytester.copy_example`.
|
||||||
1
changelog/5105.doc.rst
Normal file
1
changelog/5105.doc.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Add automatically generated :ref:`plugin-list`. The list is updated on a periodic schedule.
|
||||||
3
changelog/5196.feature.rst
Normal file
3
changelog/5196.feature.rst
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Tests are now ordered by definition order in more cases.
|
||||||
|
|
||||||
|
In a class hierarchy, tests from base classes are now consistently ordered before tests defined on their subclasses (reverse MRO order).
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
The full output of a test is no longer truncated if the truncation message would be longer than
|
|
||||||
the hidden text. The line number shown has also been fixed.
|
|
||||||
1
changelog/7124.bugfix.rst
Normal file
1
changelog/7124.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fixed an issue where ``__main__.py`` would raise an ``ImportError`` when ``--doctest-modules`` was provided.
|
||||||
1
changelog/7132.feature.rst
Normal file
1
changelog/7132.feature.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Added two environment variables :envvar:`PYTEST_THEME` and :envvar:`PYTEST_THEME_MODE` to let the users customize the pygments theme used.
|
||||||
9
changelog/7259.breaking.rst
Normal file
9
changelog/7259.breaking.rst
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
The :ref:`Node.reportinfo() <non-python tests>` function first return value type has been expanded from `py.path.local | str` to `os.PathLike[str] | str`.
|
||||||
|
|
||||||
|
Most plugins which refer to `reportinfo()` only define it as part of a custom :class:`pytest.Item` implementation.
|
||||||
|
Since `py.path.local` is a `os.PathLike[str]`, these plugins are unaffacted.
|
||||||
|
|
||||||
|
Plugins and users which call `reportinfo()`, use the first return value and interact with it as a `py.path.local`, would need to adjust by calling `py.path.local(fspath)`.
|
||||||
|
Although preferably, avoid the legacy `py.path.local` and use `pathlib.Path`, or use `item.location` or `item.path`, instead.
|
||||||
|
|
||||||
|
Note: pytest was not able to provide a deprecation period for this change.
|
||||||
3
changelog/7259.deprecation.rst
Normal file
3
changelog/7259.deprecation.rst
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
``py.path.local`` arguments for hooks have been deprecated. See :ref:`the deprecation note <legacy-path-hooks-deprecated>` for full details.
|
||||||
|
|
||||||
|
``py.path.local`` arguments to Node constructors have been deprecated. See :ref:`the deprecation note <node-ctor-fspath-deprecation>` for full details.
|
||||||
7
changelog/7259.feature.rst
Normal file
7
changelog/7259.feature.rst
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
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``.
|
||||||
|
|
||||||
|
Added a ``paths`` type to :meth:`parser.addini() <pytest.Parser.addini>`,
|
||||||
|
as in ``parser.addini("mypaths", "my paths", type="paths")``,
|
||||||
|
which is similar to the existing ``pathlist``,
|
||||||
|
but returns a list of :class:`pathlib.Path` instead of legacy ``py.path.local``.
|
||||||
@@ -1 +0,0 @@
|
|||||||
``--log-disable`` CLI option added to disable individual loggers.
|
|
||||||
13
changelog/7469.deprecation.rst
Normal file
13
changelog/7469.deprecation.rst
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
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.
|
||||||
25
changelog/7469.feature.rst
Normal file
25
changelog/7469.feature.rst
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
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.Config`` for :class:`Config <pytest.Config>`.
|
||||||
|
- ``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.PytestPluginManager`` for :class:`PytestPluginManager <pytest.PytestPluginManager>`.
|
||||||
|
- ``pytest.ExceptionInfo`` for the :class:`ExceptionInfo <pytest.ExceptionInfo>` type returned from :func:`pytest.raises` and passed to various hooks.
|
||||||
|
- ``pytest.Parser`` for the :class:`Parser <pytest.Parser>` type passed to the :func:`pytest_addoption <pytest.hookspec.pytest_addoption>` hook.
|
||||||
|
- ``pytest.OptionGroup`` for the :class:`OptionGroup <pytest.OptionGroup>` type returned from the :func:`parser.addgroup <pytest.Parser.getgroup>` method.
|
||||||
|
- ``pytest.HookRecorder`` for the :class:`HookRecorder <pytest.HookRecorder>` type returned from :class:`~pytest.Pytester`.
|
||||||
|
- ``pytest.RecordedHookCall`` for the :class:`RecordedHookCall <pytest.HookRecorder>` type returned from :class:`~pytest.HookRecorder`.
|
||||||
|
- ``pytest.RunResult`` for the :class:`RunResult <pytest.RunResult>` type returned from :class:`~pytest.Pytester`.
|
||||||
|
- ``pytest.LineMatcher`` for the :class:`LineMatcher <pytest.RunResult>` type used in :class:`~pytest.RunResult` and others.
|
||||||
|
- ``pytest.TestReport`` for the :class:`TestReport <pytest.TestReport>` type used in various hooks.
|
||||||
|
- ``pytest.CollectReport`` for the :class:`CollectReport <pytest.CollectReport>` type used in various hooks.
|
||||||
|
|
||||||
|
Constructing most of 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 8.0.
|
||||||
|
|
||||||
|
Subclassing them is also not supported. This is not currently enforced at runtime, but is detected by type-checkers such as mypy.
|
||||||
2
changelog/7856.feature.rst
Normal file
2
changelog/7856.feature.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
:ref:`--import-mode=importlib <import-modes>` now works with features that
|
||||||
|
depend on modules being on :py:data:`sys.modules`, such as :mod:`pickle` and :mod:`dataclasses`.
|
||||||
4
changelog/7864.improvement.rst
Normal file
4
changelog/7864.improvement.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Improved error messages when parsing warning filters.
|
||||||
|
|
||||||
|
Previously pytest would show an internal traceback, which besides being ugly sometimes would hide the cause
|
||||||
|
of the problem (for example an ``ImportError`` while importing a specific warning type).
|
||||||
1
changelog/8061.bugfix.rst
Normal file
1
changelog/8061.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fixed failing ``staticmethod`` test cases if they are inherited from a parent test class.
|
||||||
1
changelog/8133.trivial.rst
Normal file
1
changelog/8133.trivial.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Migrate to ``setuptools_scm`` 6.x to use ``SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST`` for more robust release tooling.
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Added :confval:`tmp_path_retention_count` and :confval:`tmp_path_retention_policy` configuration options to control how directories created by the :fixture:`tmp_path` fixture are kept.
|
|
||||||
The default behavior has changed to keep only directories for failed tests, equivalent to `tmp_path_retention_policy="failed"`.
|
|
||||||
7
changelog/8144.feature.rst
Normal file
7
changelog/8144.feature.rst
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
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).
|
||||||
6
changelog/8174.trivial.rst
Normal file
6
changelog/8174.trivial.rst
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
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``.
|
||||||
3
changelog/8192.bugfix.rst
Normal file
3
changelog/8192.bugfix.rst
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
``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.
|
||||||
7
changelog/8242.deprecation.rst
Normal file
7
changelog/8242.deprecation.rst
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
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 :class:`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
changelog/8246.breaking.rst
Normal file
1
changelog/8246.breaking.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
``--version`` now writes version information to ``stdout`` rather than ``stderr``.
|
||||||
1
changelog/8248.trivial.rst
Normal file
1
changelog/8248.trivial.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Internal Restructure: let ``python.PyObjMixin`` inherit from ``nodes.Node`` to carry over typing information.
|
||||||
1
changelog/8251.feature.rst
Normal file
1
changelog/8251.feature.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Implement ``Node.path`` as a ``pathlib.Path``.
|
||||||
3
changelog/8258.bugfix.rst
Normal file
3
changelog/8258.bugfix.rst
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
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).
|
||||||
5
changelog/8315.deprecation.rst
Normal file
5
changelog/8315.deprecation.rst
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Several behaviors of :meth:`Parser.addoption <pytest.Parser.addoption>` are now
|
||||||
|
scheduled for removal in pytest 8 (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
changelog/8317.bugfix.rst
Normal file
1
changelog/8317.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fixed an issue where illegal directory characters derived from ``getpass.getuser()`` raised an ``OSError``.
|
||||||
10
changelog/8335.improvement.rst
Normal file
10
changelog/8335.improvement.rst
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Improved :func:`pytest.approx` assertion messages for sequences of numbers.
|
||||||
|
|
||||||
|
The assertion messages now dumps a table with the index and the error of each diff.
|
||||||
|
Example::
|
||||||
|
|
||||||
|
> assert [1, 2, 3, 4] == pytest.approx([1, 3, 3, 5])
|
||||||
|
E assert comparison failed for 2 values:
|
||||||
|
E Index | Obtained | Expected
|
||||||
|
E 1 | 2 | 3 +- 3.0e-06
|
||||||
|
E 3 | 4 | 5 +- 5.0e-06
|
||||||
1
changelog/8337.doc.rst
Normal file
1
changelog/8337.doc.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Recommend `numpy.testing <https://numpy.org/doc/stable/reference/routines.testing.html>`__ module on :func:`pytest.approx` documentation.
|
||||||
1
changelog/8367.bugfix.rst
Normal file
1
changelog/8367.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fix ``Class.from_parent`` so it forwards extra keyword arguments to the constructor.
|
||||||
2
changelog/8377.bugfix.rst
Normal file
2
changelog/8377.bugfix.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
The test selection options ``pytest -k`` and ``pytest -m`` now support matching
|
||||||
|
names containing forward slash (``/``) characters.
|
||||||
1
changelog/8384.bugfix.rst
Normal file
1
changelog/8384.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
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
changelog/8394.bugfix.rst
Normal file
1
changelog/8394.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
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``).
|
||||||
5
changelog/8403.improvement.rst
Normal file
5
changelog/8403.improvement.rst
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
By default, pytest will truncate long strings in assert errors so they don't clutter the output too much,
|
||||||
|
currently at ``240`` characters by default.
|
||||||
|
|
||||||
|
However, in some cases the longer output helps, or is even crucial, to diagnose a failure. Using ``-v`` will
|
||||||
|
now increase the truncation threshold to ``2400`` characters, and ``-vv`` or higher will disable truncation entirely.
|
||||||
1
changelog/8421.feature.rst
Normal file
1
changelog/8421.feature.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
:func:`pytest.approx` now works on :class:`~decimal.Decimal` within mappings/dicts and sequences/lists.
|
||||||
1
changelog/8432.trivial.rst
Normal file
1
changelog/8432.trivial.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Improve error message when :func:`pytest.skip` is used at module level without passing `allow_module_level=True`.
|
||||||
4
changelog/8447.deprecation.rst
Normal file
4
changelog/8447.deprecation.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
|
See :ref:`the deprecation note <diamond-inheritance-deprecated>` for full details.
|
||||||
1
changelog/8456.bugfix.rst
Normal file
1
changelog/8456.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
The :confval:`required_plugins` config option now works correctly when pre-releases of plugins are installed, rather than falsely claiming that those plugins aren't installed at all.
|
||||||
1
changelog/8464.bugfix.rst
Normal file
1
changelog/8464.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
``-c <config file>`` now also properly defines ``rootdir`` as the directory that contains ``<config file>``.
|
||||||
4
changelog/8503.bugfix.rst
Normal file
4
changelog/8503.bugfix.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
:meth:`pytest.MonkeyPatch.syspath_prepend` no longer fails when
|
||||||
|
``setuptools`` is not installed.
|
||||||
|
It now only calls :func:`pkg_resources.fixup_namespace_packages` if
|
||||||
|
``pkg_resources`` was previously imported, because it is not needed otherwise.
|
||||||
5
changelog/8509.improvement.rst
Normal file
5
changelog/8509.improvement.rst
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Fixed issue where :meth:`unittest.TestCase.setUpClass` is not called when a test has `/` in its name since pytest 6.2.0.
|
||||||
|
|
||||||
|
This refers to the path part in pytest node IDs, e.g. ``TestClass::test_it`` in the node ID ``tests/test_file.py::TestClass::test_it``.
|
||||||
|
|
||||||
|
Now, instead of assuming that the test name does not contain ``/``, it is assumed that test path does not contain ``::``. We plan to hopefully make both of these work in the future.
|
||||||
1
changelog/8548.bugfix.rst
Normal file
1
changelog/8548.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Introduce fix to handle precision width in ``log-cli-format`` in turn to fix output coloring for certain formats.
|
||||||
3
changelog/8592.deprecation.rst
Normal file
3
changelog/8592.deprecation.rst
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
:func:`pytest_cmdline_preparse <_pytest.hookspec.pytest_cmdline_preparse>` has been officially deprecated. It will be removed in a future release. Use :func:`pytest_load_initial_conftests <_pytest.hookspec.pytest_load_initial_conftests>` instead.
|
||||||
|
|
||||||
|
See :ref:`the deprecation note <cmdline-preparse-deprecated>` for full details.
|
||||||
5
changelog/8606.feature.rst
Normal file
5
changelog/8606.feature.rst
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
pytest invocations with ``--fixtures-per-test`` and ``--fixtures`` have been enriched with:
|
||||||
|
|
||||||
|
- Fixture location path printed with the fixture name.
|
||||||
|
- First section of the fixture's docstring printed under the fixture name.
|
||||||
|
- Whole of fixture's docstring printed under the fixture name using ``--verbose`` option.
|
||||||
4
changelog/8645.deprecation.rst
Normal file
4
changelog/8645.deprecation.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
:func:`pytest.warns(None) <pytest.warns>` is now deprecated because many people used
|
||||||
|
it to mean "this code does not emit warnings", but it actually had the effect of
|
||||||
|
checking that the code emits at least one warning of any type - like ``pytest.warns()``
|
||||||
|
or ``pytest.warns(Warning)``.
|
||||||
1
changelog/8655.doc.rst
Normal file
1
changelog/8655.doc.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Help text for ``--pdbcls`` more accurately reflects the option's behavior.
|
||||||
1
changelog/8761.feature.rst
Normal file
1
changelog/8761.feature.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
New :ref:`version-tuple` attribute, which makes it simpler for users to do something depending on the pytest version (such as declaring hooks which are introduced in later versions).
|
||||||
1
changelog/8789.feature.rst
Normal file
1
changelog/8789.feature.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Switch TOML parser from ``toml`` to ``tomli`` for TOML v1.0.0 support in ``pyproject.toml``.
|
||||||
1
changelog/8796.bugfix.rst
Normal file
1
changelog/8796.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fixed internal error when skipping doctests.
|
||||||
9
changelog/8803.improvement.rst
Normal file
9
changelog/8803.improvement.rst
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
It is now possible to add colors to custom log levels on cli log.
|
||||||
|
|
||||||
|
By using :func:`add_color_level <_pytest.logging.add_color_level>` from a ``pytest_configure`` hook, colors can be added::
|
||||||
|
|
||||||
|
logging_plugin = config.pluginmanager.get_plugin('logging-plugin')
|
||||||
|
logging_plugin.log_cli_handler.formatter.add_color_level(logging.INFO, 'cyan')
|
||||||
|
logging_plugin.log_cli_handler.formatter.add_color_level(logging.SPAM, 'blue')
|
||||||
|
|
||||||
|
See :ref:`log_colors` for more information.
|
||||||
1
changelog/8818.trivial.rst
Normal file
1
changelog/8818.trivial.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Ensure ``regendoc`` opts out of ``TOX_ENV`` cachedir selection to ensure independent example test runs.
|
||||||
1
changelog/8822.improvement.rst
Normal file
1
changelog/8822.improvement.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
When showing fixture paths in `--fixtures` or `--fixtures-by-test`, fixtures coming from pytest itself now display an elided path, rather than the full path to the file in the `site-packages` directory.
|
||||||
1
changelog/8898.improvement.rst
Normal file
1
changelog/8898.improvement.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Complex numbers are now treated like floats and integers when generating parameterization IDs.
|
||||||
1
changelog/8913.trivial.rst
Normal file
1
changelog/8913.trivial.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
The private ``CallSpec2._arg2scopenum`` attribute has been removed after an internal refactoring.
|
||||||
2
changelog/8920.feature.rst
Normal file
2
changelog/8920.feature.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Added :class:`pytest.Stash`, a facility for plugins to store their data on :class:`~pytest.Config` and :class:`~_pytest.nodes.Node`\s in a type-safe and conflict-free manner.
|
||||||
|
See :ref:`plugin-stash` for details.
|
||||||
5
changelog/8948.deprecation.rst
Normal file
5
changelog/8948.deprecation.rst
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
:func:`pytest.skip(msg=...) <pytest.skip>`, :func:`pytest.fail(msg=...) <pytest.fail>` and :func:`pytest.exit(msg=...) <pytest.exit>`
|
||||||
|
signatures now accept a ``reason`` argument instead of ``msg``. Using ``msg`` still works, but is deprecated and will be removed in a future release.
|
||||||
|
|
||||||
|
This was changed for consistency with :func:`pytest.mark.skip <pytest.mark.skip>` and :func:`pytest.mark.xfail <pytest.mark.xfail>` which both accept
|
||||||
|
``reason`` as an argument.
|
||||||
2
changelog/8953.feature.rst
Normal file
2
changelog/8953.feature.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
:class:`RunResult <_pytest.pytester.RunResult>` method :meth:`assert_outcomes <_pytest.pytester.RunResult.assert_outcomes>` now accepts a
|
||||||
|
``warnings`` argument to assert the total number of warnings captured.
|
||||||
1
changelog/8954.feature.rst
Normal file
1
changelog/8954.feature.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
``--debug`` flag now accepts a :class:`str` file to route debug logs into, remains defaulted to `pytestdebug.log`.
|
||||||
2
changelog/8967.trivial.rst
Normal file
2
changelog/8967.trivial.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
:func:`pytest_assertion_pass <_pytest.hookspec.pytest_assertion_pass>` is no longer considered experimental and
|
||||||
|
future changes to it will be considered more carefully.
|
||||||
2
changelog/8983.bugfix.rst
Normal file
2
changelog/8983.bugfix.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
The test selection options ``pytest -k`` and ``pytest -m`` now support matching names containing backslash (`\\`) characters.
|
||||||
|
Backslashes are treated literally, not as escape characters (the values being matched against are already escaped).
|
||||||
1
changelog/8990.bugfix.rst
Normal file
1
changelog/8990.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fix `pytest -vv` crashing with an internal exception `AttributeError: 'str' object has no attribute 'relative_to'` in some cases.
|
||||||
4
changelog/9023.feature.rst
Normal file
4
changelog/9023.feature.rst
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
Full diffs are now always shown for equality assertions of iterables when
|
||||||
|
`CI` or ``BUILD_NUMBER`` is found in the environment, even when ``-v`` isn't
|
||||||
|
used.
|
||||||
15
changelog/9061.breaking.rst
Normal file
15
changelog/9061.breaking.rst
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
Using :func:`pytest.approx` in a boolean context now raises an error hinting at the proper usage.
|
||||||
|
|
||||||
|
It is apparently common for users to mistakenly use ``pytest.approx`` like this:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
assert pytest.approx(actual, expected)
|
||||||
|
|
||||||
|
While the correct usage is:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
assert actual == pytest.approx(expected)
|
||||||
|
|
||||||
|
The new error message helps catch those mistakes.
|
||||||
1
changelog/9062.improvement.rst
Normal file
1
changelog/9062.improvement.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
``--stepwise-skip`` now implicitly enables ``--stepwise`` and can be used on its own.
|
||||||
1
changelog/9077.bugfix.rst
Normal file
1
changelog/9077.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fixed confusing error message when ``request.fspath`` / ``request.path`` was accessed from a session-scoped fixture.
|
||||||
2
changelog/9113.feature.rst
Normal file
2
changelog/9113.feature.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
:class:`RunResult <_pytest.pytester.RunResult>` method :meth:`assert_outcomes <_pytest.pytester.RunResult.assert_outcomes>` now accepts a
|
||||||
|
``deselected`` argument to assert the total number of deselected tests.
|
||||||
1
changelog/9114.feature.rst
Normal file
1
changelog/9114.feature.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Added :confval:`pythonpath` setting that adds listed paths to :data:`sys.path` for the duration of the test session. If you currently use the pytest-pythonpath or pytest-srcpaths plugins, you should be able to replace them with built-in `pythonpath` setting.
|
||||||
1
changelog/9131.bugfix.rst
Normal file
1
changelog/9131.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fixed the URL used by ``--pastebin`` to use `bpa.st <http://bpa.st>`__.
|
||||||
1
changelog/9163.bugfix.rst
Normal file
1
changelog/9163.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
The end line number and end column offset are now properly set for rewritten assert statements.
|
||||||
1
changelog/9169.bugfix.rst
Normal file
1
changelog/9169.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Support for the ``files`` API from ``importlib.resources`` within rewritten files.
|
||||||
1
changelog/9202.trivial.rst
Normal file
1
changelog/9202.trivial.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Add github action to upload coverage report to codecov instead of bash uploader.
|
||||||
1
changelog/9205.improvement.rst
Normal file
1
changelog/9205.improvement.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
:meth:`pytest.Cache.set` now preserves key order when saving dicts.
|
||||||
1
changelog/9210.doc.rst
Normal file
1
changelog/9210.doc.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Remove incorrect docs about ``confcutdir`` being a configuration option: it can only be set through the ``--confcutdir`` command-line option.
|
||||||
1
changelog/9225.trivial.rst
Normal file
1
changelog/9225.trivial.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Changed the command used to create sdist and wheel artifacts: using the build package instead of setup.py.
|
||||||
1
changelog/9242.doc.rst
Normal file
1
changelog/9242.doc.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Upgrade readthedocs configuration to use a `newer Ubuntu version <https://blog.readthedocs.com/new-build-specification/>`__` with better unicode support for PDF docs.
|
||||||
2
changelog/9272.bugfix.rst
Normal file
2
changelog/9272.bugfix.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
The nose compatibility module-level fixtures `setup()` and `teardown()` are now only called once per module, instead of for each test function.
|
||||||
|
They are now called even if object-level `setup`/`teardown` is defined.
|
||||||
3
changelog/9277.breaking.rst
Normal file
3
changelog/9277.breaking.rst
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
The ``pytest.Instance`` collector type has been removed.
|
||||||
|
Importing ``pytest.Instance`` or ``_pytest.python.Instance`` returns a dummy type and emits a deprecation warning.
|
||||||
|
See :ref:`instance-collector-deprecation` for details.
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
<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>
|
||||||
@@ -29,3 +30,5 @@
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
<a href="{{ pathto('genindex') }}">Index</a>
|
||||||
|
<hr>
|
||||||
|
|||||||
@@ -6,14 +6,6 @@ Release announcements
|
|||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
|
|
||||||
release-7.2.0
|
|
||||||
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.5
|
||||||
release-6.2.4
|
release-6.2.4
|
||||||
release-6.2.3
|
release-6.2.3
|
||||||
|
|||||||
@@ -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
|
||||||
"enhancement" issues which we'll hopefully can tackle in 2014 with your
|
"enhacement" 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
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
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
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user