Skip to content

Commit c7e0229

Browse files
committed
tests: fix mark_exists() check on postgresql with non-standard psqlrc
I have `\timing` in my `~/.psqlrc` which prints to stdout even when the table doesn't exist.
1 parent 2a30586 commit c7e0229

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pytest_django_test/db_helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ def mark_exists():
166166
if db_engine == "postgresql":
167167
r = run_psql(TEST_DB_NAME, "-c", "SELECT 1 FROM mark_table")
168168

169-
# When something pops out on std_out, we are good
170-
return bool(r.std_out)
169+
return r.status_code == 0
171170

172171
if db_engine == "mysql":
173172
r = run_mysql(TEST_DB_NAME, "-e", "SELECT 1 FROM mark_table")

0 commit comments

Comments
 (0)