-
-
Notifications
You must be signed in to change notification settings - Fork 740
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
Archiver Tests: ArchiverTestCaseBase
unittest to pytest conversion
#7668
Conversation
conftest.py
Outdated
|
||
|
||
@pytest.fixture(autouse=True) | ||
def archiver_setup(tmp_path): |
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.
names of things are all temporary, will refine later on.
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.
Right. If a fixture gives back archiver
, it can be called like that.😜
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.
Absolutely 👍
Lot's of renaming and refinement to do. Tracer Bullet style for now :)
All functions in archiver folder |
Translated |
|
||
|
||
def read_only(path): | ||
pass |
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.
Need to convert this method still. Will have soon.
|
||
|
||
def fuse_mount(path, fork, s="", exit_code=EXIT_ERROR): | ||
pass |
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.
Same thing here.
"""runs the same tests, but via the borg binary""" | ||
|
||
|
||
def fail(s: str): |
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.
Ignore for now, will have this soon.
Today I converted |
Today I converted A couple of these tests are failing - something appears wrong with my |
After talking with @m3nu, I moved the helper functions from the |
This PR is getting bigger then intended, so I will start a new one for each couple of test files that I convert. |
For simplicity sake, I reduced this PR to just the changes I made to I tried to change as little as possible here: Just turned the archiver setup and teardown into a pytest fixture called @ThomasWaldmann I have a lot of the archiver folder tests already converted to use the pytest fixtures and remove the unittest elements. I will make manageable sized PR's for these tests. Please let me know your thoughts on these changes to |
ArchiverTestCaseBase
unittest to pytest conversion
CI (mypy) for this is still broken, can you fix it? |
Most of the tests in the archiver test folder inherit from the
ArchiverTestCaseBase
in__init__.py
, which is all unittest and needs to be converted to pytest. I have begun the process of converting these functions to pytest fixtures inconftest.py
. Once these functions have all been converted corrected, I will then be able to go through the archiver test suite folder and begin converting all the tests to use the new pytest fixtures.