-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
We want to execute all tests from a test file and need to execute one test from this file afterwards.
In version 7.3.1 this worked well.
Since 8.3.4 we imagine following:
Reproduction:
content of test_test.py
class TestClass(object):
def test_test_1(self):
print("Test1")
def test_test_2(self):
print("Test2")
def test_test_3(self):
print("Test3")
pytest -s test_test.py test_test.py::TestClass::test_test_3
Result:
============================= test session starts ==============================
platform linux -- Python 3.9.18, pytest-8.3.4, pluggy-1.5.0
rootdir: /tmp
plugins: dependency-0.6.0, csv-3.0.0
collected 1 item
test_test.py Test3
.
============================== 1 passed in 0.02s ===============================
What we expect is like in version 7.3.1:
pytest -s test_test.py test_test.py::TestClass::test_test_3
============================= test session starts ==============================
platform linux -- Python 3.9.18, pytest-7.3.1, pluggy-1.0.0
rootdir: /mnt/hgfs/shared
plugins: dependency-0.5.1, csv-3.0.0
collected 4 items
test_test.py Test1
.Test2
.Test3
.Test3
.
============================== 4 passed in 0.05s ===============================