Skip to content

Commit

Permalink
test for \ in tmp path (ClearcodeHQ#982)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhelgs committed Jul 17, 2024
1 parent b87fdc3 commit b308c82
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_postgresql.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"""All tests for pytest-postgresql."""

import decimal
import unittest.mock as mock
from pathlib import Path

import pytest
from pytest import TempPathFactory
from psycopg import Connection
from psycopg.pq import ConnStatus

Expand All @@ -19,6 +22,17 @@ def test_postgresql_proc(postgresql_proc: PostgreSQLExecutor) -> None:
assert postgresql_proc.running() is True


@pytest.mark.xfail(reason="issue tracked by #982")
def test_postgresql_proc__bad_tmp(postgresql_proc: PostgreSQLExecutor) -> None:
"""Test different postgresql versions."""

def bad_path(tmp_path_factory: TempPathFactory, subdir: str) -> Path:
return tmp_path_factory.mktemp(rf"bad\path/{subdir}")

with mock.patch("pytest_postgresql.factories.process._tmp_dir", side_effect=bad_path):
assert postgresql_proc.running() is True


def test_main_postgres(postgresql: Connection) -> None:
"""Check main postgresql fixture."""
cur = postgresql.cursor()
Expand Down

0 comments on commit b308c82

Please sign in to comment.