1- import  datajoint  as  dj 
21from  datajoint  import  errors 
32from  pytest  import  raises 
43from  datajoint .dependencies  import  unite_master_parts 
5- from  .schema  import  * 
64
75
86def  test_unite_master_parts ():
@@ -50,22 +48,10 @@ def test_unite_master_parts():
5048    ]
5149
5250
53- def  test_nullable_dependency (schema_any ):
51+ def  test_nullable_dependency (thing_tables ):
5452    """test nullable unique foreign key""" 
5553    # Thing C has a nullable dependency on B whose primary key is composite 
56-     a  =  ThingA ()
57-     b  =  ThingB ()
58-     c  =  ThingC ()
59- 
60-     # clear previous contents if any. 
61-     c .delete_quick ()
62-     b .delete_quick ()
63-     a .delete_quick ()
64- 
65-     a .insert (dict (a = a ) for  a  in  range (7 ))
66- 
67-     b .insert1 (dict (b1 = 1 , b2 = 1 , b3 = 100 ))
68-     b .insert1 (dict (b1 = 1 , b2 = 2 , b3 = 100 ))
54+     _ , _ , c , _ , _  =  thing_tables 
6955
7056    # missing foreign key attributes = ok 
7157    c .insert1 (dict (a = 0 ))
@@ -79,23 +65,10 @@ def test_nullable_dependency(schema_any):
7965    assert  len (c ) ==  len (c .fetch ()) ==  5 
8066
8167
82- def  test_unique_dependency (schema_any ):
68+ def  test_unique_dependency (thing_tables ):
8369    """test nullable unique foreign key""" 
84- 
8570    # Thing C has a nullable dependency on B whose primary key is composite 
86-     a  =  ThingA ()
87-     b  =  ThingB ()
88-     c  =  ThingC ()
89- 
90-     # clear previous contents if any. 
91-     c .delete_quick ()
92-     b .delete_quick ()
93-     a .delete_quick ()
94- 
95-     a .insert (dict (a = a ) for  a  in  range (7 ))
96- 
97-     b .insert1 (dict (b1 = 1 , b2 = 1 , b3 = 100 ))
98-     b .insert1 (dict (b1 = 1 , b2 = 2 , b3 = 100 ))
71+     _ , _ , c , _ , _  =  thing_tables 
9972
10073    c .insert1 (dict (a = 0 , b1 = 1 , b2 = 1 ))
10174    # duplicate foreign key attributes = not ok 
0 commit comments