Removing unit tests from ARMI's API #1955
Replies: 3 comments 4 replies
-
Here is a full list of ALL imports I can find (in any downstream project) of ARMI's unit tests: import armi.materials.tests.test_materials._Material_Test
import armi.nuclearDataIO.cccc.tests.test_labels
import armi.nuclearDataIO.tests.test_xsCollections
import armi.nuclearDataIO.tests.test_xsLibraries
import armi.physics.neutronics.fissionProductModel.tests.test_lumpedFissionProduct
import armi.physics.neutronics.globalFlux.tests.test_globalFluxInterface
import armi.physics.neutronics.latticePhysics.tests.test_latticeInterface
import armi.reactor.converters.tests.test_axialExpansionChanger
import armi.reactor.tests.test_assemblies.buildTestAssemblies
import armi.reactor.tests.test_blocks.buildSimpleFuelBlock
import armi.reactor.tests.test_components.TestShapedComponent
import armi.reactor.tests.test_reactors.loadTestReactor
import armi.reactor.tests.test_reactors.reduceTestReactorRings
import armi.tests.ARMI_RUN_PATH
import armi.tests.ArmiTestHelper
import armi.tests.getEmptyHexReactor
import armi.tests.ISOAA_PATH
import armi.tests.mockRunLogs
import armi.tests.test_plugins.TestPlugin
import armi.tests.TEST_ROOT Some of these are only used in one place in the world and I could just copy a little test code into a downstream repo with no problems. A quick review shows that 95% of the imports of ARMI's testing features come from these few things, that could be moved to import armi.reactor.tests.test_reactors.loadTestReactor
import armi.reactor.tests.test_reactors.reduceTestReactorRings
import armi.tests.ARMI_RUN_PATH
import armi.tests.ArmiTestHelper
import armi.tests.getEmptyHexReactor
import armi.tests.ISOAA_PATH
import armi.tests.mockRunLogs
import armi.tests.TEST_ROOT |
Beta Was this translation helpful? Give feedback.
-
What do you think this would look like for ARMI? A quick glance looks like those numpy testing tools are basically assertions. The functionality used by plugins goes beyond assertions. |
Beta Was this translation helpful? Give feedback.
-
FWIW I've personally liked having the tests totally outside the API, something like
|
Beta Was this translation helpful? Give feedback.
-
You can import all of ARMI's unit test code:
I think this is the wrong paradigm. I think a more usual, and modern approach is what the NumPy team did. Instead of importing the NumPy team's unit tests, they provided a set of useful testing tools at:
The NumPy team reaps benefits from their approach:
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions