-
Notifications
You must be signed in to change notification settings - Fork 140
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
PR: tests/unit/test_source
: cleanup, parametrize, and increase test coverage
#1772
Conversation
tests/unit/test_source.py
Outdated
qtbot.waitUntil(lambda: tab.sourceFilesWidget.rowCount() == 2, **pytest._wait_defaults) | ||
assert tab.sourceFilesWidget.rowCount() == 2 | ||
# Wait for directory sizing to finish | ||
qtbot.waitUntil(lambda: len(qapp.main_window.sourceTab.updateThreads) == 0, **pytest._wait_defaults) |
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.
This line is causing problems with the linux tests most of the time, but not always. Never seems to have trouble on darwin. Might need to do more digging here. @m3nu @real-yfprojects have either of y'all encountered errors caused by updateThreads
before?
Specifically, updateThreads
is not not getting set back to 0 and the wait times out.
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.
Resolved - this needs to be called after each test. Moved to fixture teardown.
yield main, tab | ||
|
||
# Wait for directory sizing to finish | ||
qtbot.waitUntil(lambda: len(qapp.main_window.sourceTab.updateThreads) == 0, timeout=2000) |
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.
After some digging, I discovered this wait needs to be done after each source test that involves updateThreads
. I added this to the source_env
fixture to happen at teardown.
Description
In this PR, I cleaned up the
test_source
module by splitting thepaste_text()
testing into its own separate test. I then parametrizedtest_paste_text()
to cover more use/edge cases. Finally, I added in tests for removing a source from the sources table, as well as testing the source update button.Related Issue
#1754
Motivation and Context
One of my Google Summer of Code projects involves cleaning up the Vorta tests, reducing duplicated code, and increasing code coverage.
How Has This Been Tested?
Tests work locally by running
pytest
, and they pass the GitHub CI checks.Types of changes
Checklist:
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.