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_pkgconfig.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_pkgconfig.py')
-rw-r--r-- | testing/cffi1/test_pkgconfig.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/testing/cffi1/test_pkgconfig.py b/testing/cffi1/test_pkgconfig.py index c725cca..40e0059 100644 --- a/testing/cffi1/test_pkgconfig.py +++ b/testing/cffi1/test_pkgconfig.py @@ -1,6 +1,6 @@ import sys import subprocess -import py +import pytest import cffi.pkgconfig as pkgconfig from cffi import PkgConfigError @@ -62,15 +62,15 @@ def test_call(): pkgconfig.subprocess = mock_subprocess mock_subprocess.RESULT = None - e = py.test.raises(PkgConfigError, pkgconfig.call, "libfoo", "--cflags") + e = pytest.raises(PkgConfigError, pkgconfig.call, "libfoo", "--cflags") assert str(e.value) == "cannot run pkg-config: oops can't run" mock_subprocess.RESULT = b"", "Foo error!\n", 1 - e = py.test.raises(PkgConfigError, pkgconfig.call, "libfoo", "--cflags") + e = pytest.raises(PkgConfigError, pkgconfig.call, "libfoo", "--cflags") assert str(e.value) == "Foo error!" mock_subprocess.RESULT = b"abc\\def\n", "", 0 - e = py.test.raises(PkgConfigError, pkgconfig.call, "libfoo", "--cflags") + e = pytest.raises(PkgConfigError, pkgconfig.call, "libfoo", "--cflags") assert str(e.value).startswith("pkg-config --cflags libfoo returned an " "unsupported backslash-escaped output:") @@ -84,7 +84,7 @@ def test_call(): if sys.version_info >= (3,): mock_subprocess.RESULT = b"\xff\n", "", 0 - e = py.test.raises(PkgConfigError, pkgconfig.call, + e = pytest.raises(PkgConfigError, pkgconfig.call, "libfoo", "--cflags", encoding="utf-8") assert str(e.value) == ( "pkg-config --cflags libfoo returned bytes that cannot be " |