-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
handle frame in stack trace that doesn't have a module #1741
Merged
Merged
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
42eca87
handle frame in stack trace that doesn't have a module
Jasha10 fc1f24f
revert to `assert mdl is not None` (don't use break)
Jasha10 1d07372
stricter typing in `run_and_report`
Jasha10 81e0c75
tests for current run_and_report_behavior
Jasha10 953fc55
refactor tests with @pytest.mark.parametrize
Jasha10 ad6be1f
remove outdated test docstring
Jasha10 e7218d1
black formatting
Jasha10 a9a02d4
improve pytest param ids
Jasha10 80f1bb2
isort
Jasha10 6a6e665
add failing test
Jasha10 90a7451
wrap simplified traceback logic in a try/except block
Jasha10 69379e0
regex patterns: backslash excape parentheses
Jasha10 7de5282
raise original exception after printing a warning
Jasha10 7d74b9a
more flexible regex pattern for filenames
Jasha10 3bf3e48
newline after warning message
Jasha10 cf7bbbf
less info when printing warning
Jasha10 33d471d
add documentation to the TestRunAndReport class
Jasha10 a48a21b
add news fragment
Jasha10 118ab6a
Merge branch 'master' to fix merge conflicts
Jasha10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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.
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 explain the testing logic?
The test is surprisingly large.
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.
Sorry about that.
This is not just testing the new functionality. It is also testing the pre-existing
run_and_report
behavior.The
run_and_report
function has the following signature:There are three test methods:
test_success
tests whenrun_and_report
runsfunc
successfully.test_failure
tests whenfunc
raises an exception andrun_and_report
is able to print a nicely-formatted error message.test_simplified_traceback_failure
tests whenfunc
raises an exception andrun_and_report
is not able to print a nicely-formatted error message -- this is the case where the original exception gets re-raised.There are four
@staticmethod
definitions. These are passed in torun_and_report
as thefunc
argument. They are designed to trigger different logic code paths inside ofrun_and_report
:success_func
raises no exceptionsimple_error
raises anAssertionError
run_job_wrapper
triggers the special logic inrun_and_report
that looks for a function called"run_job"
in the stack, and strips away the leading stack framesomegaconf_job_wrapper
triggers the special logic inrun_and_report
that looks for theomegaconf
module in the stack, and strips away the bottom stack framesThere 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.
Gotcha.
Thanks for adding this. Can you add a comment describing this in the test class?
(does not need to be as detailed).