mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
- 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
|