Skip to content
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

Merged
merged 14 commits into from
Nov 11, 2022

Conversation

lucasvanb
Copy link
Contributor

Checklist

  • Pull request details were added to HISTORY.rst

Copy link
Member

@rhpvorderman rhpvorderman left a 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
Copy link
Member

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?

@@ -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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

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.

@rhpvorderman rhpvorderman changed the title Enormous wall text Skip content tests when file does not exist. Nov 11, 2022
@rhpvorderman rhpvorderman merged commit 041d6c9 into LUMC:develop Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants