Skip to content

Commit

Permalink
Fix subparameter dataclass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WarmCyan committed Jul 31, 2023
1 parent 955ae99 commit 7cb5a7e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/test_hashing.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ class MyExperimentArgs2(cf.ExperimentParameters):
def test_new_ignored_param_sub_dataclass():
"""Adding a new (none-ignored) parameter to a subdatclass should not change the overall hash."""

@dataclass
@dataclass(unsafe_hash=True)
class SubArgs1:
a: int = 0

@dataclass
@dataclass(unsafe_hash=True)
class SubArgs2:
a: int = 0
b: int = 5
Expand Down Expand Up @@ -186,7 +186,7 @@ def test_custom_hashing_composed_dataclasses():
"""Composing multiple dataclasses into an experimentargs class should allow setting
hashing functions on the other dataclasses."""

@dataclass
@dataclass(unsafe_hash=True)
class NormalDC:
c: int = 5
d: int = 6
Expand All @@ -213,7 +213,7 @@ def test_composed_dataclasses_diff():
"""Composing multiple dataclasses into an experimentargs class should correctly
change the hash if those sub arguments are different."""

@dataclass
@dataclass(unsafe_hash=True)
class NormalDC:
c: int = 5
d: int = 6
Expand Down Expand Up @@ -371,7 +371,7 @@ def test_subdataclass_val_in_str_rep_correct():
"""The string hash rep of a dataclass with sub-dataclasses should correctly
represent the sub dataclasses the same way."""

@dataclass
@dataclass(unsafe_hash=True)
class NormalDC:
c: int = 5
d: int = 6
Expand All @@ -396,7 +396,7 @@ def test_none_hash_subdataclass_val_in_str_rep_correct():
represent the sub dataclasses the same way even if the sub dataclass is in the
ignored parameters."""

@dataclass
@dataclass(unsafe_hash=True)
class NormalDC:
c: int = 5
d: int = 6
Expand Down

0 comments on commit 7cb5a7e

Please sign in to comment.