Skip to content
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

Test refactor #242

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Test refactor #242

wants to merge 1 commit into from

Conversation

clbarnes
Copy link
Collaborator

@clbarnes clbarnes commented Jan 9, 2024

An example refactor of the graph tests.

  • Avoids unittest.TestCase
    • Tests can still be grouped into classes, but now can use fixtures
    • fixtures are more controllable and composable, can reduce slow network roundtrips etc.
  • igraph usage is controlled by a parametrized fixture
    • this allows pytest to report 2 separate tests which pass/fail individually rather than one which must pass both

- use pytest functions which can use fixtures
- use fixtures to reduce network roundtrips
- use parametrized fixture to control igraph usage
  - also splits igraph tests into 2
@clbarnes
Copy link
Collaborator Author

clbarnes commented Jan 9, 2024

Ah, I'd missed that having them in the same test checks that they produce the same result. That is useful. Will have a think.

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