]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-95971: Turn @writes_bytecode_files to skip when not running (#95972)
authorJeong YunWon <69878+youknowone@users.noreply.github.com>
Sat, 15 Oct 2022 14:57:06 +0000 (23:57 +0900)
committerGitHub <noreply@github.com>
Sat, 15 Oct 2022 14:57:06 +0000 (07:57 -0700)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Lib/test/test_importlib/util.py

index c07ac2a64c289fb0fe8b6140306bcaf822d50830..0b6dcc5eaf03d20cd4870700e93a5bd94a21f864 100644 (file)
@@ -298,7 +298,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