[Python-checkins] gh-95971: Turn @writes_bytecode_files to skip when not running (#95972)
JelleZijlstra
webhook-mailer at python.org
Sat Oct 15 10:57:14 EDT 2022
https://github.com/python/cpython/commit/07b5c4699e64eb30c3bdcb1275c167e675d37423
commit: 07b5c4699e64eb30c3bdcb1275c167e675d37423
branch: main
author: Jeong YunWon <69878+youknowone at users.noreply.github.com>
committer: JelleZijlstra <jelle.zijlstra at gmail.com>
date: 2022-10-15T07:57:06-07:00
summary:
gh-95971: Turn @writes_bytecode_files to skip when not running (#95972)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra at gmail.com>
files:
M Lib/test/test_importlib/util.py
diff --git a/Lib/test/test_importlib/util.py b/Lib/test/test_importlib/util.py
index c07ac2a64c28..0b6dcc5eaf03 100644
--- a/Lib/test/test_importlib/util.py
+++ b/Lib/test/test_importlib/util.py
@@ -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
More information about the Python-checkins
mailing list