Skip to content

Add unit tests and CI workflow#15

Merged
QSparks merged 2 commits into
py-sprint-25q1from
i6-unit-tests
Jul 4, 2025
Merged

Add unit tests and CI workflow#15
QSparks merged 2 commits into
py-sprint-25q1from
i6-unit-tests

Conversation

@QSparks
Copy link
Copy Markdown
Contributor

@QSparks QSparks commented Jun 27, 2025

Add CI workflow and unit tests for Translation, helpers, and app endpoints.
Resolves #6

@QSparks QSparks requested a review from rod-glover June 27, 2025 18:04
@QSparks QSparks self-assigned this Jun 27, 2025
Copy link
Copy Markdown
Collaborator

@rod-glover rod-glover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, very nice work! This repo is much the better for these tests.

One question: What advantages do you think we get by using test classes rather than flat collections of functions?

Comment thread tests/test_routes.py

@pytest.fixture
def client(app):
return app.test_client()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test fixtures are usually stored in conftest.py files. Any reason not to do that here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. I left them in this file to keep things readable, since they’re only used here.
If our fixtures end up being reused elsewhere, we can move them to conftest.py.

@QSparks
Copy link
Copy Markdown
Contributor Author

QSparks commented Jul 2, 2025

What advantages do you think we get by using test classes rather than flat collections of functions?

Using test classes gives additional context in our logs. While not strictly necessary here, it becomes useful if we add tests for other classes in the same file, as it scopes test failures more clearly.

Context is also factored out into the class, shortening test names.
Example:
FAILED tests/test_routes.py::TestAppEndpoints::test_dynamic_retries_on_failure

@QSparks QSparks merged commit 7b69d01 into py-sprint-25q1 Jul 4, 2025
4 checks passed
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.

2 participants