mirror of
https://github.com/pocketpy/pocketpy
synced 2026-02-04 06:30:17 +00:00
Update 300_import.py
This commit is contained in:
parent
f3bf7c6321
commit
a1bfebd30c
@ -3,7 +3,14 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
os.chdir('tests')
|
import sys
|
||||||
|
is_pyc = sys.argv[0].endswith('.pyc')
|
||||||
|
|
||||||
|
if is_pyc:
|
||||||
|
os.chdir('tmp/tests')
|
||||||
|
else:
|
||||||
|
os.chdir('tests')
|
||||||
|
|
||||||
assert os.getcwd().endswith('tests')
|
assert os.getcwd().endswith('tests')
|
||||||
|
|
||||||
import test1
|
import test1
|
||||||
@ -49,8 +56,11 @@ from math import (
|
|||||||
cos
|
cos
|
||||||
)
|
)
|
||||||
|
|
||||||
# test reload (dummy)
|
|
||||||
import importlib
|
|
||||||
importlib.reload(test2.a)
|
|
||||||
|
|
||||||
assert __import__('math').pi > 3
|
assert __import__('math').pi > 3
|
||||||
|
|
||||||
|
# test reload (dummy)
|
||||||
|
if not is_pyc:
|
||||||
|
import importlib
|
||||||
|
importlib.reload(test2.a)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user