-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Improve pytest quality of life #10567
Conversation
strict_optional = saved | ||
try: | ||
yield | ||
finally: |
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.
Prevents one failed tests from bleeding into another
@@ -50,6 +50,7 @@ def assert_string_arrays_equal(expected: List[str], actual: List[str], | |||
|
|||
Display any differences in a human-readable form. | |||
""" | |||
__tracebackhide__ = True |
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.
@@ -326,18 +327,6 @@ def retry_on_error(func: Callable[[], Any], max_wait: float = 1.0) -> None: | |||
raise | |||
time.sleep(wait_time) | |||
|
|||
# TODO: assert_true and assert_false are redundant - use plain assert |
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.
Follow up for PR #4369
mypy/test/testtypes.py
Outdated
assert is_more_precise(fx.b, fx.b) | ||
assert is_more_precise(fx.b, fx.b) | ||
assert is_more_precise(fx.b, fx.anyt) | ||
assert is_more_precise(self.tuple(fx.b, fx.a, |
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.
Looks like the find and replace wasn't quite right
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.
😅
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.
Thanks for improving this!
finally
so that tests don't bleed into each other and cause unrelated tests to fail (and send us down a wild goose chase)__tracebackhide__
per https://docs.pytest.org/en/6.2.x/example/simple.html#writing-well-integrated-assertion-helpers to allow failed test output to have less "noise"