kitty/test.py

30 lines
676 B
Python
Raw Normal View History

2016-10-16 18:06:27 +03:00
#!/usr/bin/env python3
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import importlib
2016-10-16 18:06:27 +03:00
import os
import sys
import warnings
2021-10-31 05:50:46 +03:00
from tempfile import TemporaryDirectory
2016-10-16 18:06:27 +03:00
base = os.path.dirname(os.path.abspath(__file__))
def init_env() -> None:
2016-10-16 18:06:27 +03:00
sys.path.insert(0, base)
2020-03-12 11:56:51 +03:00
def main() -> None:
warnings.simplefilter('error')
os.environ['PYTHONWARNINGS'] = 'error'
2021-10-31 05:50:46 +03:00
with TemporaryDirectory() as tdir:
os.environ['HOME'] = os.environ['USERPROFILE'] = tdir
init_env()
m = importlib.import_module('kitty_tests.main')
m.run_tests() # type: ignore
2017-01-09 08:40:41 +03:00
2016-10-16 18:06:27 +03:00
if __name__ == '__main__':
main()