Skip to content

🐛 fix(test): unpin pytest 6.0.2, which cannot run on Python 3.10 - #299

Open
joaquingx wants to merge 1 commit into
mainfrom
fix/pytest-python310-compat-v2
Open

🐛 fix(test): unpin pytest 6.0.2, which cannot run on Python 3.10#299
joaquingx wants to merge 1 commit into
mainfrom
fix/pytest-python310-compat-v2

Conversation

@joaquingx

Copy link
Copy Markdown
Contributor

Problem

requirements/test.txt resolved pytest==6.0.2 (Sept 2020). Collecting any test module under Python 3.10 crashes in pytest's assertion rewriter:

TypeError: required field "lineno" missing from alias

test.in did not constrain pytest at all, so the lockfile was free to resolve a version predating Python 3.10 support (added in pytest 6.2.5).

Change

Add a floor in test.in and recompile with pip-compile. Only the test-runner packages move:

before after
pytest 6.0.2 7.4.4
pytest-django 3.10.0 4.14.0

django==3.1.14 and everything else in base.txt are untouched. Two files changed.

Verification

  • estela-api's own suite is unchanged: 22 failed / 59 passed both before and after. Those failures are environmental and predate this change — 21 need a live MongoDB (ServerSelectionTimeoutError on 127.0.0.1:27017), and tests/api/test_docs.py compares against a stale committed swagger spec. (tests/core/test_kubernetes.py is excluded from both runs; it needs an in-cluster kube config.)
  • The bitmaker_billing external-app suite goes from "cannot collect" to 49 passed. That was the motivation: bitmaker-cloud-billing is adding CI that runs its tests against an estela checkout, and it currently has to override the pytest pin itself.

🤖 Generated with Claude Code

requirements/test.txt resolved pytest==6.0.2 (Sept 2020). Collecting any test
module under Python 3.10 crashes in pytest's assertion rewriter:

    TypeError: required field "lineno" missing from alias

pytest gained 3.10 support in 6.2.5. test.in did not constrain pytest at all, so
add a floor and recompile. django==3.1.14 and the rest of base.txt are untouched.

Verified against this branch:
  - estela-api's own suite is unchanged, 22 failed / 59 passed before and after.
    Those failures are environmental (21 need a live MongoDB; test_docs.py
    compares against a stale committed swagger spec) and predate this change.
  - the bitmaker_billing external-app suite goes from "cannot collect" to
    49 passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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