Skip to content

Commit

Permalink
Test without xdist
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbean-bremen committed Mar 2, 2024
1 parent 92e289d commit 7fd82cd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 78 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/performance.yml

This file was deleted.

44 changes: 12 additions & 32 deletions tests/test_xdist_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,14 @@ def test_xdist_ordering(tmpdir):
fi.write(
dedent(
"""
import pytest
val = 1
@pytest.mark.order("second")
def test_second_integer():
global val
assert val == 2
val += 1
assert False
def test_last_integer():
assert val == 3
pass
@pytest.mark.order("first")
def test_first_integer():
global val
assert val == 1
val += 1
pass
"""
)
)
Expand All @@ -38,33 +28,23 @@ def test_first_integer():
fi.write(
dedent(
"""
import pytest
val = "frog"
@pytest.mark.order("second")
def test_second_string():
global val
assert val == "goat"
val = "fish"
assert False
def test_last_string():
assert val == "fish"
pass
@pytest.mark.order("first")
def test_first_string():
global val
assert val == "frog"
val = "goat"
pass
"""
)
)
# With `loadfile`, the tests should pass
args = ["-n3", "-v", "--dist=loadfile", str(tmpdir)]
args = ["-v", str(tmpdir)]
ret = pytest.main(args, [pytest_order])
assert ret == 0

# Without `loadfile`, the tests should fail
args = ["-n3", "-v", str(tmpdir)]
ret = pytest.main(args, [pytest_order])
assert ret == 1
#
# # Without `loadfile`, the tests should fail
# args = ["-n3", "-v", str(tmpdir)]
# ret = pytest.main(args, [pytest_order])
# assert ret == 1
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ deps =
pytest624: pytest>=6.2.4,<6.3
pytest70: pytest>=7.0,<7.1
pytest74: pytest>=7.3,<8.0
pytest80: git+https://github.com/mrbean-bremen/pytest.git@short-paths
; pytest80: git+https://github.com/mrbean-bremen/pytest.git@short-paths
pytest80: pytest==8.0.2
pytest-cov<2.10
pytest{50,54}: pytest-xdist<2.0.0
pytest{60,62,624,70,74,80}: pytest-xdist
; pytest{60,62,624,70,74,80}: pytest-xdist
pytest-dependency>=0.5.1
pytest-mock

Expand Down

0 comments on commit 7fd82cd

Please sign in to comment.