Skip to content

Commit 4b6e5c8

Browse files
committed
attempt to fix permissions denied error on windows
1 parent 98098af commit 4b6e5c8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/integration_test.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,25 @@ def _sample_process(self, script_name, options=None, include_profile_name=False)
3131
# record option, and setting different flags. To get the profile output
3232
# we're using the speedscope format (since we can read that in as json)
3333
with tempfile.NamedTemporaryFile() as profile_file:
34+
filename = profile_file.name
35+
if sys.platform.startswith("win"):
36+
filename = "profile.json"
37+
3438
cmdline = [
3539
PYSPY,
3640
"record",
3741
"-o",
38-
profile_file.name,
42+
filename,
3943
"--format",
4044
"speedscope",
4145
"-d",
4246
"2",
4347
]
4448
cmdline.extend(options or [])
4549
cmdline.extend(["--", sys.executable, script_name])
46-
env = dict(os.environ, RUST_LOG="debug")
50+
env = dict(os.environ, RUST_LOG="info")
4751
subprocess.check_output(cmdline, env=env)
48-
with open(profile_file.name) as f:
52+
with open(filename) as f:
4953
profiles = json.load(f)
5054

5155
frames = profiles["shared"]["frames"]

0 commit comments

Comments
 (0)