generated from tophat/new-project-kit
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: only process valid test nodes in report, close #246 * chore: ignore build metadata * fix: ensure unused snapshots processed in deterministic order
- Loading branch information
Noah
authored
Jun 2, 2020
1 parent
c4e8e5c
commit 8ed194c
Showing
6 changed files
with
53 additions
and
13 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 |
---|---|---|
|
@@ -26,6 +26,7 @@ wheels/ | |
*.egg | ||
MANIFEST | ||
version.txt | ||
pip-wheel-metadata | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from .utils import clean_output | ||
|
||
|
||
def test_ignores_non_function_nodes(testdir): | ||
conftest = """ | ||
import pytest | ||
class CustomItem(pytest.Item, pytest.File): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self._nodeid += "::CUSTOM" | ||
def runtest(self): | ||
pass | ||
def pytest_collect_file(path, parent): | ||
return CustomItem(path, parent) | ||
""" | ||
testcase = """ | ||
def test_example(snapshot): | ||
assert snapshot == 1 | ||
""" | ||
testdir.makepyfile(conftest=conftest) | ||
testdir.makepyfile(test_file=testcase) | ||
result = testdir.runpytest("test_file.py", "-v", "--snapshot-update") | ||
result_stdout = clean_output(result.stdout.str()) | ||
assert result.ret == 0 | ||
assert "test_file.py::CUSTOM" in result_stdout |