Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def upper_method():
return get_parent_var('hidden_variable')
def test_scope_var():
for _ in range(10):
hidden_variable = random.randint(0, 1000000)
test = upper_method()
assert hidden_variable == test
del hidden_variable
test = upper_method()
assert test is None
assert get_parent_var('pytest', global_ok=True) == pytest