From 30257d68a1830b280f1ce69fefeb0f06627a7394 Mon Sep 17 00:00:00 2001 From: Joachim Jablon Date: Sun, 17 May 2020 13:03:33 +0200 Subject: [PATCH] Remove pg_service_env --- tests/migration/test_migration.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/migration/test_migration.py b/tests/migration/test_migration.py index af20b5d95..0c170b043 100644 --- a/tests/migration/test_migration.py +++ b/tests/migration/test_migration.py @@ -8,26 +8,20 @@ BASELINE = "0.5.0" -@pytest.fixture -def pg_service_env(): - env = os.environ.copy() - env["PGSERVICEFILE"] = "tests/migration/pgservice.ini" - return env - - # Pum config file is currently broken (https://github.com/opengisch/pum/issues/5) # When it's fixed, we can add a config file here, and then get rid of omit_table_dir @pytest.fixture -def pum(pg_service_env): +def pum(): + + env = {**os.environ, "PGSERVICEFILE": "tests/migration/pgservice.ini"} + def _(command, args: str, omit_table_dir=False): first_args = ["pum", command] if not omit_table_dir: first_args.extend( ["--table=public.pum", "--dir=procrastinate/sql/migrations"] ) - return subprocess.run( - first_args + args.split(), check=True, env=pg_service_env, - ) + return subprocess.run(first_args + args.split(), check=True, env=env) return _