Skip to content

test: isolate package unit tests from source tree#63

Open
AlwinXue wants to merge 1 commit intoOSIPI:mainfrom
AlwinXue:alwin/fix-issue-45
Open

test: isolate package unit tests from source tree#63
AlwinXue wants to merge 1 commit intoOSIPI:mainfrom
AlwinXue:alwin/fix-issue-45

Conversation

@AlwinXue
Copy link
Copy Markdown

@AlwinXue AlwinXue commented Mar 31, 2026

Hi mentors! 👋

This PR addresses the package-level test structure work described in Issue #45.

The Problem:
The package tests lived under src/pyaslreport/tests, which mixed test code into the package source tree and made discovery/import behavior brittle. In particular, the existing test file relied on a broken relative import pattern that did not reflect a clean installable-package workflow.

The Solution:
Isolated Test Layout: Moved the package tests into a dedicated package/tests/unit directory.
Explicit Discovery: Added package/pytest.ini so pytest resolves src correctly and only discovers the isolated unit test suite.
Cleaned Source Tree: Removed the old in-package test file from src/pyaslreport/tests.
Updated Coverage Base: Recreated the get_bids_metadata() tests in the new package test location with imports and mocks that match the actual runtime behavior.

Validation:
Ran python -m pytest -q from the package/ directory and the isolated package suite passed with 4 tests.

Fixes #45

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.

[Testing] Introduce Isolated Package-Level Unit Test Architecture

1 participant