Skip to content

Unittests are not independant #5

Open

Description

@harro

The order of tests matters, with some tests failing if the order is changed. As pytest does not isolate the environment between tests, some state can persist and influence the result of subsequent tests.

Initialising flags should be done each time and care should be taken when modifying/mocking of imports - as these may persist across suites(?).

Activity

  1. vinsymoyya commented on Nov 14, 2026

    @vinsymoyya

    Opened #23 to restore shared state after the response, inventory, TCLI, and end-to-end test fixtures. Scoped patches and flag savers replace persistent mocks/rebindings, including the end-to-end module's import-time inventory/accessor assignments.

    All four fresh-process isolation regressions fail on current master and pass with the fix. The complete 99-test suite passes in both normal and reversed test-module order on Linux/Python 3.13. Verification used container-local snapshots after a Windows bind-mounted collection attempt timed out. Production code and existing assertions are unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions