diff --git a/tests/python/opinfo_framework.py b/tests/python/opinfo_framework.py index db604bda936..fa62c94d214 100644 --- a/tests/python/opinfo_framework.py +++ b/tests/python/opinfo_framework.py @@ -74,11 +74,10 @@ def __init__(self, opinfos, *, scope=None): atexit_serde_check() - # Replicate create_op_test.__init__ to have correct scope - self.opinfos = opinfos - - # Acquires the caller's global scope + # Acquires the caller's global scope. + # Initialize here to get the correct scope. if scope is None: previous_frame = inspect.currentframe().f_back scope = previous_frame.f_globals - self.scope = scope + + super().__init__(opinfos, scope=scope)