forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support pytest parameterized tests spanning multiple classes when cal…
- Loading branch information
1 parent
838807d
commit 629ca42
Showing
4 changed files
with
144 additions
and
2 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
python_files/tests/pytestadapter/.data/test_param_span_class.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import pytest | ||
|
||
|
||
@pytest.fixture(scope="function", params=[1, 2]) | ||
def setup(request): | ||
return request.param | ||
|
||
|
||
class TestClass1: | ||
def test_method1(self, setup): # test_marker--TestClass1::test_method1 | ||
assert 1 == 1 | ||
|
||
|
||
class TestClass2: | ||
def test_method1(self, setup): # test_marker--TestClass2::test_method1 | ||
assert 2 == 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters