Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DCOR_API_KEY: ${{ secrets.DCOR_API_KEY }}
run: |
coverage run --source=dcoraid -m pytest tests
coverage run --source=dcoraid -m pytest --durations=20 tests
- name: Lint with flake8
run: |
flake8 --exclude _version.py .
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
- tests: replace tests that required access to the `figshare-import`
circle with a circle, collection, and dataset shared by a second
automatically created test user
- tests: clear persistent upload jobs before and after each GUI test,
so that new main windows do not upload jobs of previous tests again
1.1.3
- enh: use `HTTPAdapter` with `urlib3`'s `Retry` to handle connection issues
- enh: use `requests.Session` when caching is disabled
Expand Down
13 changes: 13 additions & 0 deletions tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,26 @@
from PyQt6.QtWidgets import QInputDialog, QMessageBox

from . import common
from .conftest import cleanup_dcoraid_tasks


@pytest.fixture(scope="function", autouse=True)
def clear_ckan_api():
dcoraid.gui.api._CKAN_API = None


@pytest.fixture(scope="function", autouse=True)
def clear_persistent_upload_jobs():
"""Start and end every GUI test with an empty persistent job list

Otherwise, each new main window restores (and uploads again) the
unfinished upload jobs of all previous tests.
"""
cleanup_dcoraid_tasks()
yield
cleanup_dcoraid_tasks()


@pytest.fixture
def mw(qtbot):
# Always set server correctly, because there is a test that
Expand Down
Loading