Fix test suite getting type checked accidentally

This commit is contained in:
Kovid Goyal 2021-02-19 15:19:04 +05:30
parent 45d89cfe55
commit e06d40cb31
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 13 additions and 12 deletions

View File

@ -44,7 +44,7 @@ def install_deps():
# needed for zlib for pillow, should not be needed after pillow 8.0
os.environ['PKG_CONFIG_PATH'] = '/usr/local/opt/zlib/lib/pkgconfig'
cmd = 'pip3 install Pillow pygments'
if sys.version[:2] < (3, 7):
if sys.version_info[:2] < (3, 7):
cmd += ' importlib-resources'
run(cmd)

View File

@ -12,30 +12,30 @@ from kitty.fast_data_types import LineBuf, Cursor, Screen, HistoryBuf
class Callbacks:
def __init__(self):
def __init__(self) -> None:
self.clear()
def write(self, data):
def write(self, data) -> None:
self.wtcbuf += data
def title_changed(self, data):
def title_changed(self, data) -> None:
self.titlebuf += data
def icon_changed(self, data):
def icon_changed(self, data) -> None:
self.iconbuf += data
def set_dynamic_color(self, code, data):
def set_dynamic_color(self, code, data) -> None:
self.colorbuf += data or ''
def set_color_table_color(self, code, data):
def set_color_table_color(self, code, data) -> None:
self.ctbuf += ''
def request_capabilities(self, q):
def request_capabilities(self, q) -> None:
from kitty.terminfo import get_capabilities
for c in get_capabilities(q, None):
self.write(c.encode('ascii'))
def use_utf8(self, on):
def use_utf8(self, on) -> None:
self.iutf8 = on
def desktop_notify(self, osc_code: int, raw_data: str) -> None:
@ -44,7 +44,7 @@ class Callbacks:
def open_url(self, url: str, hyperlink_id: int) -> None:
self.open_urls.append((url, hyperlink_id))
def clear(self):
def clear(self) -> None:
self.wtcbuf = b''
self.iconbuf = self.titlebuf = self.colorbuf = self.ctbuf = ''
self.iutf8 = True

View File

@ -2,6 +2,7 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import importlib
import os
import sys
@ -14,8 +15,8 @@ def init_env() -> None:
def main() -> None:
init_env()
from kitty_tests.main import run_tests # type: ignore
run_tests()
m = importlib.import_module('kitty_tests.main')
m.run_tests() # type: ignore
if __name__ == '__main__':