Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli committed Jun 2, 2020
1 parent 3d7a30d commit 4fc330a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/models/test_hparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ class LocalVariableModel1(EvalModelTemplate):
""" This model has the super().__init__() call at the end. """

def __init__(self, arg1, arg2, *args, **kwargs):
self.argument1 = arg1
arg1 = None # arg2 intentionally not set
self.argument1 = arg1 # arg2 intentionally not set
arg1 = 'overwritten'
local_var = 1234
super().__init__(*args, **kwargs) # this is intentionally here at the end

Expand All @@ -151,7 +151,7 @@ class LocalVariableModel2(EvalModelTemplate):
def __init__(self, arg1, arg2, *args, **kwargs):
super().__init__(*args, **kwargs)
self.argument1 = arg1 # arg2 intentionally not set
arg1 = None
arg1 = 'overwritten'
local_var = 1234
self.auto_collect_arguments() # this is intentionally here at the end

Expand All @@ -164,5 +164,5 @@ def test_collect_init_arguments_with_local_vars(cls):
""" Tests that only the arguments are collected and not local variables. """
model = cls(arg1=1, arg2=2)
assert 'local_var' not in model.module_arguments
assert model.module_arguments['arg1'] is None
assert model.module_arguments['arg1'] == 'overwritten'
assert model.module_arguments['arg2'] == 2

0 comments on commit 4fc330a

Please sign in to comment.