Skip to content

deps(api): Upgrade pytest to 9.0.3 and swap in pytest-lazy-fixtures - #8375

Merged
khvn26 merged 4 commits into
mainfrom
chore/api-pytest-9
Aug 26, 2026
Merged

deps(api): Upgrade pytest to 9.0.3 and swap in pytest-lazy-fixtures#8375
khvn26 merged 4 commits into
mainfrom
chore/api-pytest-9

Conversation

@khvn26

@khvn26 khvn26 commented Aug 26, 2026

Copy link
Copy Markdown
Member

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Stacked on #8374.

In this PR, we remove the pytest==7.2.2 dependency override.

What the pin was really holding back is pytest-lazy-fixture, which is unmaintained and breaks on pytest 8+ (AttributeError: 'CallSpec2' object has no attribute 'funcargs'). Here, we swap it for the maintained pytest-lazy-fixtures fork, aliasing its lf to lazy_fixture on import to keep the diff minimal.

How did you test this code?

Green CI should suffice.

@khvn26
khvn26 requested a review from a team as a code owner August 26, 2026 06:35
@khvn26
khvn26 requested review from matthewelwell and removed request for a team August 26, 2026 06:35
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Aug 26, 2026 10:38am
flagsmith-frontend-preview Ignored Ignored Preview Aug 26, 2026 10:38am
flagsmith-frontend-staging Ignored Ignored Preview Aug 26, 2026 10:38am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 36666b8f-cfd2-4a95-b781-e8e3d9ef87e8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added api Issue related to the REST API dependencies Pull requests that update a dependency file labels Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-8375 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-8375 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-8375 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-8375 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-8375 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-8375 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-8375 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-8375 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-8375 Finished ✅ Results

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor
❌ private-cloud · depot-ubuntu-latest-16 — run #19820 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

failed  2 failed

Details

stats  2 tests across 2 suites
duration  1 minute, 6 seconds
commit  b591e0e
info  📦 Artifacts: View test results and HTML report
🔄 Run: #19820 (attempt 1)

Failed tests

firefox › tests/environment-permission-test.pw.ts › Environment Permission Tests › Environment-level permissions control access to features, identities, and segments @enterprise
firefox › tests/project-permission-test.pw.ts › Project Permission Tests › Project-level permissions control access to features, environments, audit logs, and segments @enterprise

🗂️ Previous results
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19822 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 2 seconds
commit  b591e0e
info  🔄 Run: #19822 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19820 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  38.2 seconds
commit  b591e0e
info  🔄 Run: #19820 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #19822 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  33.1 seconds
commit  b591e0e
info  🔄 Run: #19822 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #19820 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  44.8 seconds
commit  b591e0e
info  🔄 Run: #19820 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #19822 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.8 seconds
commit  b591e0e
info  🔄 Run: #19822 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #19822 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.2 seconds
commit  b591e0e
info  🔄 Run: #19822 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #19820 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.2 seconds
commit  b591e0e
info  🔄 Run: #19820 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #19818 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  33.5 seconds
commit  8b4e666
info  🔄 Run: #19818 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19818 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  23 passed
skipped  1 skipped

Details

stats  24 tests across 18 suites
duration  1 minute, 23 seconds
commit  8b4e666
info  🔄 Run: #19818 (attempt 1)

Skipped tests

firefox › tests/onboarding-tests.pw.ts › Onboarding › New user connects via the single-page onboarding flow @oss

✅ oss · depot-ubuntu-latest-arm-16 — run #19818 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  45.5 seconds
commit  8b4e666
info  🔄 Run: #19818 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #19818 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  33.5 seconds
commit  8b4e666
info  🔄 Run: #19818 (attempt 1)

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.80%. Comparing base (3f0a34d) to head (b591e0e).

Additional details and impacted files
@@                  Coverage Diff                  @@
##           chore/api-pyfakefs-6    #8375   +/-   ##
=====================================================
  Coverage                 98.80%   98.80%           
=====================================================
  Files                      1619     1619           
  Lines                     65682    65682           
=====================================================
  Hits                      64898    64898           
  Misses                      784      784           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

