@@ -35,11 +35,11 @@ def schema_empty_module(schema_any, schema_empty):
3535 classes in schema_any, after running `spawn_missing_classes`.
3636 """
3737 namespace_dict = {
38- '_' : schema_any ,
39- ' schema' : schema_empty ,
40- ' Ephys' : Ephys ,
38+ "_" : schema_any ,
39+ " schema" : schema_empty ,
40+ " Ephys" : Ephys ,
4141 }
42- module = types .ModuleType (' schema_empty' )
42+ module = types .ModuleType (" schema_empty" )
4343
4444 # Add classes to the module's namespace
4545 for k , v in namespace_dict .items ():
@@ -50,11 +50,10 @@ def schema_empty_module(schema_any, schema_empty):
5050
5151@pytest .fixture
5252def schema_empty (connection_test , schema_any ):
53- context = {
54- ** schema .LOCALS_ANY ,
55- "Ephys" : Ephys
56- }
57- schema_empty = dj .Schema (PREFIX + "_test1" , context = context , connection = connection_test )
53+ context = {** schema .LOCALS_ANY , "Ephys" : Ephys }
54+ schema_empty = dj .Schema (
55+ PREFIX + "_test1" , context = context , connection = connection_test
56+ )
5857 schema_empty (Ephys )
5958 # load the rest of the classes
6059 schema_empty .spawn_missing_classes (context = context )
@@ -93,12 +92,18 @@ def test_namespace_population(schema_empty_module):
9392 setattr (schema_empty_module , k , v )
9493
9594 for name , rel in getmembers (schema , relation_selector ):
96- assert hasattr (schema_empty_module , name ), "{name} not found in schema_empty" .format (name = name )
97- assert rel .__base__ is getattr (schema_empty_module , name ).__base__ , "Wrong tier for {name}" .format (name = name )
95+ assert hasattr (
96+ schema_empty_module , name
97+ ), "{name} not found in schema_empty" .format (name = name )
98+ assert (
99+ rel .__base__ is getattr (schema_empty_module , name ).__base__
100+ ), "Wrong tier for {name}" .format (name = name )
98101
99102 for name_part in dir (rel ):
100103 if name_part [0 ].isupper () and part_selector (getattr (rel , name_part )):
101- assert getattr (rel , name_part ).__base__ is dj .Part , "Wrong tier for {name}" .format (name = name_part )
104+ assert (
105+ getattr (rel , name_part ).__base__ is dj .Part
106+ ), "Wrong tier for {name}" .format (name = name_part )
102107
103108
104109def test_undecorated_table ():
@@ -125,7 +130,6 @@ class A(dj.Manual):
125130 class B (dj .Part ):
126131 definition = ...
127132
128-
129133 with pytest .raises (dj .DataJointError ):
130134 schema_any (A .B )
131135 schema_any (A )
@@ -136,7 +140,9 @@ def test_unauthorized_database(db_creds_test):
136140 an attempt to create a database to which user has no privileges should raise an informative exception.
137141 """
138142 with pytest .raises (dj .DataJointError ):
139- dj .Schema ("unauthorized_schema" , connection = dj .conn (reset = True , ** db_creds_test ))
143+ dj .Schema (
144+ "unauthorized_schema" , connection = dj .conn (reset = True , ** db_creds_test )
145+ )
140146
141147
142148def test_drop_database (db_creds_test ):
@@ -150,9 +156,7 @@ def test_drop_database(db_creds_test):
150156
151157
152158def test_overlapping_name (connection_test ):
153- test_schema = dj .Schema (
154- PREFIX + "_overlapping_schema" , connection = connection_test
155- )
159+ test_schema = dj .Schema (PREFIX + "_overlapping_schema" , connection = connection_test )
156160
157161 @test_schema
158162 class Unit (dj .Manual ):
0 commit comments