def test_unicode(): screen = Screen(4, 2) stream = Stream() stream.attach(screen) try: stream.feed("тест") except UnicodeDecodeError: pytest.fail("Check your code -- we do accept unicode.") assert screen.display == ["тест", " "]
def __init__(self, *args, **kwargs): Stream.__init__(self, *args, **kwargs) self.listeners = defaultdict(lambda: [])