◐ Shell
clean mode source ↗

Message 285309 - Python tracker

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.