How to use the jishaku.repl.get_parent_var function in jishaku

To help you get started, we’ve selected a few jishaku examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Gorialis / jishaku / tests / test_repl.py View on Github external
def upper_method():
    return get_parent_var('hidden_variable')
github Gorialis / jishaku / tests / test_repl.py View on Github external
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