Skip to content

Commit

Permalink
use sys.prefix for venv root and more windows debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed May 9, 2022
1 parent 7e8d8a6 commit b1fdeea
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test-crates/with-data/check_installed/check_installed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit b1fdeea

Please sign in to comment.