How to use the removestar.removestar.star_imports function in removestar

To help you get started, we’ve selected a few removestar 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 asmeurer / removestar / removestar / test_removestar.py View on Github external
def test_star_imports():
    for code in [code_mod1, code_mod2, code_mod3]:
        stars = star_imports(Checker(ast.parse(code)))
        assert stars == []

    stars = star_imports(Checker(ast.parse(code_mod4)))
    assert stars == ['.mod1', '.mod2']

    stars = star_imports(Checker(ast.parse(code_submod1)))
    assert stars == ['..mod1', '..mod2']