Files
RustPython/tests/snippets/stdlib_os.py
Joey Hain 47e95486f0 Reuse and improve ergonomics of assert_raises utility
- Move assert_raises to testutils
- Add optional message argument, with reasonable default
- Reverse order of expr and exception type for readability
- Lambda argument no longer takes parameter
- Convert applicable snippets to use assert_raises
2019-02-16 09:32:42 -08:00

14 lines
229 B
Python

import os
from testutils import assert_raises
assert os.open('README.md', 0) > 0
assert_raises(FileNotFoundError, lambda: os.open('DOES_NOT_EXIST', 0))
assert os.O_RDONLY == 0
assert os.O_WRONLY == 1
assert os.O_RDWR == 2