Serhiy Storchaka added the comment:
The purpose of this helper is skipping the test rather than failing if some OS
operation is not permitted by current configuration. May be
skip_if_not_permitted()?
Similar helpers that convert runtime error in skipping a test: import_module(),
get_attribute(), bind_unix_socket(), system_must_validate_cert(). They are more
concrete, guard some specific operation.
Context manager is not the only possible syntax. The helper can call a function:
helper(os.mkfifo, filename)
or be a wrapper:
helper(os.mkfifo)(filename)
If you prefer such syntax.
There are many possibilities, and I think it is worth to discuss this on
Python-Dev.
----------
_______________________________________
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