@khvn26
khvn26 force-pushed the chore/api-pyfakefs-6 branch from 8b90483 to 2d588a4 Compare August 26, 2026 07:04
@khvn26
khvn26 force-pushed the chore/api-pytest-9 branch from a1ea697 to 3bca1f3 Compare August 26, 2026 07:04
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file and removed dependencies Pull requests that update a dependency file labels Aug 26, 2026
matthewelwell
matthewelwell previously approved these changes Aug 26, 2026
auto-merge was automatically disabled August 26, 2026 09:26

Pull Request is not mergeable

@khvn26
khvn26 force-pushed the chore/api-pyfakefs-6 branch from 2d588a4 to 2e7c088 Compare August 26, 2026 09:28
@khvn26
khvn26 force-pushed the chore/api-pytest-9 branch from 3bca1f3 to 3864a52 Compare August 26, 2026 09:28
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file and removed dependencies Pull requests that update a dependency file labels Aug 26, 2026
@khvn26
khvn26 requested a review from matthewelwell August 26, 2026 10:24
matthewelwell
matthewelwell previously approved these changes Aug 26, 2026
auto-merge was automatically disabled August 26, 2026 10:28

Pull Request is not mergeable

auto-merge was automatically disabled August 26, 2026 10:31

Pull Request is not mergeable

auto-merge was automatically disabled August 26, 2026 10:33

Pull Request is not mergeable

khvn26 added 4 commits August 26, 2026 11:37
1.6 pinned `clickhouse-driver==0.2.10` while the api requires 0.2.11, so
resolution only succeeded via a `clickhouse-driver` override plus a git
pin on the unreleased fix commit. Overrides don't propagate to
consumers, so any project depending on flagsmith-api could not resolve
it at all.

2.0 pins `clickhouse-driver==0.2.11` itself, so both workarounds go.

Ref: jayvynl/django-clickhouse-backend#172
`flagsmith-common[test-tools]` has required `pyfakefs>=6,<7` since
3.13.1, but the api capped it at `<6.0.0` and pinned `==5.7.4` via an
override. The override kept the api resolvable while leaving the
declared metadata contradictory, so consumers of flagsmith-api could not
resolve the two together.

Ref: #8368
The dev extra has declared `pytest>=9.0.3,<9.1.0` since #7689 landed the
CVE-2025-71176 fix, but `override-dependencies` pinned `pytest==7.2.2`,
which silently cancelled it — the lock still resolved 7.2.2, so the
security update never took effect and the suite ran on an affected
version.

pytest-lazy-fixture is unmaintained and breaks on pytest 8+, which is
what the pin was really holding back. Replace it with the maintained
pytest-lazy-fixtures fork, aliasing `lf` to `lazy_fixture` so the 295
call sites are untouched. `pluggy` was pinned below the 1.5 that pytest
9 needs for `HookimplOpts`, so that override goes too.

Ref: GHSA-6w46-j5rx-g56g
0.12 migrates the private test suite off pytest-lazy-fixture. `make
integrate-private-tests` clones this repo at the released tag matching the
installed version, so without the bump `tests/rbac_tests` fails collection
on `ModuleNotFoundError: No module named 'pytest_lazyfixture'`.
@khvn26
khvn26 force-pushed the chore/api-pyfakefs-6 branch from 2e7c088 to 3f0a34d Compare August 26, 2026 10:38
@khvn26
khvn26 force-pushed the chore/api-pytest-9 branch from 8b4e666 to b591e0e Compare August 26, 2026 10:38
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file and removed dependencies Pull requests that update a dependency file labels Aug 26, 2026
matthewelwell
matthewelwell previously approved these changes Aug 26, 2026
auto-merge was automatically disabled August 26, 2026 10:45

Pull Request is not mergeable

auto-merge was automatically disabled August 26, 2026 10:50

Pull Request is not mergeable

auto-merge was automatically disabled August 26, 2026 10:59

Pull Request is not mergeable

@khvn26
khvn26 changed the base branch from chore/api-pyfakefs-6 to main August 26, 2026 11:14
@khvn26
khvn26 dismissed matthewelwell’s stale review August 26, 2026 11:14

The base branch was changed.

@khvn26
khvn26 merged commit 0091e0c into main Aug 26, 2026
55 of 57 checks passed
@khvn26
khvn26 deleted the chore/api-pytest-9 branch August 26, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants