X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e14e7c6235a40dbec451146bcb3aaec013d659c9..893490f94e19d113e46b89b3ae62492d40db4a7a:/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')