tests: show that 'no_pool_connections_available' is broken

This commit is contained in:
Robert Vollmert
2022-08-31 19:13:53 +02:00
committed by Robert
parent 5ae9a2b1cf
commit ebc34561fa
2 changed files with 36 additions and 6 deletions
-6
View File
@@ -15,12 +15,6 @@ from util import *
from postgrest import *
def test_port_connection(defaultenv):
"Connections via a port on localhost should work."
with run(env=defaultenv, port=freeport()):
pass
@pytest.mark.parametrize(
"secretpath",
[path for path in (BASEDIR / "secrets").iterdir() if path.suffix != ".jwt"],
+36
View File
@@ -0,0 +1,36 @@
"Sanity checks for the PostgREST black box testing infrastructure."
from datetime import datetime
from operator import attrgetter
import os
import re
import signal
import socket
import time
import pytest
from config import *
from util import *
from postgrest import *
def test_port_connection(defaultenv):
"Connections via a port on localhost should work."
with run(env=defaultenv, port=freeport()):
pass
def test_plain_get(defaultenv):
"run() should give a working PostgREST."
with run(env=defaultenv) as postgrest:
response = postgrest.session.get("/projects")
assert response.status_code == 200
@pytest.mark.xfail(reason="option is broken, issue #2456")
def test_no_pool_connection_available(defaultenv):
"no_pool_connection_available option is functional"
with run(env=defaultenv, no_pool_connection_available=True) as postgrest:
with pytest.raises(Exception) as e:
postgrest.session.get("/projects", timeout=1)