Skip to content

Commit 03e866b

Browse files
committed
Fix test_types_repository_separation test
Previous test was faulty as it relied on being call before any other test initiated ODataV2.Types.
1 parent aa68a10 commit 03e866b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1919
### Fixed
2020
- make sure configured error policies are applied for Annotations referencing
2121
unknown type/member - Martin Miksik
22+
- Race condition in `test_types_repository_separation` - Martin Miksik
2223

2324
## [1.3.0]
2425

tests/test_model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def primitive_types() -> List[Typ]:
6363

6464

6565
def test_types_repository_separation():
66+
ODataV2.Types = dict()
6667

6768
class TestODATA(ODATAVersion):
6869
@staticmethod
@@ -74,11 +75,12 @@ def primitive_types() -> List['Typ']:
7475
config_test = Config(TestODATA)
7576
config_v2 = Config(ODataV2)
7677

77-
assert TestODATA.Types is None
78+
assert not TestODATA.Types
7879
assert TestODATA.Types == ODataV2.Types
7980

8081
# Build type repository by initial call
8182
Types.from_name('PrimitiveType', config_test)
8283
Types.from_name('Edm.Int16', config_v2)
8384

85+
assert ODataV2.Types
8486
assert TestODATA.Types != ODataV2.Types

0 commit comments

Comments
 (0)