Exemple #1
0
def test_no_breakpoints():
    visitor = DebugStatementParser()
    visitor.visit(ast.parse('import os\nfrom foo import bar\n'))
    assert visitor.breakpoints == []
Exemple #2
0
def test_finds_debug_import_from_import():
    visitor = DebugStatementParser()
    visitor.visit(ast.parse('from pudb import set_trace; set_trace()'))
    assert visitor.breakpoints == [Debug(1, 0, 'pudb', 'imported')]
Exemple #3
0
def test_finds_breakpoint():
    visitor = DebugStatementParser()
    visitor.visit(ast.parse('breakpoint()'))
    assert visitor.breakpoints == [Debug(1, 0, 'breakpoint', 'called')]
Exemple #4
0
def test_finds_debug_import_attribute_access():
    visitor = DebugStatementParser()
    visitor.visit(ast.parse('import ipdb; ipdb.set_trace()'))
    assert visitor.breakpoints == [Debug(1, 0, 'ipdb', 'imported')]
def test_finds_breakpoint():
    visitor = DebugStatementParser()
    visitor.visit(ast.parse('breakpoint()'))
    assert visitor.breakpoints == [Debug(1, 0, 'breakpoint', 'called')]
def test_finds_debug_import_from_import():
    visitor = DebugStatementParser()
    visitor.visit(ast.parse('from pudb import set_trace; set_trace()'))
    assert visitor.breakpoints == [Debug(1, 0, 'pudb', 'imported')]
def test_finds_debug_import_attribute_access():
    visitor = DebugStatementParser()
    visitor.visit(ast.parse('import ipdb; ipdb.set_trace()'))
    assert visitor.breakpoints == [Debug(1, 0, 'ipdb', 'imported')]
def test_no_breakpoints():
    visitor = DebugStatementParser()
    visitor.visit(ast.parse('import os\nfrom foo import bar\n'))
    assert visitor.breakpoints == []