X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c7fd0a7af4ce261e61feb0e63d0a6db736280081..09f4d767e4498368f798d8c1b579b1bf730f4baf:/test/python/test_db_connection.py diff --git a/test/python/test_db_connection.py b/test/python/test_db_connection.py index ce81c4f3..5de68618 100644 --- a/test/python/test_db_connection.py +++ b/test/python/test_db_connection.py @@ -78,6 +78,14 @@ def test_cursor_scalar_many_rows(db): cur.scalar('SELECT * FROM pg_tables') +def test_cursor_scalar_no_rows(db, table_factory): + table_factory('dummy') + + with db.cursor() as cur: + with pytest.raises(RuntimeError): + cur.scalar('SELECT id FROM dummy') + + def test_get_pg_env_add_variable(monkeypatch): monkeypatch.delenv('PGPASSWORD', raising=False) env = get_pg_env('user=fooF')