Skip to content

test: replace SKIP_ONLINE_TESTS by requires_internet marker#615

Open
bdrung wants to merge 3 commits into
canonical:mainfrom
bdrung:pytest-marker
Open

test: replace SKIP_ONLINE_TESTS by requires_internet marker#615
bdrung wants to merge 3 commits into
canonical:mainfrom
bdrung:pytest-marker

Conversation

@bdrung
Copy link
Copy Markdown
Member

@bdrung bdrung commented Apr 28, 2026

Replace the use of has_internet() by a pytest marker, called requires_internet. All tests that require Internet access can now be easily skipped with pytest -m 'not requires_internet'.

This PR depends on #621.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.15%. Comparing base (b24ed44) to head (b2cafb7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #615      +/-   ##
==========================================
- Coverage   84.54%   79.15%   -5.40%     
==========================================
  Files         104      104              
  Lines       21028    21020       -8     
  Branches     3219     3220       +1     
==========================================
- Hits        17779    16639    -1140     
- Misses       2809     3956    +1147     
+ Partials      440      425      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

bdrung added 3 commits April 30, 2026 02:34
The branch coverage setting is specified in `pyproject.toml`. The
out-of-tree `*-installed` tests do not have access to this config and
therefore lack the branch coverage setting.

So copy the `pyproject.toml` to the out-of-tree location as well.

Fixes: a65d62e ("test: set branch code coverage in pyproject.toml")
Replace the use of `has_internet()` by a pytest marker, called
`requires_internet`. All tests that require Internet access can now be
easily skipped with `pytest -m 'not requires_internet'`.
Some tests lack the `requires_internet` marker:

* `test_crashdb_launchpad` accesses Launchpad
* apport-valgrind fetches debug packages from http://ddebs.ubuntu.com
* `test_api_authentication` accesses github.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant