Skip to content

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