Read about our upcoming Code of Conduct on this issue

Commit 56a90e52 authored by Ronan Lamy's avatar Ronan Lamy
Browse files

Convert all remaining app_test_XXX functions to -D tests

parent 14e67d6368ae
def test_warning_to_error_translation():
import warnings
statement = """\
def wrong1():
a = 1
b = 2
global a
global b
"""
with warnings.catch_warnings():
warnings.filterwarnings("error", module="<test string>")
try:
compile(statement, '<test string>', 'exec')
except SyntaxError as err:
assert err.lineno is not None
assert err.filename is not None
assert err.offset is not None
assert err.message is not None
......@@ -13,22 +13,3 @@ def test_mangle():
assert mangle("__foo", "___") == "__foo"
assert mangle("___foo", "__Bar") == "_Bar___foo"
def app_test_warning_to_error_translation():
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("error", module="<test string>")
statement = """\
def wrong1():
a = 1
b = 2
global a
global b
"""
try:
compile(statement, '<test string>', 'exec')
except SyntaxError as err:
assert err.lineno is not None
assert err.filename is not None
assert err.offset is not None
assert err.message is not None
from pytest import raises
def teq(a, b):
assert a == b
assert type(a) is type(b)
def app_test_int_vs_long():
def teq(a, b):
assert a == b
assert type(a) is type(b)
def test_int_vs_long():
# binary operators
teq( 5 - 2 , 3 )
teq( 5 - 2L , 3L )
......@@ -47,7 +47,7 @@ def app_test_int_vs_long():
teq( 5L .__pow__(3 , 100L), 25L)
teq( 5L .__pow__(3L, 100 ), 25L)
teq( 5L .__pow__(3L, 100L), 25L)
teq( 5 .__rpow__(3 , 100 ), 43 )
#teq( 5 .__rpow__(3 , 100L), 43L or NotImplemented? )
teq( 5 .__rpow__(3L, 100 ), NotImplemented )
......@@ -58,11 +58,7 @@ def app_test_int_vs_long():
teq( 5L .__rpow__(3L, 100L), 43L)
def app_test_int_vs_float():
def teq(a, b):
assert a == b
assert type(a) is type(b)
def test_int_vs_float():
# binary operators
teq( 5 - 2 , 3 )
teq( 5 - 2.0 , 3.0 )
......@@ -100,11 +96,7 @@ def app_test_int_vs_float():
teq( 5 .__rpow__(3.0, 100.0), NotImplemented )
def app_test_long_vs_float():
def teq(a, b):
assert a == b
assert type(a) is type(b)
def test_long_vs_float():
# binary operators
teq( 5L - 2.0 , 3.0 )
teq( 5.0 - 2L , 3.0 )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment