Skip to content

Commit

Permalink
Minimised repro case for pytest-dev#67
Browse files Browse the repository at this point in the history
  • Loading branch information
arr-ee committed Feb 26, 2024
1 parent b274232 commit d5d2c7b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
28 changes: 28 additions & 0 deletions testing/test_issue67_a.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Minimal repro case for https://github.com/pytest-dev/pytest-forked/issues/67.
See also: `test_issue67_z.py`"""

import pytest


def test_asetup_for_failure():
"Non-forked test to get current module onto SetupState"
pass


@pytest.mark.forked
def test_yyy():
"""
Forked test as last test in the module.
This way, teardown phase of previous test does not remove `test_issue67_a` module
from the stack, and forked setups/teardowns do not leave the containment of the forked
process.
"""
pass


# Uncomment me to make tests pass O_-
# def test_zcleanup():
# """As long as the last teardown of the module is ran in-process, stack should
# stay valid for next module"""
# pass
7 changes: 7 additions & 0 deletions testing/test_issue67_z.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"Second part of pytest>=7 incompatibility repro case. See also: `test_issue67_a.py`"


def test_no_forky():
"""When ran after `test_issue67_a.py`, this test will explode because
`test_issue67_a` module is still on stack"""
pass
8 changes: 3 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
# if you change the envlist, please update .travis.yml file as well
minversion = 3.7.0
minversion = 3.8.0
isolated_build = true
envlist=
py{37,38,39,310,311}-pytest{310,46,54,62,latest}
py{38,39,310,311}-pytest{62,74,latest}
flakes
build-dists
metadata-validation
Expand All @@ -13,10 +13,8 @@ deps =
pycmd
# to avoid .eggs
setuptools_scm
pytest310: pytest~=3.10
pytest46: pytest~=4.6
pytest54: pytest~=5.4
pytest62: pytest~=6.2
pytest74: pytest~=7.4
pytestlatest: pytest
pytestmain: git+https://github.com/pytest-dev/pytest.git@main
platform=linux|darwin
Expand Down

0 comments on commit d5d2c7b

Please sign in to comment.