Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion reframe/core/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class _UndefinedType:
'''Custom type to flag a variable as undefined.'''
__slots__ = ()

def __deepcopy__(self, memo):
return self


_Undefined = _UndefinedType()

Expand Down Expand Up @@ -116,7 +119,7 @@ def join(self, other, cls):
f'parent classes of class {cls.__qualname__!r}'
)

self.vars[key] = var
self.vars[key] = copy.deepcopy(var)

# Carry over the set of injected variables
self._injected_vars.update(other._injected_vars)
Expand Down
5 changes: 5 additions & 0 deletions unittests/test_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,13 @@ def __init__(self):
class Bar(Base):
pass

class Baz(Base):
my_var = []

assert Base().my_var == [1, 2]
assert Foo().my_var == [1, 2, 3]
assert Bar().my_var == [1, 2]
assert Baz().my_var == []


def test_variable_access():
Expand Down