mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Skip test_wrap_bad if run under pytest (#115070)
Pytest replaces sys.stdout/stderr by `TextIOWrapper` instances which do not support `fileno()` Hence skip that test in this case Fixes #115069 Pull Request resolved: https://github.com/pytorch/pytorch/pull/115070 Approved by: https://github.com/clee2000
This commit is contained in:
committed by
PyTorch MergeBot
parent
d833e2f236
commit
99cb807e25
@ -1867,6 +1867,16 @@ def skipIfTBB(message="This test makes TBB sad"):
|
||||
return dec_fn
|
||||
|
||||
|
||||
def skip_if_pytest(fn):
|
||||
@wraps(fn)
|
||||
def wrapped(*args, **kwargs):
|
||||
if "PYTEST_CURRENT_TEST" in os.environ:
|
||||
raise unittest.SkipTest("does not work under pytest")
|
||||
return fn(*args, **kwargs)
|
||||
|
||||
return wrapped
|
||||
|
||||
|
||||
def slowTest(fn):
|
||||
@wraps(fn)
|
||||
def wrapper(*args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user