enable flake for Python tests

This commit is contained in:
Sarah Hoffmann
2025-03-09 15:33:24 +01:00
parent 5a245e33e0
commit 4cc788f69e
93 changed files with 949 additions and 1191 deletions

View File

@@ -2,7 +2,7 @@
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2024 by the Nominatim developer community.
# Copyright (C) 2025 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for centroid computation.
@@ -11,6 +11,7 @@ import pytest
from nominatim_db.utils.centroid import PointsCentroid
def test_empty_set():
c = PointsCentroid()
@@ -18,7 +19,7 @@ def test_empty_set():
c.centroid()
@pytest.mark.parametrize("centroid", [(0,0), (-1, 3), [0.0000032, 88.4938]])
@pytest.mark.parametrize("centroid", [(0, 0), (-1, 3), [0.0000032, 88.4938]])
def test_one_point_centroid(centroid):
c = PointsCentroid()

View File

@@ -2,7 +2,7 @@
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2024 by the Nominatim developer community.
# Copyright (C) 2025 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for the streaming JSON writer.
@@ -13,6 +13,7 @@ import pytest
from nominatim_api.utils.json_writer import JsonWriter
@pytest.mark.parametrize("inval,outstr", [(None, 'null'),
(True, 'true'), (False, 'false'),
(23, '23'), (0, '0'), (-1.3, '-1.3'),
@@ -71,6 +72,7 @@ def test_object_single_entry():
assert writer() == '{"something":5}'
json.loads(writer())
def test_object_many_values():
writer = JsonWriter()\
.start_object()\
@@ -82,6 +84,7 @@ def test_object_many_values():
assert writer() == '{"foo":null,"bar":{},"baz":"b\\taz"}'
json.loads(writer())
def test_object_many_values_without_none():
writer = JsonWriter()\
.start_object()\
@@ -89,7 +92,7 @@ def test_object_many_values_without_none():
.keyval_not_none('bar', None)\
.keyval_not_none('baz', '')\
.keyval_not_none('eve', False,
transform = lambda v: 'yes' if v else 'no')\
transform=lambda v: 'yes' if v else 'no')\
.end_object()
assert writer() == '{"foo":0,"baz":"","eve":"no"}'