Skip to content

UnitTests conflict: UnitTestMCNPInput.py conflict with UnitTestMCNPMaterial.py #58

@gvozdila

Description

@gvozdila

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions