aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Lamy <ronan.lamy@gmail.com>2020-05-06 16:21:48 +0100
committerRonan Lamy <ronan.lamy@gmail.com>2020-05-06 16:21:48 +0100
commitb5063a06926ee9f0ec8a68ed39bd759bbc1763f2 (patch)
tree88ca429e8462963a3ed169ac530fcb608f7d3040 /extra_tests
parentLet @pytest.mark.pypy_only work as advertised in extra_tests/ (diff)
downloadpypy-b5063a06926ee9f0ec8a68ed39bd759bbc1763f2.tar.gz
pypy-b5063a06926ee9f0ec8a68ed39bd759bbc1763f2.tar.bz2
pypy-b5063a06926ee9f0ec8a68ed39bd759bbc1763f2.zip
test cleanup: fix deprecated syntax
Diffstat (limited to 'extra_tests')
-rw-r--r--extra_tests/ctypes_tests/test_extra.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/extra_tests/ctypes_tests/test_extra.py b/extra_tests/ctypes_tests/test_extra.py
index 967886f8a7..054d59e536 100644
--- a/extra_tests/ctypes_tests/test_extra.py
+++ b/extra_tests/ctypes_tests/test_extra.py
@@ -3,7 +3,7 @@ The purpose of this test file is to check how ctypes really work,
down to what aliases what and what exact types operations return.
"""
-import py
+import pytest
from ctypes import *
def test_primitive_pointer():
@@ -226,11 +226,16 @@ def test_from_param():
def test_array_mul():
assert c_int * 10 == 10 * c_int == c_int * 10L == 10L * c_int
- py.test.raises(TypeError, 'c_int * c_int')
- py.test.raises(TypeError, 'c_int * (-1.5)')
- py.test.raises(TypeError, 'c_int * "foo"')
- py.test.raises(TypeError, '(-1.5) * c_int')
- py.test.raises(TypeError, '"foo" * c_int')
+ with pytest.raises(TypeError):
+ c_int * c_int
+ with pytest.raises(TypeError):
+ c_int * (-1.5)
+ with pytest.raises(TypeError):
+ c_int * "foo"
+ with pytest.raises(TypeError):
+ (-1.5) * c_int
+ with pytest.raises(TypeError):
+ "foo" * c_int
def test_cast_none():
def check(P):