armi.tests package

General framework-wide testing functions and files.

This package contains some input files that can be used across a wide variety of unit tests in other lower-level subpackages.

class armi.tests.Fixture(refDirectory, targets, dependencies, function)[source]

Bases: object

Fixture for presenting a consistent data source for testing.

A Fixture is a class that wraps a function which generates resources needed by one or more tests that does not need to be updated every time tests are run.

Do not use this class directly, instead use the @fixture and @requires_fixture decorators.

armi.tests.fixture(refDirectory=None, targets=None, dependencies=None)[source]

Decorator to run function based on targets and dependencies similar to GNU Make.

Parameters:
  • refDirectory (str) – String reference directory for all targets/dependencies. This makes it possible to simplify file paths. If os.path.abspath(<path>) == <path>, then refDirectory is not used.

  • targets (iterable(str)) – List of targets that the function generates.

  • dependencies (iterable(str)) – List of dependencies that the targets require.

armi.tests.requires_fixture(fixtureFunction)[source]

Decorator to require a fixture to have been completed.

Parameters:

fixtureFunction (function without any parameters) – Fixture function is a function that has been decorated with fixture and is called prior to running the decorated function.

Notes

This cannot be used on classes.

Submodules