mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
11 lines
234 B
Python
11 lines
234 B
Python
from testutils import assert_raises
|
|
|
|
fd = open('README.md')
|
|
assert 'RustPython' in fd.read()
|
|
|
|
assert_raises(FileNotFoundError, lambda: open('DoesNotExist'))
|
|
|
|
# Use open as a context manager
|
|
with open('README.md') as fp:
|
|
fp.read()
|