Skip to content

Commit

Permalink
Merge pull request pytest-dev#25 from nicoddemus/pytest-5.4-support
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus authored May 20, 2020
2 parents c5442e3 + 4c8f6e8 commit c1ec643
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ jobs:
"windows-py36",
"windows-py37",
"windows-py38",
"windows-py38-pytest53",

"ubuntu-py35",
"ubuntu-py36",
"ubuntu-py37",
"ubuntu-py38",
"ubuntu-py38-pytest53",

"linting",
]
Expand All @@ -41,6 +43,10 @@ jobs:
python: "3.8"
os: windows-latest
tox_env: "py38"
- name: "windows-py38-pytest53"
python: "3.8"
os: windows-latest
tox_env: "py38-pytest53"

- name: "ubuntu-py35"
python: "3.5"
Expand All @@ -58,6 +64,10 @@ jobs:
python: "3.8"
os: ubuntu-latest
tox_env: "py38"
- name: "ubuntu-py38-pytest53"
python: "3.8"
os: ubuntu-latest
tox_env: "py38-pytest53"

- name: "linting"
python: "3.7"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

0.3.1 (2020-05-20)
------------------

* Fix pytest 5.4 support.

0.3.0 (2020-01-22)
------------------

Expand Down
8 changes: 7 additions & 1 deletion pytest_subtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@ def _capturing_output(self):
option = self.request.config.getoption("capture", None)

# capsys or capfd are active, subtest should not capture
capture_fixture_active = hasattr(self.request.node, "_capture_fixture")

# pytest<5.4 support: node holds the active fixture
capture_fixture_active = getattr(self.request.node, "_capture_fixture", None)
if capture_fixture_active is None:
# pytest>=5.4 support: capture manager plugin holds the active fixture
capman = self.request.config.pluginmanager.getplugin("capturemanager")
capture_fixture_active = getattr(capman, "_capture_fixture", None)

if option == "sys" and not capture_fixture_active:
fixture = CaptureFixture(SysCapture, self.request)
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[tox]
envlist = py34,py35,py36,py37,pypy3,linting
envlist = py35,py36,py37,py38,py38-pytest53,pypy3,linting

[testenv]
passenv = USER USERNAME TRAVIS PYTEST_ADDOPTS
deps =
pytest-xdist>=1.28
pytest53: pytest ==5.3.5

commands =
pytest {posargs:tests}

Expand Down

0 comments on commit c1ec643

Please sign in to comment.