Skip to content

Test refactor - #242

Draft
clbarnes wants to merge 1 commit into
navis-org:masterfrom
clbarnes:test-refactor
Draft

Test refactor#242
clbarnes wants to merge 1 commit into
navis-org:masterfrom
clbarnes:test-refactor

Conversation

@clbarnes

@clbarnes clbarnes commented Jan 9, 2024

Copy link
Copy Markdown
Collaborator

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

clbarnes commented Jan 9, 2024

Copy link
Copy Markdown
Collaborator Author

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