Skip to content

Commit 1727b66

Browse files
committed
improved gh action test performance
1 parent 4b4a911 commit 1727b66

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/unit/type_safe/type_safe_core/steps/test_Type_Safe__Step__From_Json.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from enum import Enum
66
from typing import Dict, List, Set, Any, Optional, ForwardRef
77
from unittest import TestCase
8+
from osbot_utils.utils.Env import in_github_action
89
from osbot_utils.type_safe.Type_Safe import Type_Safe
910
from osbot_utils.type_safe.primitives.domains.cryptography.safe_str.Safe_Str__Hash import Safe_Str__Hash
1011
from osbot_utils.type_safe.primitives.domains.files.safe_str.Safe_Str__File__Path import Safe_Str__File__Path
@@ -521,7 +522,10 @@ class Large_Class(Type_Safe):
521522
elapsed = time.time() - start
522523

523524
assert len(obj.items) == 1000
524-
assert elapsed < 0.01 # Should complete in under 10ms
525+
if in_github_action():
526+
assert elapsed < 0.05 # in GH Actions this is about ~10ms
527+
else:
528+
assert elapsed < 0.01 # on dev laptop this is ~2ms
525529

526530
def test__forward_ref_in_list_works(self): # Forward refs in List work correctly """
527531

0 commit comments

Comments
 (0)