42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | |
def test_if_browser(): |
tmp = py.test.ensuretemp("sourcebrowser") |
-> tmp.ensure("b.py").write(py.code.Source(""" |
if 1: |
def f(): |
pass |
if 0: |
def g(): |
pass |
""")) |
mod = parse_path(tmp.join("b.py")) |
assert isinstance(mod.f, Function) |
py.test.raises(AttributeError, 'mod.g') | |