diff options
author | Miro Hrončok <miro@hroncok.cz> | 2022-11-11 14:51:14 +0100 |
---|---|---|
committer | Miro Hrončok <miro@hroncok.cz> | 2022-11-11 14:51:14 +0100 |
commit | babc98d98570b5dbb85fb1c58b012aafa9769696 (patch) | |
tree | ced2689aa8dcc7f36546160934fcc5de82e41c19 /testing/cffi1/test_dlopen.py | |
parent | 5ddf2accf50f05c8962c0c38211b0ad73412be71 (diff) | |
download | cffi-babc98d98570b5dbb85fb1c58b012aafa9769696.tar.gz |
Replace py.test usage with pytest, explicitly require py for testspy.test
pytest 7.2+ no longer depends on py. It ships py.path and py.error only.
See https://docs.pytest.org/en/7.2.x/changelog.html#deprecations
The tests use py.code as well, hence we declare and document a test dependency on py.
Diffstat (limited to 'testing/cffi1/test_dlopen.py')
-rw-r--r-- | testing/cffi1/test_dlopen.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/testing/cffi1/test_dlopen.py b/testing/cffi1/test_dlopen.py index 26a2717..11681d2 100644 --- a/testing/cffi1/test_dlopen.py +++ b/testing/cffi1/test_dlopen.py @@ -1,4 +1,4 @@ -import py +import pytest from cffi import FFI, VerificationError, CDefError from cffi.recompiler import make_py_source from testing.udir import udir @@ -36,7 +36,7 @@ ffi = _cffi_backend.FFI('test_valid_global_constant', def test_invalid_global_constant_3(): ffi = FFI() - e = py.test.raises(CDefError, ffi.cdef, "#define BB 12.34") + e = pytest.raises(CDefError, ffi.cdef, "#define BB 12.34") assert str(e.value).startswith( "only supports one of the following syntax:") @@ -44,7 +44,7 @@ def test_invalid_dotdotdot_in_macro(): ffi = FFI() ffi.cdef("#define FOO ...") target = udir.join('test_invalid_dotdotdot_in_macro.py') - e = py.test.raises(VerificationError, make_py_source, ffi, + e = pytest.raises(VerificationError, make_py_source, ffi, 'test_invalid_dotdotdot_in_macro', str(target)) assert str(e.value) == ("macro FOO: cannot use the syntax '...' in " "'#define FOO ...' when using the ABI mode") @@ -169,7 +169,7 @@ def test_no_cross_include(): ffi = FFI() ffi.include(baseffi) target = udir.join('test_no_cross_include.py') - py.test.raises(VerificationError, make_py_source, + pytest.raises(VerificationError, make_py_source, ffi, 'test_no_cross_include', str(target)) def test_array(): @@ -191,7 +191,7 @@ def test_array_overflow(): ffi = FFI() ffi.cdef("typedef int32_t my_array_t[3000000000];") target = udir.join('test_array_overflow.py') - py.test.raises(OverflowError, make_py_source, + pytest.raises(OverflowError, make_py_source, ffi, 'test_array_overflow', str(target)) def test_global_var(): |