Skip to content

Commit fc4793f

Browse files
committed
Fix tests
1 parent 1263c28 commit fc4793f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def __init__(self, global_dir, installs=[]):
155155
self.installs = list(installs)
156156
self.shebang_can_run_anything = True
157157
self.shebang_can_run_anything_silently = False
158+
self.scratch = {}
158159

159160
def get_installs(self, *, include_unmanaged=True, set_default=True):
160161
return self.installs

tests/test_alias.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ def check(self, cmd, tag, name, expect, windowed=0):
5252
AU.create_alias(
5353
cmd,
5454
{"tag": tag},
55-
{"name": f"{name}.txt", "windowed": windowed},
55+
{"name": name, "windowed": windowed},
5656
self._expect_target,
5757
)
5858
print(*cmd.global_dir.glob("*"), sep="\n")
59-
assert (cmd.global_dir / f"{name}.txt").is_file()
60-
assert (cmd.global_dir / f"{name}.txt.__target__").is_file()
61-
assert (cmd.global_dir / f"{name}.txt").read_text() == expect
62-
assert (cmd.global_dir / f"{name}.txt.__target__").read_text() == self._expect_target
59+
assert (cmd.global_dir / f"{name}.exe").is_file()
60+
assert (cmd.global_dir / f"{name}.exe.__target__").is_file()
61+
assert (cmd.global_dir / f"{name}.exe").read_text() == expect
62+
assert (cmd.global_dir / f"{name}.exe.__target__").read_text() == self._expect_target
6363

6464
def check_32(self, cmd, tag, name):
6565
self.check(cmd, tag, name, self._expect["-32"])
@@ -251,7 +251,7 @@ def test_scan_entrypoints(tmp_path):
251251
"a_cmd", "a2_cmd", "aw_cmd"
252252
]
253253
assert [a[0]["windowed"] for a in actual] == [0, 0, 1]
254-
assert [a[1].rpartition("; ")[2] for a in actual] == [
255-
"sys.exit(main())", "sys.exit(main2())", "sys.exit(main())"
254+
assert [a[1].rpartition("sys.exit")[2].strip() for a in actual] == [
255+
"(main())", "(main2())", "(main())"
256256
]
257257

0 commit comments

Comments
 (0)