Skip to content

Feature/pytest unit tests clean - #441

Merged
ilhamv merged 7 commits into
mcdc-project:devfrom
massimolarsen:feature/pytest-unit-tests-clean
Jun 28, 2026
Merged

Feature/pytest unit tests clean#441
ilhamv merged 7 commits into
mcdc-project:devfrom
massimolarsen:feature/pytest-unit-tests-clean

Conversation

@massimolarsen

@massimolarsen massimolarsen commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

This PR updates the unit test suite to run under pytest directly, replacing the old test/unit/run.py entry point with pytest collection and an option for python and numba execution. It renames existing unit tests to pytest discoverable test_*.py files, adds shared fixtures for distribution, geometry surface, and tally tests, and updates the GitHub unit-test workflow to run python -m pytest test/unit. Some existing tests (mainly the distribution tests) are updated to run properly in numba mode.

pytest test/unit now automatically runs unit tests in both pure python and numba mode.
pytest test/unit --mode=python runs tests in pure python mode.
pytest test/unit --mode=numba runs tests in numba mode.

Localized it to just 'pytest test/unit' at this point in time. I will be updating regression tests soon, so I want to keep this hook separate for now. This is fine with Github because the workflows runs 'pytest test/unit'. Could be changed in the future though.

Types of changes

  • Organization and beautification (changes which improve readability and/or accessibility)

Developer Checklist

  • I have read the contributing guide.
  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests pass

Associated Issues and PRs

  • closes #
  • related to #

Associated Developers

@ilhamv ilhamv added this to the v0.14.0 milestone Jun 27, 2026
@ilhamv
ilhamv merged commit 86fe30a into mcdc-project:dev Jun 28, 2026
15 checks passed
@massimolarsen
massimolarsen deleted the feature/pytest-unit-tests-clean branch June 30, 2026 16:50
@ilhamv ilhamv mentioned this pull request Jul 11, 2026
7 tasks
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