Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-hitonami committed Jan 5, 2022
1 parent 4ba2ed7 commit 18f990b
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions tests/python/test_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ def foo():
if version_info < (3, 8):
msg = f"""\
On line {frameinfo.lineno + 5} of file "{frameinfo.filename}":
aaaa(111,
TypeError: 'NoneType' object is not callable"""
aaaa(111,"""
else:
msg = f"""\
On line {frameinfo.lineno + 5} of file "{frameinfo.filename}":
Expand All @@ -35,10 +34,9 @@ def foo():
23)
^^^
TypeError: 'NoneType' object is not callable"""
^^^"""
print(e.value.args[0])
assert e.value.args[0] == msg
assert e.value.args[0][:len(msg)] == msg


@ti.test()
Expand Down Expand Up @@ -68,8 +66,7 @@ def foo():
On line {lineno + 9} of file "{file}":
baz()
On line {lineno + 5} of file "{file}":
t()
TypeError: 'NoneType' object is not callable"""
t()"""
else:
msg = f"""\
On line {lineno + 13} of file "{file}":
Expand All @@ -80,10 +77,9 @@ def foo():
^^^^^
On line {lineno + 5} of file "{file}":
t()
^^^
TypeError: 'NoneType' object is not callable"""
^^^"""
print(e.value.args[0])
assert e.value.args[0] == msg
assert e.value.args[0][:len(msg)] == msg


@ti.test()
Expand All @@ -101,16 +97,14 @@ def foo():
if version_info < (3, 8):
msg = f"""\
On line {lineno + 5} of file "{file}":
a(11, 22, 3)
TypeError: 'NoneType' object is not callable"""
a(11, 22, 3)"""
else:
msg = f"""\
On line {lineno + 5} of file "{file}":
a(11, 22, 3)
^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable"""
^^^^^^^^^^^^^^"""
print(e.value.args[0])
assert e.value.args[0] == msg
assert e.value.args[0][:len(msg)] == msg


@ti.test()
Expand All @@ -129,7 +123,7 @@ def foo():
msg = f"""\
On line {lineno + 5} of file "{file}":
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(111)
TypeError: 'NoneType' object is not callable"""
"""
else:
msg = f"""\
On line {lineno + 5} of file "{file}":
Expand All @@ -138,7 +132,6 @@ def foo():
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(111)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable"""
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"""
print(e.value.args[0])
assert e.value.args[0] == msg
assert e.value.args[0][:len(msg)] == msg

0 comments on commit 18f990b

Please sign in to comment.