Skip to content

Minimal refactor tests#42

Merged
DorisMai merged 3 commits into
mainfrom
tests-refactor
Mar 9, 2026
Merged

Minimal refactor tests#42
DorisMai merged 3 commits into
mainfrom
tests-refactor

Conversation

@DorisMai

@DorisMai DorisMai commented Mar 1, 2026

Copy link
Copy Markdown
Collaborator

This PR changes the tests to prepare for PR #39 that sets up build workflow and helps clean up dependencies.

Changes are minimal. Functionally, the main change is replacing a hard-coded data file path with a relative one. This involves moving the test_files folder inside test. A conftest.py script is added to reduce some boiler plates on fixture.

@DorisMai
DorisMai requested a review from vratins March 1, 2026 02:07
@DorisMai
DorisMai marked this pull request as ready for review March 1, 2026 02:07

@marcuscollins marcuscollins left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple minor things to think about for the future maybe, otherwise LGTM.

Comment thread tests/conftest.py


@pytest.fixture
def pdb_base_dir():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be a fixture? It will certainly work, but it will call os.environ.get every time you want to get what is essentially a constant.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. a new commit will make a constant first, and just wrap it in a fixture to not affect the existing test functions.

Comment thread tests/conftest.py Outdated
@pytest.fixture
def pdb_path(pdb_base_dir):
"""Factory fixture that resolves a PDB path, skipping if missing."""
def _resolve(pdb_id: str) -> str:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you need pdb_base_dir to be a fixture, I would simplify this by creating a constant that is generated once at initialization, e.g. PDB_BASE_DIR and then use that in this method. Then you don't need the method to return a function.

@vratins vratins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DorisMai
DorisMai merged commit 520175d into main Mar 9, 2026
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.

3 participants