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_parse_c_type.py | |
parent | 5ddf2accf50f05c8962c0c38211b0ad73412be71 (diff) | |
download | cffi-py.test.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_parse_c_type.py')
-rw-r--r-- | testing/cffi1/test_parse_c_type.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/testing/cffi1/test_parse_c_type.py b/testing/cffi1/test_parse_c_type.py index a9f5fcb..fa1f36c 100644 --- a/testing/cffi1/test_parse_c_type.py +++ b/testing/cffi1/test_parse_c_type.py @@ -1,14 +1,15 @@ -import sys, re, os, py +import sys, re, os +import pytest import cffi from cffi import cffi_opcode if '__pypy__' in sys.builtin_module_names: try: # pytest >= 4.0 - py.test.skip("not available on pypy", allow_module_level=True) + pytest.skip("not available on pypy", allow_module_level=True) except TypeError: # older pytest - py.test.skip("not available on pypy") + pytest.skip("not available on pypy") cffi_dir = os.path.dirname(cffi_opcode.__file__) @@ -130,7 +131,7 @@ def parsex(input): return ' '.join(map(str_if_int, result)) def parse_error(input, expected_msg, expected_location): - e = py.test.raises(ParseError, parse, input) + e = pytest.raises(ParseError, parse, input) assert e.value.args[0] == expected_msg assert e.value.args[1] == expected_location |