]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-95971: Turn @writes_bytecode_files to skip when not running (GH-95972)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 15 Oct 2022 15:40:43 +0000 (08:40 -0700)
committerGitHub <noreply@github.com>
Sat, 15 Oct 2022 15:40:43 +0000 (08:40 -0700)
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>
Lib/test/test_importlib/util.py

index ca0d8c9b6eb352f11d2e2206d99bee8c6d1b2ded..b14ecb51b255e60d3dfddc8b29470b0e123d6129 100644 (file)
@@ -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