armi.testing package

Importable testing utilities.

This is a very limited set of ARMI testing tools, meant to be importable as part of the ARMI API. The goal is to provide a small set of high quality tools to help downstream ARMI developers write tests.

Notes

This will not be a catch-all for random unit test functions. Be very sparing here.

armi.testing.loadTestReactor(inputFilePath='/home/runner/work/armi/armi/armi/tests', customSettings=None, inputFileName='armiRun.yaml')[source]

Loads a test reactor. Can be used in other test modules.

Parameters:
  • inputFilePath (str, default=TEST_ROOT) – Path to the directory of the input file.

  • customSettings (dict with str keys and values of any type, default=None) – For each key in customSettings, the cs which is loaded from the armiRun.yaml will be overwritten to the value given in customSettings for that key.

  • inputFileName (str, default="armiRun.yaml") – Name of the input file to run.

Notes

If the armiRun.yaml test reactor 3 rings instead of 9, most unit tests that use it go 4 times faster (based on testing). The problem is it would breat a LOT of downstream tests that import this method. It is still worth it though.

Returns:

  • o (Operator)

  • r (Reactor)

armi.testing.reduceTestReactorRings(r, cs, maxNumRings)[source]

Helper method for the test reactor above.

The goal is to reduce the size of the reactor for tests that don’t neeed such a large reactor, and would run much faster with a smaller one.