diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-07-08 01:40:10 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-07-08 01:40:10 +0200 |
commit | 7bf0ec6bc417da77a8d45ab91b5522c96a25e273 (patch) | |
tree | 0a4a230d3509e01183f7ca67aac07ed0567b0994 /test/py/conftest.py | |
parent | test: verify that added runs are in the database (diff) | |
download | cimple-7bf0ec6bc417da77a8d45ab91b5522c96a25e273.tar.gz cimple-7bf0ec6bc417da77a8d45ab91b5522c96a25e273.zip |
test: refactoring
Diffstat (limited to '')
-rw-r--r-- | test/py/conftest.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/test/py/conftest.py b/test/py/conftest.py index ead09d1..a92699d 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -119,6 +119,11 @@ def sqlite_path(tmp_path): return os.path.join(tmp_path, 'cimple.sqlite') +@fixture +def sqlite_db(server, sqlite_path): + return Database(sqlite_path) + + class CmdLineServer(CmdLine): def log_line_means_process_ready(self, line): return line.endswith('Waiting for new connections') @@ -179,11 +184,6 @@ def workers(worker_cmd): @fixture -def server_and_workers(server, workers): - yield server, workers - - -@fixture def client(client_cmd): return client_cmd @@ -193,6 +193,14 @@ def test_repo(tmp_path): return TestRepo(tmp_path) +class Env: + def __init__(self, server, workers, client, db): + self.server = server + self.workers = workers + self.client = client + self.db = db + + @fixture -def sqlite_db(server, sqlite_path): - return Database(sqlite_path) +def env(server, workers, client, sqlite_db): + return Env(server, workers, client, sqlite_db) |