csg2csg icon indicating copy to clipboard operation
csg2csg copied to clipboard

UnitTests conflict: UnitTestMCNPInput.py conflict with UnitTestMCNPMaterial.py

Open gvozdila opened this issue 5 years ago • 0 comments

There are two ways to run all tests:

  1. with ./run_tests -- this one passed
  2. with csg2csg/test> python3 -m unittest discover -p 'Unit*.py' (or by IDE, ERIC6 for example) in case 2) there are errors: ====================================================================== FAIL: test_mcnp_material (UnitTestMCNPMaterial.TestMCNPMaterial)

Traceback (most recent call last): File "/mnt/newdisk1/work/build/csg2csg/csg2csg/test/UnitTestMCNPMaterial.py", line 29, in test_mcnp_material self.assertEqual(len(matcard.xsid_dictionary),2) AssertionError: 4 != 2

====================================================================== FAIL: test_mcnp_material_with_duplicates (UnitTestMCNPMaterial.TestMCNPMaterial)

Traceback (most recent call last): File "/mnt/newdisk1/work/build/csg2csg/csg2csg/test/UnitTestMCNPMaterial.py", line 55, in test_mcnp_material_with_duplicates self.assertEqual(len(matcard.xsid_dictionary),2) AssertionError: 4 != 2

====================================================================== FAIL: test_serpent_material (UnitTestSerpentMaterial.TestSerpentMaterial)

Traceback (most recent call last): File "/mnt/newdisk1/work/build/csg2csg/csg2csg/test/UnitTestSerpentMaterial.py", line 31, in test_serpent_material self.assertEqual(len(matcard.xsid_dictionary),2) AssertionError: 4 != 2

Looks like somehow UnitTestMCNPInput change state of system before running UnitTestSerpentMaterial and UnitTestMCNPMaterial. And it makes tests to fail.

gvozdila avatar Oct 20 '20 08:10 gvozdila