Skip to content

Refactor: Consolidate duplicate conftest fixtures#2484

Open
SaurabhCodesAI wants to merge 1 commit intoborgbase:masterfrom
SaurabhCodesAI:feature/consolidation-issue-2474
Open

Refactor: Consolidate duplicate conftest fixtures#2484
SaurabhCodesAI wants to merge 1 commit intoborgbase:masterfrom
SaurabhCodesAI:feature/consolidation-issue-2474

Conversation

@SaurabhCodesAI
Copy link
Copy Markdown
Contributor

Fixes #2474 by unifying duplicated test fixture logic into a single root level tests/conftest.py.

Description

  • Consolidated shared fixture logic from:
    • tests/unit/conftest.py
    • tests/integration/conftest.py
      into one tests/conftest.py.
  • Preserved unit vs integration behavior using request.node.nodeid-based branching where needed.
  • Removed duplicated fixture files after consolidation:
    • tests/unit/conftest.py
    • tests/integration/conftest.py
  • Updated integration import usage in tests/integration/test_init.py to reference tests.conftest.
  • Updated integration test calls to current repo tab API in tests/integration/test_init.py.
  • Added pytest.importorskip("CoreWLAN") in tests/network_manager/test_darwin.py to avoid collection failures on non-macOS environments lacking CoreWLAN.

Related Issue

Fixes #2474

Motivation and Context

The test suite had duplicate fixture implementations across unit and integration scopes, which increased maintenance overhead and risk of fixture drift. This change centralizes setup logic while preserving existing test semantics for both scopes.

How Has This Been Tested?

  • Environment:
    • Windows + WSL (Linux)
  • Commands run:
    • uv run ruff check tests/conftest.py tests/integration/test_init.py tests/network_manager/test_darwin.py
    • uv run pytest -q tests/integration/test_init.py tests/network_manager/test_darwin.py
    • uv run pytest -q tests/unit/test_import_export.py tests/unit/test_archives.py tests/integration/test_archives.py
  • Results:
    • Lint passed on changed files.
    • Changed-target tests passed (tests/integration/test_init.py passed; tests/network_manager/test_darwin.py skipped where CoreWLAN unavailable).
    • test_mount in tests/integration/test_archives.py still fails in WSL without FUSE support (known environment limitation, not introduced by this refactor).

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

@SaurabhCodesAI SaurabhCodesAI force-pushed the feature/consolidation-issue-2474 branch 2 times, most recently from e6ba2c6 to 989ac63 Compare March 29, 2026 14:56
@SaurabhCodesAI SaurabhCodesAI force-pushed the feature/consolidation-issue-2474 branch from e3a4009 to 8972308 Compare March 30, 2026 01:09
@SaurabhCodesAI
Copy link
Copy Markdown
Contributor Author

@m3nu can u review when u have time..?

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.

Refactor: Consolidate duplicate conftest fixtures (GSoC prep)

1 participant