Skip to content

Commit

Permalink
test for \ in tmp path (#982)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhelgs committed Sep 3, 2024
1 parent 2faa75b commit bf18cc0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,32 @@ def test_executor_init_with_password(
assert_executor_start_stop(executor)


@pytest.mark.xfail(reason="issue tracked by #982")
def test_executor_init_bad_tmp_path(
request: FixtureRequest,
tmp_path_factory: pytest.TempPathFactory,
) -> None:
r"""Test init with \ and space chars in the path."""
config = get_config(request)
pg_exe = process._pg_exe(None, config)
port = process._pg_port(-1, config)
tmpdir = tmp_path_factory.mktemp(f"pytest-postgresql-{request.node.name}") / r"a bad\path/"
tmpdir.mkdir(exist_ok=True)
datadir, logfile_path = process._prepare_dir(tmpdir, port)
executor = PostgreSQLExecutor(
executable=pg_exe,
host=config["host"],
port=port,
datadir=str(datadir),
unixsocketdir=config["unixsocketdir"],
logfile=str(logfile_path),
startparams=config["startparams"],
password="some password",
dbname="some database",
)
assert_executor_start_stop(executor)


postgres_with_password = postgresql_proc(password="hunter2")


Expand Down

0 comments on commit bf18cc0

Please sign in to comment.