Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,26 @@ jobs:
path: coverage/coverage.*
if-no-files-found: error

test-pytest-dev:
name: ubuntu - Python latest - pytest main
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ env.PYTHON_LATEST }}
- name: Install dependencies
run: |
python -VV
python -m site
python -m pip install --upgrade pip
python -m pip install --upgrade tox
- name: Run tests against pytest main
run: python -m tox run -e pytest-dev

lint-github-actions:
name: Lint GitHub Actions
permissions:
Expand Down
13 changes: 13 additions & 0 deletions tests/modes/test_strict_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from textwrap import dedent

import pytest
from pytest import Pytester, version_tuple as pytest_version


Expand Down Expand Up @@ -82,6 +83,10 @@ async def test_anything():
result.stdout.fnmatch_lines(["*async def functions are not natively supported*"])


@pytest.mark.skipif(
pytest_version >= (9, 1, 0),
reason="pytest >=9.1 converts unhandled async fixtures to errors",
)
def test_strict_mode_ignores_unmarked_fixture(pytester: Pytester):
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
pytester.makepyfile(dedent("""\
Expand Down Expand Up @@ -109,6 +114,10 @@ async def test_anything(any_fixture):
)


@pytest.mark.skipif(
pytest_version >= (9, 1, 0),
reason="pytest >=9.1 converts unhandled async fixtures to errors",
)
def test_strict_mode_marked_test_unmarked_fixture_warning(pytester: Pytester):
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
pytester.makepyfile(dedent("""\
Expand Down Expand Up @@ -152,6 +161,10 @@ async def test_anything(any_fixture):


# autouse is not handled in any special way currently
@pytest.mark.skipif(
pytest_version >= (9, 1, 0),
reason="pytest >=9.1 converts unhandled async fixtures to errors",
)
def test_strict_mode_marked_test_unmarked_autouse_fixture_warning(pytester: Pytester):
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
pytester.makepyfile(dedent("""\
Expand Down
6 changes: 6 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ commands = make test
allowlist_externals =
make

[testenv:pytest-dev]
description = Run tests against pytest main
constraints =
deps =
pytest @ git+https://github.com/pytest-dev/pytest.git

[testenv:docs]
allowlist_externals =
git
Expand Down
Loading