diff --git a/tests/test_api_convert.py b/tests/test_api_convert.py index ab70e19cd3..a2651ceba0 100644 --- a/tests/test_api_convert.py +++ b/tests/test_api_convert.py @@ -121,14 +121,13 @@ def test_c_extension_error(base_platform, package): download(f, fn) for platform in platforms: - with pytest.raises(CondaBuildUserError) as e: + with pytest.raises( + CondaBuildUserError, + match=f"WARNING: Package {fn} contains C extensions; skipping conversion. " + "Use -f to force conversion.", + ): api.convert(fn, platforms=platform) - assert ( - f"WARNING: Package {fn} contains C extensions; skipping conversion. " - "Use -f to force conversion." - ) in str(e.value) - @pytest.mark.parametrize("base_platform", ["linux", "win", "osx"]) @pytest.mark.parametrize("package", [("cryptography-1.8.1", "__about__.py")])