diff --git a/test-crates/with-data/check_installed/check_installed.py b/test-crates/with-data/check_installed/check_installed.py index 1437ef6d9..f43fb6050 100644 --- a/test-crates/with-data/check_installed/check_installed.py +++ b/test-crates/with-data/check_installed/check_installed.py @@ -5,12 +5,14 @@ assert with_data.lib.one() == 1 assert with_data.ffi.string(with_data.lib.say_hello()).decode() == "hello" -venv_root = Path(with_data.__file__).parent.parent.parent.parent.parent -installed_data = ( - venv_root.joinpath("data_subdir").joinpath("hello.txt").read_text().strip() -) -assert installed_data == "Hi! 😊" + +venv_root = Path(sys.prefix) + try: + installed_data = ( + venv_root.joinpath("data_subdir").joinpath("hello.txt").read_text().strip() + ) + assert installed_data == "Hi! 😊" header_file = ( venv_root.joinpath("include") .joinpath("site") @@ -19,7 +21,9 @@ .joinpath("empty.h") ) assert header_file.is_file(), header_file -except AssertionError: +except (AssertionError, FileNotFoundError): + print("__file__", __file__) + print("venv_root", venv_root) # Debugging help for i in sorted(venv_root.glob("**/*")): print(i)