Skip to content

Commit

Permalink
tests: fix mark_exists() check on postgresql with non-standard psqlrc
Browse files Browse the repository at this point in the history
I have `\timing` in my `~/.psqlrc` which prints to stdout even when the
table doesn't exist.
  • Loading branch information
bluetech committed Nov 28, 2021
1 parent 2a30586 commit c7e0229
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pytest_django_test/db_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ def mark_exists():
if db_engine == "postgresql":
r = run_psql(TEST_DB_NAME, "-c", "SELECT 1 FROM mark_table")

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

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

0 comments on commit c7e0229

Please sign in to comment.