v0.4.2 #22
IKrysanov
announced in
Announcements
v0.4.2
#22
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
0.4.2 - 2026-06-06
Added
PytestOperator(dry_run=True)-- new optional argument that switchesthe run to pytest's
--collect-onlymode. Test bodies do NOTexecute; pytest only collects them (imports modules, runs collection-
time fixtures, walks the test tree). Intended as a pre-flight task in
a DAG: verifies the test path resolves on the worker, that imports
succeed (so the worker has all required deps installed), and that
collection itself succeeds (no syntax errors, no missing fixtures).
Collection errors surface the same way normal test failures do --
the task fails with
TestsFailedErrorunder the defaultfail_on_test_failure=True. The user'spytest_argsare notmutated; the
--collect-onlyflag is appended to a per-calleffective list at
execute()time, so retries see the originalconfiguration and downstream introspection of the operator is honest.
Default
dry_run=False-- behaviour unchanged for existing tasks.JSONResultParsernow reportsTestRunResult.totalfromsummary.collectedwhensummary.totalis 0 and no per-caseentries were parsed. This is exactly the shape pytest-json-report
writes in
--collect-onlymode (zero "ran" tests, N collected).Normal runs are unaffected -- the fallback only kicks in when there
is no other signal. The JUnit XML for
--collect-onlycontainsno
<testcase>entries at all (<testsuite tests="0">), so theJUnit parser cannot report a count for dry-run; the operator
docstring notes this limitation.
This discussion was created from the release v0.4.2.
Beta Was this translation helpful? Give feedback.
All reactions