-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix: merge control markdown with json (#1528) #1740
Conversation
c191240
to
230c326
Compare
8e60474
to
2068811
Compare
tests/conftest.py
Outdated
@@ -259,7 +259,9 @@ def tmp_empty_cwd(tmp_path: pathlib.Path) -> Iterator[pathlib.Path]: | |||
@pytest.fixture(scope='function') | |||
def testdata_dir() -> pathlib.Path: | |||
"""Return absolute path to test data directory.""" | |||
test_data_source = pathlib.Path('tests/data') | |||
test_dir = pathlib.Path(__file__).parent.resolve() |
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.
Why do we switch to using __file__
?
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.
Expanding on the commit message for the line: to enable running / debugging unit tests in PyCharm; PyCharm sets working directories for the test runner incorrectly, even when manually specified. This is a PyCharm problem, but enabling tools is good, so why not? 😃 It also enables running unit tests from any directory in the shell.
) -> None: | ||
"""Test failure modes of validation.""" | ||
test_data_dir = testdata_dir |
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.
Why not use test_data_dir
as the parameter name and remove this statement? Or use testdata_dir
in the code?
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.
I agree this is messy. I did this to keep the changed line count small, and I was planning to do more test clean-up in a dedicated PR, but I can fix this now.
edit: I realized I didn't finish answering: the test function parameter name is associated with the fixture function name in conftest.py. The test function now uses the fixture, but the test code used this slightly different variable name for the same purpose.
"""Test successful validation runs.""" | ||
test_data_dir = testdata_dir |
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.
Why not use test_data_dir as the parameter name and remove this statement? Or use testdata_dir
in the code?
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.
Is there a test case that demonstrates the failure before this PR that now passes?
Yes, looks like I dropped it in my previous rebasing. I'll include it along with the requested test_data_dir update |
2068811
to
25bb44a
Compare
25bb44a
to
180c8e1
Compare
@d10n |
Signed-off-by: d10n <[email protected]>
Function cleanup / unit tests to follow Signed-off-by: d10n <[email protected]>
Signed-off-by: d10n <[email protected]>
Signed-off-by: d10n <[email protected]>
d2ad415
to
1e217ee
Compare
Signed-off-by: d10n <[email protected]>
1e217ee
to
1949c4c
Compare
We discussed the unit test updates in Slack, and I am making a separate PR with them. |
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.
LGTM.
Are PR & issue linked?
@degenaro Yes. PR and issue are linked and this issue is in the current milestone. I plan to do some local testing on this and review. |
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.
LGTM
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.
LGTM
Types of changes
develop
->main
)Quality assurance (all should be covered).
Summary
Key links:
Before you merge