mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
speed up test teardown by now waiting for threads to finish ...
and remove a debug statement
This commit is contained in:
@@ -328,10 +328,10 @@ class Account(object):
|
|||||||
self.configure()
|
self.configure()
|
||||||
self._threads.start()
|
self._threads.start()
|
||||||
|
|
||||||
def stop_threads(self):
|
def stop_threads(self, wait=True):
|
||||||
""" stop IMAP/SMTP threads. """
|
""" stop IMAP/SMTP threads. """
|
||||||
lib.dc_stop_ongoing_process(self._dc_context)
|
lib.dc_stop_ongoing_process(self._dc_context)
|
||||||
self._threads.stop(wait=True)
|
self._threads.stop(wait=wait)
|
||||||
|
|
||||||
def _process_event(self, ctx, evt_name, data1, data2):
|
def _process_event(self, ctx, evt_name, data1, data2):
|
||||||
assert ctx == self._dc_context
|
assert ctx == self._dc_context
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ def acfactory(pytestconfig, tmpdir, request):
|
|||||||
ac._evlogger.set_timeout(30)
|
ac._evlogger.set_timeout(30)
|
||||||
ac.configure(**configdict)
|
ac.configure(**configdict)
|
||||||
ac.start_threads()
|
ac.start_threads()
|
||||||
self._finalizers.append(ac.stop_threads)
|
self._finalizers.append(lambda: ac.stop_threads(wait=False))
|
||||||
return ac
|
return ac
|
||||||
|
|
||||||
def clone_online_account(self, account):
|
def clone_online_account(self, account):
|
||||||
@@ -114,7 +114,7 @@ def acfactory(pytestconfig, tmpdir, request):
|
|||||||
ac._evlogger.set_timeout(30)
|
ac._evlogger.set_timeout(30)
|
||||||
ac.configure(addr=account.get_config("addr"), mail_pw=account.get_config("mail_pw"))
|
ac.configure(addr=account.get_config("addr"), mail_pw=account.get_config("mail_pw"))
|
||||||
ac.start_threads()
|
ac.start_threads()
|
||||||
self._finalizers.append(ac.stop_threads)
|
self._finalizers.append(lambda: ac.stop_threads(wait=False))
|
||||||
return ac
|
return ac
|
||||||
|
|
||||||
return AccountMaker()
|
return AccountMaker()
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ impl Key {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_slice(bytes: &[u8], key_type: KeyType) -> Option<Self> {
|
pub fn from_slice(bytes: &[u8], key_type: KeyType) -> Option<Self> {
|
||||||
println!("hello from_slice");
|
|
||||||
let res: Result<Key, _> = match key_type {
|
let res: Result<Key, _> = match key_type {
|
||||||
KeyType::Public => SignedPublicKey::from_bytes(Cursor::new(bytes)).map(Into::into),
|
KeyType::Public => SignedPublicKey::from_bytes(Cursor::new(bytes)).map(Into::into),
|
||||||
KeyType::Private => SignedSecretKey::from_bytes(Cursor::new(bytes)).map(Into::into),
|
KeyType::Private => SignedSecretKey::from_bytes(Cursor::new(bytes)).map(Into::into),
|
||||||
|
|||||||
Reference in New Issue
Block a user