This commit is contained in:
holger krekel
2020-05-18 16:22:13 +02:00
parent c1593c5c53
commit 452c9225dc
3 changed files with 54 additions and 30 deletions

View File

@@ -46,7 +46,6 @@ class Account(object):
lib.dc_context_new(lib.py_dc_callback, ffi.NULL, as_dc_charpointer(os_name)),
_destroy_dc_context,
)
hook = hookspec.Global._get_plugin_manager().hook
self._threads = iothreads.IOThreads(self)
@@ -55,9 +54,9 @@ class Account(object):
self._shutdown_event = Event()
# open database
self.db_path = db_path
if hasattr(db_path, "encode"):
db_path = db_path.encode("utf8")
self.db_path = db_path
if not lib.dc_open(self._dc_context, db_path, ffi.NULL):
raise ValueError("Could not dc_open: {}".format(db_path))
self._configkeys = self.get_config("sys.config_keys").split()

View File

@@ -16,7 +16,6 @@ from . import Account, const
from .tracker import ConfigureTracker
from .capi import lib
from .eventlogger import FFIEventLogger, FFIEventTracker
from _pytest.monkeypatch import MonkeyPatch
from _pytest._code import Source
import deltachat
@@ -99,14 +98,11 @@ def pytest_report_header(config, startdir):
summary = []
t = tempfile.mktemp()
m = MonkeyPatch()
try:
m.setattr(sys.stdout, "write", lambda x: len(x))
ac = Account(t)
ac = Account(t, logging=True)
info = ac.get_info()
ac.shutdown()
ac.shutdown(False)
finally:
m.undo()
os.remove(t)
summary.extend(['Deltachat core={} sqlite={}'.format(
info['deltachat_core_version'],