Skip to content

Commit

Permalink
Format with black==24.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ethho committed Sep 22, 2024
1 parent 2aab3e8 commit 668b9bd
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions tests/test_declare.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,17 +394,22 @@ class Table_With_Underscores(dj.Manual):

def test_hidden_attributes_default_value():
config_val = config.get("enable_hidden_attributes")
assert config_val is not None and not config_val, \
"Default value for enable_hidden_attributes is not False"
assert (
config_val is not None and not config_val
), "Default value for enable_hidden_attributes is not False"


def test_hidden_attributes_enabled(enable_hidden_attributes, schema_any):
orig_config_val = config.get("enable_hidden_attributes")
config["enable_hidden_attributes"] = True

msg = f"{Experiment().heading._attributes=}"
assert any(a.name.endswith("_timestamp") for a in Experiment().heading._attributes.values()), msg
assert any(a.name.startswith("_") for a in Experiment().heading._attributes.values()), msg
assert any(
a.name.endswith("_timestamp") for a in Experiment().heading._attributes.values()
), msg
assert any(
a.name.startswith("_") for a in Experiment().heading._attributes.values()
), msg
assert any(a.is_hidden for a in Experiment().heading._attributes.values()), msg
assert not any(a.is_hidden for a in Experiment().heading.attributes.values()), msg

Expand All @@ -417,8 +422,12 @@ def test_hidden_attributes_disabled(disable_hidden_attributes, schema_any):
config["enable_hidden_attributes"] = False

msg = f"{Experiment().heading._attributes=}"
assert not any(a.name.endswith("_timestamp") for a in Experiment().heading._attributes.values()), msg
assert not any(a.name.startswith("_") for a in Experiment().heading._attributes.values()), msg
assert not any(
a.name.endswith("_timestamp") for a in Experiment().heading._attributes.values()
), msg
assert not any(
a.name.startswith("_") for a in Experiment().heading._attributes.values()
), msg
assert not any(a.is_hidden for a in Experiment().heading._attributes.values()), msg
assert not any(a.is_hidden for a in Experiment().heading.attributes.values()), msg

Expand Down

0 comments on commit 668b9bd

Please sign in to comment.