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.
add support for pytest describe (#24400)
fixes #21705
- Loading branch information
1 parent
b1cb5c2
commit 785ed68
Showing
8 changed files
with
385 additions
and
99 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -31,3 +31,6 @@ django-stubs | |
# for coverage | ||
coverage | ||
pytest-cov | ||
|
||
# for pytest-describe related tests | ||
pytest-describe |
9 changes: 9 additions & 0 deletions
9
python_files/tests/pytestadapter/.data/pytest_describe_plugin/describe_only.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,9 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
def describe_A(): | ||
def test_1(): # test_marker--test_1 | ||
pass | ||
|
||
def test_2(): # test_marker--test_2 | ||
pass |
31 changes: 31 additions & 0 deletions
31
python_files/tests/pytestadapter/.data/pytest_describe_plugin/nested_describe.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,31 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import pytest | ||
|
||
|
||
def describe_list(): | ||
@pytest.fixture | ||
def list(): | ||
return [] | ||
|
||
def describe_append(): | ||
def add_empty(list): # test_marker--add_empty | ||
list.append("foo") | ||
list.append("bar") | ||
assert list == ["foo", "bar"] | ||
|
||
def remove_empty(list): # test_marker--remove_empty | ||
try: | ||
list.remove("foo") | ||
except ValueError: | ||
pass | ||
|
||
def describe_remove(): | ||
@pytest.fixture | ||
def list(): | ||
return ["foo", "bar"] | ||
|
||
def removes(list): # test_marker--removes | ||
list.remove("foo") | ||
assert list == ["bar"] |
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
Oops, something went wrong.