summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-10-15 15:40:43 (GMT)
committerGitHub <noreply@github.com>2022-10-15 15:40:43 (GMT)
commit146232f8af1130578ebeccbe7899c69be7e0d03e (patch)
tree3940f36ec97987dc6d2cbe3c3d8de0d9480450b6
parent84a26e114ed5ca080ffe2f84aa0b7c59848afed6 (diff)
downloadcpython-146232f8af1130578ebeccbe7899c69be7e0d03e.zip
cpython-146232f8af1130578ebeccbe7899c69be7e0d03e.tar.gz
cpython-146232f8af1130578ebeccbe7899c69be7e0d03e.tar.bz2
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 07b5c4699e64eb30c3bdcb1275c167e675d37423) Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com>
-rw-r--r--Lib/test/test_importlib/util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_importlib/util.py b/Lib/test/test_importlib/util.py
index ca0d8c9..b14ecb5 100644
--- a/Lib/test/test_importlib/util.py
+++ b/Lib/test/test_importlib/util.py
@@ -307,7 +307,7 @@ def writes_bytecode_files(fxn):
"""Decorator to protect sys.dont_write_bytecode from mutation and to skip
tests that require it to be set to False."""
if sys.dont_write_bytecode:
- return lambda *args, **kwargs: None
+ return unittest.skip("relies on writing bytecode")(fxn)
@functools.wraps(fxn)
def wrapper(*args, **kwargs):
original = sys.dont_write_bytecode