mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
2472
Lib/datetime.py
Normal file
2472
Lib/datetime.py
Normal file
File diff suppressed because it is too large
Load Diff
3812
tests/snippets/stdlib_datetime.py
Normal file
3812
tests/snippets/stdlib_datetime.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,17 @@ def assert_raises(exc_type, expr, msg=None):
|
||||
assert False, failmsg
|
||||
|
||||
|
||||
class assertRaises:
|
||||
def assertRaises(expected, *args, **kw):
|
||||
if not args:
|
||||
assert not kw
|
||||
return _assertRaises(expected)
|
||||
else:
|
||||
f, f_args = args[0], args[1:]
|
||||
with _assertRaises(expected):
|
||||
f(*f_args, **kw)
|
||||
|
||||
|
||||
class _assertRaises:
|
||||
def __init__(self, expected):
|
||||
self.expected = expected
|
||||
self.exception = None
|
||||
|
||||
Reference in New Issue
Block a user