Skip to content

Commit

Permalink
windows, next try
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed May 9, 2022
1 parent 6a7ef52 commit 3557f0c
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions test-crates/with-data/check_installed/check_installed.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,25 @@

venv_root = Path(sys.prefix)

try:
installed_data = (
venv_root.joinpath("data_subdir").joinpath("hello.txt").read_text().strip()
)
assert installed_data == "Hi! 😊", (
installed_data,
"Hi! 😊",
locale.getpreferredencoding(),
)
header_file = (
venv_root.joinpath("include")
.joinpath("site")
.joinpath(f"python{sys.version_info.major}.{sys.version_info.minor}")
.joinpath("with-data")
.joinpath("empty.h")
)
assert header_file.is_file(), header_file
except (AssertionError, FileNotFoundError):
print("__file__", __file__)
print("venv_root", venv_root)
# Debugging help
for i in sorted(venv_root.glob("**/*")):
print(i)
raise
installed_data = (
venv_root.joinpath("data_subdir")
.joinpath("hello.txt")
# With the default encoding, python under windows fails to read the file correctly :/
.read_text(encoding="utf-8")
.strip()
)
assert installed_data == "Hi! 😊", (
installed_data,
"Hi! 😊",
locale.getpreferredencoding(),
)
header_file = (
venv_root.joinpath("include")
.joinpath("site")
.joinpath(f"python{sys.version_info.major}.{sys.version_info.minor}")
.joinpath("with-data")
.joinpath("empty.h")
)
assert header_file.is_file(), header_file

print("SUCCESS")

0 comments on commit 3557f0c

Please sign in to comment.