Skip to content

pytest marks for programs#499

Merged
loriab merged 13 commits intoMolSSI:next2026from
loriab:grimme_v2_adapt
Apr 2, 2026
Merged

pytest marks for programs#499
loriab merged 13 commits intoMolSSI:next2026from
loriab:grimme_v2_adapt

Conversation

@loriab
Copy link
Copy Markdown
Collaborator

@loriab loriab commented Mar 16, 2026

(see changelog and CI summary below)

Description

Changelog description

Status

  • Code base linted
  • Ready to go

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 80.10753% with 37 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (next2026@27a334f). Learn more about missing BASE report.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@loriab loriab marked this pull request as ready for review March 16, 2026 19:15
@loriab loriab requested review from bennybp and Copilot March 16, 2026 19:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds pytest markers for all external program dependencies used in QCEngine's test suite. Previously, tests used @using("program") as a decorator and/or has_program() checks inside test bodies; now there's a clear distinction between @uusing("program") (decorator form) and using("program") (inline form for marks= in pytest.param). Both forms apply three marks: a skipif mark, an addon label, and a program-specific label. This enables selecting tests by program via pytest -m openmm.

Changes:

  • Refactored using() to return a tuple of marks for inline use, and introduced uusing() as the decorator form; updated all test files accordingly
  • Converted plain tuple test params in _canonical_methods lists to pytest.param(...) with marks=using(...), replacing runtime has_program() skip checks
  • Registered all program markers in pyproject.toml and enabled --strict-markers in CI

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
qcengine/testing.py Core refactor: split using into _using/uusing/using, added has_program aliases for classic-dftd3/classic-gcp, retired psi4 version sub-marks
pyproject.toml Registered all program names as pytest markers, added addon marker
.github/workflows/CI.yml Added --strict-markers and --durations flags to pytest invocations
docs/source/changelog.rst Added v0.50.0rc3 changelog entry for the new marker feature
qcengine/tests/test_harness_canonical.py Converted _canonical_methods to pytest.param with marks, removed has_program checks
qcengine/tests/test_procedures.py Switched from @using to @uusing, added marks to params
qcengine/tests/test_qcmanybody.py Switched from @using to @uusing
qcengine/tests/test_cli.py Switched from @using to @uusing
qcengine/tests/test_mdi.py Switched from @using to @uusing
qcengine/programs/tests/test_programs.py Switched from @using to @uusing, updated psi4 version marks
qcengine/programs/tests/test_dftd3_mp2d.py Updated dftd3classic-dftd3 marks, removed psi4 version checks
qcengine/programs/tests/test_standard_suite.py Updated psi4_mp2qcsk/psi4_derqcskpsi4 marks
qcengine/programs/tests/test_canonical_config.py Converted to pytest.param with marks, removed has_program checks
qcengine/programs/tests/test_canonical_fields.py Removed has_program check (now handled by param marks)
qcengine/programs/tests/test_alignment.py Updated psi4_derqcskpsi4 marks
qcengine/programs/tests/test_turbomole.py Switched to @uusing, added *using() spread for combined marks
Various other test files Mechanical @using@uusing conversions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml Outdated
Comment thread docs/source/changelog.rst Outdated
Comment thread qcengine/tests/test_harness_canonical.py Outdated
Comment thread qcengine/testing.py Outdated
@loriab loriab merged commit 9cac98f into MolSSI:next2026 Apr 2, 2026
16 checks passed
@loriab loriab deleted the grimme_v2_adapt branch April 2, 2026 14:55
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