コード例 #1
0
ファイル: test_pyodide.py プロジェクト: SociOS-Linux/pyodide
def test_find_imports():

    res = find_imports(
        dedent("""
           import numpy as np
           from scipy import sparse
           import matplotlib.pyplot as plt
           """))
    assert set(res) == {"numpy", "scipy", "matplotlib"}
コード例 #2
0
def test_find_imports():

    res = find_imports("""
        import numpy as np
        from scipy import sparse
        import matplotlib.pyplot as plt
        """)
    assert set(res) == {"numpy", "scipy", "matplotlib"}

    # If there is a syntax error in the code, find_imports should return empty
    # list.
    res = find_imports("""
        import numpy as np
        from scipy import sparse
        import matplotlib.pyplot as plt
        for x in [1,2,3]
        """)
    assert res == []
コード例 #3
0
def test_find_imports():

    res = find_imports(
        dedent("""
           import six
           import numpy as np
           from scipy import sparse
           import matplotlib.pyplot as plt
           """))
    assert set(res) == {'numpy', 'scipy', 'six', 'matplotlib'}