Skip to content

fix: Resolve test collisions when capsys used - #6013

Open
davem-bis wants to merge 2 commits into
SQLMesh:mainfrom
davem-bis:feature/DRM/resolve-test-collisions-in-parallel-run
Open

fix: Resolve test collisions when capsys used#6013
davem-bis wants to merge 2 commits into
SQLMesh:mainfrom
davem-bis:feature/DRM/resolve-test-collisions-in-parallel-run

Conversation

@davem-bis

@davem-bis davem-bis commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description

Tests that use capsys can collide with each other as capsys is not threadsafe.

I have modified conftest.py to apply the isolated pytest marker (so they tests run sequentially) if capsys is passed to the test.

Test Plan

  • make fast-test passes.

  • PyTest correctly flags tests that use capsys as marked with isolated:

    image

    Note that test_python_model_empty_df_raises does not have the isolated marker applied to it directly, it is dynamically added by the changes to conftest.

    image

Checklist

  • I have run make style and fixed any issues
  • I have added tests for my changes (if applicable) (N/A)
  • All existing tests pass (make fast-test)
  • My commits are signed off (git commit -s) per the DCO

Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com>
@davem-bis
davem-bis force-pushed the feature/DRM/resolve-test-collisions-in-parallel-run branch from 267388d to 85c40c3 Compare September 2, 2026 12:56
@davem-bis
davem-bis marked this pull request as ready for review September 2, 2026 13:56
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