Skip to content

Commit 146232f

Browse files
gh-95971: Turn @writes_bytecode_files to skip when not running (GH-95972)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit 07b5c46) Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com>
1 parent 84a26e1 commit 146232f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_importlib/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def writes_bytecode_files(fxn):
307307
"""Decorator to protect sys.dont_write_bytecode from mutation and to skip
308308
tests that require it to be set to False."""
309309
if sys.dont_write_bytecode:
310-
return lambda *args, **kwargs: None
310+
return unittest.skip("relies on writing bytecode")(fxn)
311311
@functools.wraps(fxn)
312312
def wrapper(*args, **kwargs):
313313
original = sys.dont_write_bytecode

0 commit comments

Comments
 (0)