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
3 changes: 3 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ jobs:
- os: ubuntu-latest
python-version: '3.13'
toxenv: py313-test-pytestdev-numpydev
- os: ubuntu-latest
python-version: '3.13'
toxenv: py313-test-pytest83-pytestasyncio

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
1.4.0 (unreleased)
==================

- Fixing compatibility with pytest-asyncio. [#278]

- Versions of Python <3.9 are no longer supported. [#274]

1.3.0 (2024-11-25)
Expand Down
1 change: 1 addition & 0 deletions pytest_doctestplus/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ def collect(self):
test.name, self, runner, test)

class DocTestTextfilePlus(pytest.Module):
obj = None

def collect(self):
if PYTEST_GE_7_0:
Expand Down
10 changes: 10 additions & 0 deletions tests/test_doctestplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
import doctest
from pytest_doctestplus.output_checker import OutputChecker, FLOAT_CMP

try:
import pytest_asyncio # noqa: F401
has_pytest_asyncio = True
except ImportError:
has_pytest_asyncio = False



pytest_plugins = ['pytester']

Expand Down Expand Up @@ -1123,6 +1130,9 @@ class MyClass:
assert ("something()\nUNEXPECTED EXCEPTION: NameError" in report.longreprtext) is cont_on_fail


@pytest.mark.xfail(
has_pytest_asyncio,
reason='pytest_asyncio monkey-patches .collect()')
def test_main(testdir):
pkg = testdir.mkdir('pkg')
code = dedent(
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ deps =
pytest83: pytest==8.3.*
pytestdev: git+https://github.com/pytest-dev/pytest#egg=pytest
numpydev: numpy>=0.0.dev0
pytestasyncio: pytest-asyncio

extras =
test
Expand Down