Skip to content

Latest commit

 

History

History
60 lines (48 loc) · 2.55 KB

README.md

File metadata and controls

60 lines (48 loc) · 2.55 KB

QCManyBody Testing

Run tests with pytest or see GHA for an example. Individual tests will skip if they need requirements (QCEngine, QC runner, zstandard, etc.) not detected in the current environment.

pytest -v qcmanybody/

There are inadvertantly a few classes of tests:

Examples

  • includes test_examples
  • tests core and high-level interfaces
  • easy to read
  • as set up, one test runs w/o any QC runners, while the other two tests require Psi4 and NWChem.
  • A way to run the examples is to create a conda environment from the file below (Linux/Mac/Win), activate it, then:
    • run it through pytest as pytest -v qcmanybody/ -k "examples"
    • -or- run it through python as python qcmanybody/tests/test_examples.py
name: test
channels:
  - conda-forge
  - nodefaults
dependencies:
  - python
  - qcmanybody
  - qcengine
  - pytest
  - psi4=1.9.1
  - nwchem

Unit Tests

Static-Data Regression Tests

  • includes test_core_singlelevel, test_core_multilevel, test_core_multilevel_ss
  • tests core interface
  • HARD TO READ! These test many combinations of inputs and a dictionary comparison against pre-stored outputs, so parts are scattered. Users looking for examples aren't advised to look at these.
  • requires zstandard to be installed
  • no QC runners needed. Output data from Psi4 are stored and may need to be regenerated as the interface changes.
  • no QC calculations are run, so testing is instantaneous.

End-to-End Correctness Tests

  • includes test_computer_he4_singlelevel, test_computer_he4_multilevel, test_computer_het4_gradient.py
  • tests high-level (and through it, core) interfaces
  • HARD TO READ! These test many combinations of inputs and many details of outputs, so to avoid repetition, there is much parameterization and dictionary lookups. Users looking for examples aren't advised to look at these.
  • requires QCEngine be installed
  • requires one of Psi4, NWChem, or Cfour be installed (actual QCManyBody tests are the same with each QC runner)
  • small QC calculations are actually run, so takes a few minutes. Prune with -k "not (3b or 4b)", for example.