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', useCache=True)[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.

  • useCache (bool, default=True) – Look for a copy of this Reactor in the cache, if not in the cache, put it there. (Set to False when you are sure there will only be one test using this test reactor.)

Notes

If the armiRun.yaml test reactor 3 rings instead of 9, most unit tests that use it go ~4 times faster. 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 need such a large reactor, and would run much faster with a smaller one.

armi.testing.getEmptyHexReactor()[source]

Make an empty hex reactor used in some tests.

armi.testing.getEmptyCartesianReactor(pitch=(10.0, 16.0))[source]

Return an empty Cartesian reactor used in some tests.

Submodules