Serhiy Storchaka added the comment:
I think it is worth to add special helper in test.support for using as a
context manager:
with helper():
os.mkfifo(filename)
Then you could change its implementation without changing the testing code. For
example:
@contextmanager
def helper():
try:
yield
except PermissionError as e:
raise unittest.SkipTest(str(e))
or
@contextmanager
def helper():
if android_not_root:
raise unittest.SkipTest("operation not allowed, non root user")
yield
----------
nosy: +serhiy.storchaka
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28759>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com