-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip content tests when file does not exist. #152
Conversation
…flow into enormous_wall_text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I am quite happy with the methodology, but I still have some nits to pick.
HISTORY.rst
Outdated
@@ -9,6 +9,7 @@ Changelog | |||
|
|||
version 1.7.0-dev | |||
--------------------------- | |||
+ Add skip for tests searching non existing file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you word this more clearly? Is "a skip" a thing?
src/pytest_workflow/content_tests.py
Outdated
@@ -243,8 +243,9 @@ def runtest(self): | |||
this makes content checking much faster on big files (NGS > 1 GB files) | |||
were we are looking for multiple words (variants / sequences). """ | |||
# Wait for thread to complete. | |||
if self.parent.file_not_found: | |||
pytest.skip(f"'{self.content_name}' not found so cant be searched") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cant
-> cannot
. https://www.grammarly.com/blog/cannot-or-can-not/
tests/test_skip_tests.py
Outdated
def test_skips(pytester): | ||
pytester.makefile(".yml", test=SKIP_TESTS) | ||
result = pytester.runpytest("-v").stdout.str() | ||
assert "4 failed, 3 passed, 3 skipped" in result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if pytest outputs "3 passed, 3 skipped, 4 failed". As the result then incorrect?
Have a look at pytester's method for testing outcomes. That should be stable regardless of how pytest represents the output.
959216d
to
f5e2757
Compare
Checklist