add failure case tests for region parser - #86
Merged
Conversation
|
|
||
| def test_parse_unrecognized_extension(data_folder): | ||
| file = os.path.join(data_folder, "test_invalid.csv") | ||
| try: |
Member
There was a problem hiding this comment.
The standard way of testing of exceptions if a certain type are raised is to use with pytest.raises... Let's do that here.
|
|
||
|
|
||
| def test_parse_unknown_gene_only(): | ||
| file = "UNKNOWNGENE" |
Member
There was a problem hiding this comment.
The variable name is a bit misleading, since its a direct str and not a file. However, since the variable is only ever used in the very next line, let's remove it altogether and just pass it in directly (in this test case and the next).
|
|
||
| def test_parse_unknown_and_real_genes(): | ||
| file = "RAD51\nUNKNOWNGENE\nchrII:5000-8000" | ||
| parser = region_parser(file, organism="sacCer3") |
Member
|
Thanks @owenyu23 - I'm running the tests locally since the CI still has billing issues. See my comments - all very minor. |
vineetbansal
approved these changes
Mar 30, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added the following case tests to test_parsing.py:
test_parse_unrecognized_extension: unrecognized file extension raises TypeError
test_parse_txt_empty_input: empty string input returns empty list
test_parse_unknown_gene_only: unknown gene is skipped
test_parse_unknown_and_real_genes: unknown gene is skipped, valid genes are still returned
Also added tests/data/test_invalid.csv as test data for the extension test