Add integration tests for running against a real printer#157
Merged
Conversation
3f86f2a to
64f29b2
Compare
Tests are marked with pytest.mark.integration and excluded from CI by default. Run locally with PRUSALINK_HOST, PRUSALINK_USERNAME, and PRUSALINK_PASSWORD environment variables set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
64f29b2 to
1bec1ca
Compare
agners
requested changes
Apr 28, 2026
Contributor
agners
left a comment
There was a problem hiding this comment.
Btw, maybe we should also start to add our test dependencies to pyproject.toml (as optional dependencies like so):
test = [
"pytest==9.0.3",
"pytest-asyncio==1.3.0",
]- Remove `firmware` field assertion in test_get_version (not present on MK3.9 firmware 6.4.0 per @agners) - Update docstring with `-m integration` flag (required to override default deselection) - Add `[project.optional-dependencies]` test group as suggested Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Pushed 1a1e46a addressing the three points:
I left Verified locally:
|
agners
approved these changes
May 7, 2026
3 tasks
agners
pushed a commit
that referenced
this pull request
May 7, 2026
Move all test/lint deps from requirements-test.txt into [project.optional-dependencies] with separate `test` and `lint` groups, and update CI to install via `pip install -e .[test,lint]`. The requirements-test.txt file is removed. Per @agners' follow-up note on #157. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/test_integration.pywith tests that verify actual API behavior against a real PrusaLink printerintegrationpytest mark and excludes it from default runs viaaddopts = "-m 'not integration'"[project.optional-dependencies]testgroup for test deps inpyproject.tomlHow to run
The
-m integrationflag is required to override the default-m 'not integration'frompyproject.toml.Why
Mocked unit tests can't reveal what fields the API actually returns. This was highlighted when investigating the
job.file.metastructure — we needed a real printer to confirm the actual field names. Integration tests give contributors a reproducible way to verify real behavior before typing it.Test plan
pytest tests/— integration tests should be deselected🤖 Generated with Claude Code