Skip to content

Commit

Permalink
pythongh-95971: Turn @writes_bytecode_files to skip when not running (p…
Browse files Browse the repository at this point in the history
…ythonGH-95972)

Co-authored-by: Jelle Zijlstra <[email protected]>
(cherry picked from commit 07b5c46)

Co-authored-by: Jeong YunWon <[email protected]>
  • Loading branch information
miss-islington and youknowone authored Oct 15, 2022
1 parent 84a26e1 commit 146232f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_importlib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 146232f

Please sign in to comment.