Logo
Explore Help
Register Sign In
fengqi/lv_micropython
1
0
Fork 0
You've already forked lv_micropython
Code Issues Pull Requests 1 Actions Packages Projects Releases Wiki Activity
lv_micropython/tests/basics/sys1.py

27 lines
518 B
Python
Raw Normal View History

tests: Add missing tests for builtins, and many other things.
2015-04-04 22:05:30 +01:00
# test sys module
import sys
print(sys.__name__)
print(type(sys.path))
print(type(sys.argv))
print(sys.byteorder in ('little', 'big'))
tests/basic/: Make various tests skippable. To run the testsuite on small ports.
2017-02-15 18:11:16 +03:00
try:
print(sys.maxsize > 100)
except AttributeError:
# Effectively skip subtests
print(True)
try:
print(sys.implementation.name in ('cpython', 'micropython'))
except AttributeError:
# Effectively skip subtests
print(True)
py/modsys: Report .mpy version in sys.implementation. This commit adds a sys.implementation.mpy entry when the system supports importing .mpy files. This entry is a 16-bit integer which encodes two bytes of information from the header of .mpy files that are supported by the system being run: the second and third bytes, .mpy version, and flags and native architecture. This allows determining the supported .mpy file dynamically by code, and also for the user to find it out by inspecting this value. It's further possible to dynamically detect if the system supports importing .mpy files by `hasattr(sys.implementation, 'mpy')`.
2019-10-30 16:26:11 +11:00
if hasattr(sys.implementation, 'mpy'):
print(type(sys.implementation.mpy))
else:
# Effectively skip subtests
print(int)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 146ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API