Skip to content

Commit 6c3dee6

Browse files
committed
fixed spacing for GH actions
1 parent 530ff87 commit 6c3dee6

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

tests/unit/type_safe/type_safe_core/_regression/test_Type_Safe__Dict__regression.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from osbot_utils.type_safe.primitives.domains.identifiers.safe_str.Safe_Str__Id import Safe_Str__Id
1313
from osbot_utils.type_safe.type_safe_core.collections.Type_Safe__Dict import Type_Safe__Dict
1414
from osbot_utils.type_safe.type_safe_core.collections.Type_Safe__List import Type_Safe__List
15+
from osbot_utils.utils.Env import not_in_github_action
1516
from osbot_utils.utils.Objects import base_classes
1617
from osbot_utils.type_safe.primitives.domains.identifiers.Safe_Id import Safe_Id
1718
from osbot_utils.type_safe.Type_Safe import Type_Safe
@@ -415,18 +416,20 @@ class Container(Type_Safe):
415416
# "},\n + }") # BUG
416417
assert container.json() == {'nested': {'key': {Status.ACTIVE: 100}}} # this works due to auto conversion of enum into it's string value
417418
assert container.json() == {'nested': {'key': {'active': 100}}} # FIXED: this is what we wanted to happen
418-
error_message = ("assert {'nested': {'key': {'active': 100}}} == {}\n \n "
419-
"Left contains 1 more item:\n "
420-
"{'nested': {'key': {'active': 100}}}\n \n " # FIXED: now we get the 'active' string (instead of the Enum representation)
421-
"Full diff:\n - {}\n + {\n + 'nested': "
422-
"{\n + 'key': {\n + "
423-
"'active': 100,\n + },\n + },\n + }")
424-
with pytest.raises(AssertionError, match=re.escape(error_message)):
425-
assert container.json() == {} # FIXED this is the error message we should get
426-
427-
error_message_2 = 'assert __(nested=__(key=__(active=100))) == __()\n '
428-
with pytest.raises(AssertionError, match=re.escape(error_message_2)):
429-
assert container.obj() == __()
419+
420+
if not_in_github_action(): # GH actions has different spacing
421+
error_message = ("assert {'nested': {'key': {'active': 100}}} == {}\n \n "
422+
"Left contains 1 more item:\n "
423+
"{'nested': {'key': {'active': 100}}}\n \n " # FIXED: now we get the 'active' string (instead of the Enum representation)
424+
"Full diff:\n - {}\n + {\n + 'nested': "
425+
"{\n + 'key': {\n + "
426+
"'active': 100,\n + },\n + },\n + }")
427+
with pytest.raises(AssertionError, match=re.escape(error_message)):
428+
assert container.json() == {} # FIXED this is the error message we should get
429+
430+
error_message_2 = 'assert __(nested=__(key=__(active=100))) == __()\n '
431+
with pytest.raises(AssertionError, match=re.escape(error_message_2)):
432+
assert container.obj() == __()
430433

431434
# couple more edge cases tests
432435
json_str = json.dumps(container.json())

0 commit comments

Comments
 (0)