-
Notifications
You must be signed in to change notification settings - Fork 6
/
test_pytest_pudb.py
59 lines (50 loc) · 1.39 KB
/
test_pytest_pudb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
pytest_plugins = "pytester"
HELP_MESSAGE = "\\?\\:help"
VARIABLES_TABLE = "V\x1b\\[0;30;47mariables:"
def test_pudb_interaction(testdir):
p1 = testdir.makepyfile("""
def test_1():
assert 0 == 1
""")
child = testdir.spawn_pytest("--pudb %s" % p1)
child.expect("PuDB")
child.expect(HELP_MESSAGE)
# Check that traceback postmortem handled
child.expect("PROCESSING EXCEPTION")
child.expect(VARIABLES_TABLE)
child.sendeof()
def test_pudb_set_trace_integration(testdir):
p1 = testdir.makepyfile("""
def test_1():
import pudb
pudb.set_trace()
assert 1
""")
child = testdir.spawn_pytest(p1)
child.expect("PuDB")
child.expect(HELP_MESSAGE)
child.expect(VARIABLES_TABLE)
child.sendeof()
def test_pu_db_integration(testdir):
p1 = testdir.makepyfile("""
def test_1():
import pudb
pu.db
assert 1
""")
child = testdir.spawn_pytest(p1)
child.expect("PuDB")
child.expect(HELP_MESSAGE)
child.expect(VARIABLES_TABLE)
child.sendeof()
def test_pudb_b_integration(testdir):
p1 = testdir.makepyfile("""
def test_1():
import pudb.b
assert 1
""")
child = testdir.spawn_pytest(p1)
child.expect("PuDB")
child.expect(HELP_MESSAGE)
child.expect(VARIABLES_TABLE)
child.sendeof()