mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +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
10 lines
257 B
Python
10 lines
257 B
Python
from testutils import assert_raises
|
|
|
|
assert format(5, "b") == "101"
|
|
|
|
assert_raises(TypeError, lambda: format(2, 3), 'format called with number')
|
|
|
|
assert format({}) == "{}"
|
|
|
|
assert_raises(TypeError, lambda: format({}, 'b'), 'format_spec not empty for dict')
|