Skip to content

Commit e30f0fe

Browse files
committed
tests/run-tests.py: Remove filename arg from prepare_script_for_target.
It's no longer used. Signed-off-by: Damien George <damien@micropython.org>
1 parent 4d78c9d commit e30f0fe

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

tests/run-tests.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -269,22 +269,17 @@ def detect_test_platform(pyb, args):
269269
print()
270270

271271

272-
def prepare_script_for_target(args, *, script_filename=None, script_text=None, force_plain=False):
272+
def prepare_script_for_target(args, *, script_text=None, force_plain=False):
273273
if force_plain or (not args.via_mpy and args.emit == "bytecode"):
274-
if script_filename is not None:
275-
with open(script_filename, "rb") as f:
276-
script_text = f.read()
274+
# A plain test to run as-is, no processing needed.
275+
pass
277276
elif args.via_mpy:
278277
tempname = tempfile.mktemp(dir="")
279278
mpy_filename = tempname + ".mpy"
280279

281-
if script_filename is None:
282-
script_filename = tempname + ".py"
283-
cleanup_script_filename = True
284-
with open(script_filename, "wb") as f:
285-
f.write(script_text)
286-
else:
287-
cleanup_script_filename = False
280+
script_filename = tempname + ".py"
281+
with open(script_filename, "wb") as f:
282+
f.write(script_text)
288283

289284
try:
290285
subprocess.check_output(
@@ -300,8 +295,7 @@ def prepare_script_for_target(args, *, script_filename=None, script_text=None, f
300295
script_text = b"__buf=" + bytes(repr(f.read()), "ascii") + b"\n"
301296

302297
rm_f(mpy_filename)
303-
if cleanup_script_filename:
304-
rm_f(script_filename)
298+
rm_f(script_filename)
305299

306300
script_text += bytes(injected_import_hook_code, "ascii")
307301
else:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy