77
88
99@pytest .fixture (scope = "function" )
10- def enable_hidden_attributes ():
11- orig_config_val = config .get ("enable_hidden_attributes " )
12- config ["enable_hidden_attributes " ] = True
10+ def enable_add_hidden_timestamp ():
11+ orig_config_val = config .get ("add_hidden_timestamp " )
12+ config ["add_hidden_timestamp " ] = True
1313 yield
1414 if orig_config_val is not None :
15- config ["enable_hidden_attributes " ] = orig_config_val
15+ config ["add_hidden_timestamp " ] = orig_config_val
1616
1717
1818@pytest .fixture (scope = "function" )
19- def disable_hidden_attributes ():
20- orig_config_val = config .get ("enable_hidden_attributes " )
21- config ["enable_hidden_attributes " ] = False
19+ def disable_add_hidden_timestamp ():
20+ orig_config_val = config .get ("add_hidden_timestamp " )
21+ config ["add_hidden_timestamp " ] = False
2222 yield
2323 if orig_config_val is not None :
24- config ["enable_hidden_attributes " ] = orig_config_val
24+ config ["add_hidden_timestamp " ] = orig_config_val
2525
2626
2727def test_schema_decorator (schema_any ):
@@ -392,17 +392,15 @@ class Table_With_Underscores(dj.Manual):
392392 schema_any (Table_With_Underscores )
393393
394394
395- def test_hidden_attributes_default_value ():
396- config_val = config .get ("enable_hidden_attributes " )
395+ def test_add_hidden_timestamp_default_value ():
396+ config_val = config .get ("add_hidden_timestamp " )
397397 assert (
398398 config_val is not None and not config_val
399- ), "Default value for enable_hidden_attributes is not False"
399+ ), "Default value for add_hidden_timestamp is not False"
400400
401401
402- def test_hidden_attributes_enabled (enable_hidden_attributes , schema_any ):
403- orig_config_val = config .get ("enable_hidden_attributes" )
404- config ["enable_hidden_attributes" ] = True
405-
402+ def test_add_hidden_timestamp_enabled (enable_add_hidden_timestamp , schema_any ):
403+ assert config ["add_hidden_timestamp" ], "add_hidden_timestamp is not enabled"
406404 msg = f"{ Experiment ().heading ._attributes = } "
407405 assert any (
408406 a .name .endswith ("_timestamp" ) for a in Experiment ().heading ._attributes .values ()
@@ -413,14 +411,9 @@ def test_hidden_attributes_enabled(enable_hidden_attributes, schema_any):
413411 assert any (a .is_hidden for a in Experiment ().heading ._attributes .values ()), msg
414412 assert not any (a .is_hidden for a in Experiment ().heading .attributes .values ()), msg
415413
416- if orig_config_val is not None :
417- config ["enable_hidden_attributes" ] = orig_config_val
418-
419-
420- def test_hidden_attributes_disabled (disable_hidden_attributes , schema_any ):
421- orig_config_val = config .get ("enable_hidden_attributes" )
422- config ["enable_hidden_attributes" ] = False
423414
415+ def test_add_hidden_timestamp_disabled (disable_add_hidden_timestamp , schema_any ):
416+ assert not config ["add_hidden_timestamp" ], "expected add_hidden_timestamp to be False"
424417 msg = f"{ Experiment ().heading ._attributes = } "
425418 assert not any (
426419 a .name .endswith ("_timestamp" ) for a in Experiment ().heading ._attributes .values ()
@@ -430,6 +423,3 @@ def test_hidden_attributes_disabled(disable_hidden_attributes, schema_any):
430423 ), msg
431424 assert not any (a .is_hidden for a in Experiment ().heading ._attributes .values ()), msg
432425 assert not any (a .is_hidden for a in Experiment ().heading .attributes .values ()), msg
433-
434- if orig_config_val is not None :
435- config ["enable_hidden_attributes" ] = orig_config_val
0 commit comments