Repository navigation
Make .test parser friendlier - #15385
Merged
Merged
Conversation
ikonst
force-pushed
the
testcase-parse-gotchas
branch
from
June 7, 2023 02:20
cbf5f72 to
5e2c7eb
Compare
ikonst
commented
Jun 7, 2023
| self.steps = [steps.get(num, []) for num in range(2, max_step + 1)] | ||
|
|
||
| def teardown(self) -> None: | ||
| assert self.old_cwd is not None and self.tmpdir is not None, "test was not properly set up" |
Contributor
Author
There was a problem hiding this comment.
This would trip up whenever setup failed, adding to the noise (and making the setup failure, which is the underlying cause, harder to find)
ikonst
commented
Jun 7, 2023
Comment on lines
-650
to
-656
| r"^\[case ([a-zA-Z_0-9]+)" | ||
| r"(-writescache)?" | ||
| r"(-only_when_cache|-only_when_nocache)?" | ||
| r"(-posix|-windows)?" | ||
| r"(-skip)?" | ||
| r"(-xfail)?" | ||
| r"\][ \t]*$\n", |
Contributor
Author
There was a problem hiding this comment.
Previously, when [case foo-bar-baz] didn't comply with this pattern, we'd simply skip it and it would end up merging into the section of the preceding [case].
ikonst
force-pushed
the
testcase-parse-gotchas
branch
from
June 7, 2023 14:11
ac15b53 to
48eb214
Compare
ikonst
force-pushed
the
testcase-parse-gotchas
branch
from
June 7, 2023 14:13
48eb214 to
b39cd0f
Compare
Collaborator
|
It seems as though this PR again broke the mypy wheel build. Maybe a similar issue to the one fixed in #15383? |
JelleZijlstra
pushed a commit
that referenced
this pull request
Jun 12, 2023
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.
Quality of life improvements:
pytest.fail(..., pytrace=False)to eliminate stack trace noise.TestItem.linewhich is relative to testcase (e.g. for main item of testcase starting at line 1234, it'll be 1).casesections, erroring out on invalid names; previously invalid [case]s were ignored duringsplit_test_casesbut then resurfaced when parsing (as they'd end up being a section of the preceding case):I've added some rudimentary tests for this, also moving the
--update-datatest along intomypy/tests/meta. Since those are "meta tests", we shouldn't make them comprehensive, only trying to keep up some basic level of contributor ergonomics.