-
Notifications
You must be signed in to change notification settings - Fork 3
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
Organise unit tests to use pytest fixtures (test_repository.py
implementation)
#176
Organise unit tests to use pytest fixtures (test_repository.py
implementation)
#176
Conversation
test_repository.py
implementation)
Codecov Report
@@ Coverage Diff @@
## 163-tidy-up-organisation-of-unit-tests #176 +/- ##
===========================================================================
+ Coverage 46.42% 60.45% +14.03%
===========================================================================
Files 25 25
Lines 1676 1659 -17
===========================================================================
+ Hits 778 1003 +225
+ Misses 898 656 -242
|
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.
It's more a question than a request for changes. I see we aren't cleaning up created files and directories anymore. Is that a choice?
(internal.SRC_DIR / repo.name / "offline" / "Makefile").touch() | ||
(internal.SRC_DIR / repo.name / "offline" / "parallel_cable").touch() | ||
(internal.SRC_DIR / repo.name / "offline" / "serial_cable").touch() | ||
(internal.SRC_DIR / repo.name / "offline" / "foo.f90").touch() |
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.
Should we add a teardown?
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 figured all directories under the mock_cwd
are removed at the end by the _run_around_tests
fixture which is why I haven't been adding a teardown step.
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.
Could we have a comment at the file level to remind us of that? Happy to have the same comment in all test_*
files. But I am sure to have forgotten in a few days otherwise.
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.
Sure, we can put a comment the module docstring, e.g:
"""`pytest` tests for `repository.py`.
Note: explicit teardown for generated files and directories are not required as
the working directory used for testing is cleaned up in the `_run_around_tests`
pytest autouse fixture.
"""
Add missing `parametrize()` decorator.
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.
If you can add the module docstring before merging that would be great.
Add note on cleaning up generated files and directories in the tests.
b3a0fac
into
163-tidy-up-organisation-of-unit-tests
No description provided.