parent
1dafcc6b37
commit
96ec12902d
|
@ -1,3 +1,8 @@
|
||||||
|
try:
|
||||||
|
import Queue as queue
|
||||||
|
except ImportError:
|
||||||
|
import queue
|
||||||
|
|
||||||
import py
|
import py
|
||||||
from py.__.code.code import FormattedExcinfo, ReprExceptionInfo
|
from py.__.code.code import FormattedExcinfo, ReprExceptionInfo
|
||||||
|
|
||||||
|
@ -232,10 +237,9 @@ def test_excinfo_no_sourcecode():
|
||||||
assert s == " File '<string>':1 in <module>\n ???\n"
|
assert s == " File '<string>':1 in <module>\n ???\n"
|
||||||
|
|
||||||
def test_entrysource_Queue_example():
|
def test_entrysource_Queue_example():
|
||||||
import Queue
|
|
||||||
try:
|
try:
|
||||||
Queue.Queue().get(timeout=0.001)
|
queue.Queue().get(timeout=0.001)
|
||||||
except Queue.Empty:
|
except queue.Empty:
|
||||||
excinfo = py.code.ExceptionInfo()
|
excinfo = py.code.ExceptionInfo()
|
||||||
entry = excinfo.traceback[-1]
|
entry = excinfo.traceback[-1]
|
||||||
source = entry.getsource()
|
source = entry.getsource()
|
||||||
|
@ -244,15 +248,14 @@ def test_entrysource_Queue_example():
|
||||||
assert s.startswith("def get")
|
assert s.startswith("def get")
|
||||||
|
|
||||||
def test_codepath_Queue_example():
|
def test_codepath_Queue_example():
|
||||||
import Queue
|
|
||||||
try:
|
try:
|
||||||
Queue.Queue().get(timeout=0.001)
|
queue.Queue().get(timeout=0.001)
|
||||||
except Queue.Empty:
|
except queue.Empty:
|
||||||
excinfo = py.code.ExceptionInfo()
|
excinfo = py.code.ExceptionInfo()
|
||||||
entry = excinfo.traceback[-1]
|
entry = excinfo.traceback[-1]
|
||||||
path = entry.path
|
path = entry.path
|
||||||
assert isinstance(path, py.path.local)
|
assert isinstance(path, py.path.local)
|
||||||
assert path.basename == "Queue.py"
|
assert path.basename.lower() == "queue.py"
|
||||||
assert path.check()
|
assert path.check()
|
||||||
|
|
||||||
class TestFormattedExcinfo:
|
class TestFormattedExcinfo:
|
||||||
|
|
Loading…
Reference in New Issue