Skip to content

Commit

Permalink
Remove pg_service_env
Browse files Browse the repository at this point in the history
  • Loading branch information
ewjoachim committed May 17, 2020
1 parent e99fa4a commit 30257d6
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions tests/migration/test_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 _

Expand Down

0 comments on commit 30257d6

Please sign in to comment.