Skip to content

mark tests which require network connectivity#390

Open
lundybernard wants to merge 2 commits into
drivendataorg:masterfrom
lundybernard:lb/mark-network-tests
Open

mark tests which require network connectivity#390
lundybernard wants to merge 2 commits into
drivendataorg:masterfrom
lundybernard:lb/mark-network-tests

Conversation

@lundybernard

Copy link
Copy Markdown

Fixes: #389

  • marks tests which always require network connections as 'network'
  • marks tests which download cached data once as 'cached'

Fixes: drivendataorg#389

- marks tests which always require network connections as 'network'
- marks tests which download cached data once as 'cached'
@lundybernard

Copy link
Copy Markdown
Author

This draft marks all the tests which always require a network connection as 'network', and all tests which use cached downloads as 'cached'. The one exceptionally slow test which downloads weights from AWS is the only one marked as 'slow'.

I updated the default pytest behavior in pyproject.toml to skip cached, and network tests, and the make tests command to run all 3 but fail fast. There are a lot of ways to handle the new test suites, this approach just required minimal changes.

With this change:
when new users run pytest nothing will be downloaded.
Users can run the other suites with pytest -m cached, pytest -m "network and not slow" and pytest -m slow
when you run make tests it will run the fast tests, then tests which will download and cache data, and finally the slow AWS download test (if all other tests pass)

We could also provide make targets for each test suite, and update the github actions to run each suite in a separate step (or in parallel)

@lundybernard lundybernard marked this pull request as ready for review September 8, 2025 18:52
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.

Some test suite tests are slow because they are downloading model weights

1 participant