Message285309
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. |
|
| Date |
User |
Action |
Args |
| 2017-01-12 11:20:52 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, xdegaye, python-dev |
| 2017-01-12 11:20:52 | serhiy.storchaka | set | messageid: <[email protected]> |
| 2017-01-12 11:20:52 | serhiy.storchaka | link | issue28759 messages |
| 2017-01-12 11:20:51 | serhiy.storchaka | create | |
|