From 61ff2c4bee40c728f5cbccc63e8ffc12dc613446 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 29 Jan 2020 17:14:17 +0000 Subject: [PATCH] add a failing test taht doesn't use pytest anymore --- python/fail_test.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 python/fail_test.py diff --git a/python/fail_test.py b/python/fail_test.py new file mode 100644 index 000000000..8214299d0 --- /dev/null +++ b/python/fail_test.py @@ -0,0 +1,30 @@ +from __future__ import print_function +import threading +from deltachat import capi, cutil, const, set_context_callback, clear_context_callback +from deltachat.capi import ffi +from deltachat.capi import lib +from deltachat.account import EventLogger + + +class EventThread(threading.Thread): + def __init__(self, dc_context): + self.dc_context = dc_context + super(EventThread, self).__init__() + self.setDaemon(1) + + def run(self): + lib.dc_context_run(self.dc_context, lib.py_dc_callback) + + def stop(self): + lib.dc_context_shutdown(self.dc_context) + + +if __name__ == "__main__": + print("1") + ctx = capi.lib.dc_context_new(ffi.NULL, ffi.NULL) + print("2") + ev_thread = EventThread(ctx) + print("3 -- starting event thread") + ev_thread.start() + print("4 -- stopping event thread") + ev_thread.stop()