コード例 #1
0
def test_all_in_class_non_recognition():
    mod = fromText('''
    class C:
        __all__ = ['f']
    ''')
    astbuilder.findAll(mod.ast, mod)
    assert mod.all is None
コード例 #2
0
ファイル: test_astbuilder.py プロジェクト: jelmer/pydoctor
def test_all_in_class_non_recognition():
    mod = fromText('''
    class C:
        __all__ = ['f']
    ''')
    astbuilder.findAll(mod.ast, mod)
    assert mod.all is None
コード例 #3
0
ファイル: test_astbuilder.py プロジェクト: jelmer/pydoctor
def test_all_recognition():
    mod = fromText('''
    def f():
        pass
    __all__ = ['f']
    ''')
    astbuilder.findAll(mod.ast, mod)
    assert mod.all == ['f']
コード例 #4
0
def test_all_recognition():
    mod = fromText('''
    def f():
        pass
    __all__ = ['f']
    ''')
    astbuilder.findAll(mod.ast, mod)
    assert mod.all == ['f']
コード例 #5
0
ファイル: test_astbuilder.py プロジェクト: moshez/pydoctor
def test_all_recognition(systemcls):
    mod = fromText('''
    def f():
        pass
    __all__ = ['f']
    ''', systemcls=systemcls)
    astbuilder.findAll(mod.ast, mod)
    assert mod.all == ['f']
    assert '__all__' not in mod.contents
コード例 #6
0
def test_all_in_class_non_recognition(systemcls: Type[model.System]) -> None:
    ast = astbuilder._parse(
        textwrap.dedent('''
    class C:
        __all__ = ['f']
    '''))
    mod = fromAST(ast, systemcls=systemcls)
    astbuilder.findAll(ast, mod)
    assert mod.all is None
コード例 #7
0
def test_all_recognition(systemcls: Type[model.System]) -> None:
    ast = astbuilder._parse(
        textwrap.dedent('''
    def f():
        pass
    __all__ = ['f']
    '''))
    mod = fromAST(ast, systemcls=systemcls)
    astbuilder.findAll(ast, mod)
    assert mod.all == ['f']
    assert '__all__' not in mod.contents