Skip to content

Commit cd2f1f5

Browse files
committed
Fix failing tests
1 parent 3bce7a6 commit cd2f1f5

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

tests/test_erd.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import datajoint as dj
2-
from .schema_simple import LOCALS_SIMPLE, A, B, D, E, L, OutfitLaunch
2+
from .schema_simple import LOCALS_SIMPLE, A, B, D, E, G, L, OutfitLaunch
33
from .schema_advanced import *
44

55

@@ -20,7 +20,7 @@ def test_dependencies(schema_simp):
2020
assert set(D().parents(primary=True)) == set([A.full_table_name])
2121
assert set(D().parents(primary=False)) == set([L.full_table_name])
2222
assert set(deps.descendants(L.full_table_name)).issubset(
23-
cls.full_table_name for cls in (L, D, E, E.F)
23+
cls.full_table_name for cls in (L, D, E, E.F, E.G, E.H, G)
2424
)
2525

2626

@@ -38,10 +38,14 @@ def test_erd_algebra(schema_simp):
3838
erd3 = erd1 * erd2
3939
erd4 = (erd0 + E).add_parts() - B - E
4040
assert erd0.nodes_to_show == set(cls.full_table_name for cls in [B])
41-
assert erd1.nodes_to_show == set(cls.full_table_name for cls in (B, B.C, E, E.F))
41+
assert erd1.nodes_to_show == set(
42+
cls.full_table_name for cls in (B, B.C, E, E.F, E.G, E.H, G)
43+
)
4244
assert erd2.nodes_to_show == set(cls.full_table_name for cls in (A, B, D, E, L))
4345
assert erd3.nodes_to_show == set(cls.full_table_name for cls in (B, E))
44-
assert erd4.nodes_to_show == set(cls.full_table_name for cls in (B.C, E.F))
46+
assert erd4.nodes_to_show == set(
47+
cls.full_table_name for cls in (B.C, E.F, E.G, E.H)
48+
)
4549

4650

4751
def test_repr_svg(schema_adv):

tests/test_schema.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def test_list_tables(schema_simp):
184184
"""
185185
https://github.com/datajoint/datajoint-python/issues/838
186186
"""
187-
assert set(
187+
expected = set(
188188
[
189189
"reserved_word",
190190
"#l",
@@ -194,6 +194,9 @@ def test_list_tables(schema_simp):
194194
"__b__c",
195195
"__e",
196196
"__e__f",
197+
"__e__g",
198+
"__e__h",
199+
"__g",
197200
"#outfit_launch",
198201
"#outfit_launch__outfit_piece",
199202
"#i_j",
@@ -207,7 +210,9 @@ def test_list_tables(schema_simp):
207210
"profile",
208211
"profile__website",
209212
]
210-
) == set(schema_simp.list_tables())
213+
)
214+
actual = set(schema_simp.list_tables())
215+
assert actual == expected, f"Missing from list_tables(): {expected - actual}"
211216

212217

213218
def test_schema_save_any(schema_any):

0 commit comments

Comments
 (0)