forked from Rust-related/RustPython
- 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
14 lines
229 B
Python
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
|