Skip to content

Commit

Permalink
Add more global_object.map._clear()
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSazonov committed Oct 31, 2024
1 parent efc5be1 commit be8aead
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/unit_tests/Components/test_SpaceGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ def test_SpaceGroup_fromPars_HM_noSpace(sg_in):
f_value[0] = known_conversions[f_value[0]]
assert getattr(f, g_item) in f_value


# FAILED tests/unit_tests/Components/test_SpaceGroup.py::test_SpaceGroup_fromPars_HM_noSpace[P-42c] - RuntimeError: dictionary changed size during iteration
# Adding map clear because of these errors happening ONLY in 3.12
@pytest.mark.parametrize('sg_in', SYM, ids=[sg['universal_h_m'] for sg in SYM])
def test_SpaceGroup_fromPars_HM_noSpace(sg_in):
global_object.map._clear()
if sg_in['hermann_mauguin'] in ['C2eb', 'R12/c1("rhombohedral"setting)', 'B1211', 'B121/m1', 'P4bm',
'C1c1', 'Pmc21', 'Cmm2', 'P121/c1', 'Pmma', 'P12/c1', 'Pmmm', 'P1211', 'Pnma']:
return # This is a known issue
Expand Down
4 changes: 4 additions & 0 deletions tests/unit_tests/io/test_star.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytest

from easyscience import global_object
from easyscience.models.polynomial import Line
from easyscience.Objects.Groups import BaseCollection
from easyscience.Objects.Variable import Descriptor
Expand Down Expand Up @@ -58,7 +59,10 @@ def test_ItemHolder_with_error(value, error, precision, expected):
"1.234560e-05 @5",
],
)
# FAILED tests/unit_tests/io/test_star.py::test_ItemHolder_fixed[1.234560e-01 @3-fixed] - RuntimeError: dictionary changed size during iteration
# Adding map clear because of these errors happening ONLY in 3.12
def test_ItemHolder_fixed(fixed, value, precision, expected):
global_object.map._clear()
p = Parameter("p", value, fixed=fixed)
s = ItemHolder(p, decimal_places=precision)
if not p.fixed:
Expand Down

0 comments on commit be8aead

Please sign in to comment.