tests/import: Add a test for the builtin __import__ function.
This commit is contained in:
parent
2f7fad66a2
commit
3a9445c6b3
|
@ -0,0 +1,16 @@
|
|||
# test calling builtin import function
|
||||
|
||||
# basic test
|
||||
__import__('builtins')
|
||||
|
||||
# first arg should be a string
|
||||
try:
|
||||
__import__(1)
|
||||
except TypeError:
|
||||
print('TypeError')
|
||||
|
||||
# level argument should be non-negative
|
||||
try:
|
||||
__import__('xyz', None, None, None, -1)
|
||||
except ValueError:
|
||||
print('ValueError')
|
Loading…
Reference in New Issue