Skip to content

Commit

Permalink
test: runexpensive test for raise of perf warning on FindTag init wit…
Browse files Browse the repository at this point in the history
…h large osm fixture
  • Loading branch information
r-leyshon committed Jun 19, 2024
1 parent ed563fe commit 177401f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/osm/test_validate_osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
FindIds,
FindLocations,
FindTags,
PerformanceWarning,
_convert_osm_dict_to_gdf,
_filter_target_dict_with_list,
)
Expand Down Expand Up @@ -466,6 +467,18 @@ def test_find_tags_init(self, _tiny_osm_tags):
]
_class_atttribute_assertions(tags, expected_attrs, expected_methods)

@pytest.mark.runexpensive
def test_find_tags_init_warning(self):
"""Test that large OSM files trigger a performance warning.
execution duration c.80 seconds.
"""
with pytest.warns(
PerformanceWarning,
match=".*Consider filtering the pbf file smaller than 50000 bytes",
):
FindTags(here("tests/data/newport-2023-06-13.osm.pbf"))

def test_find_tags_check_tags_for_ids(self, _tiny_osm_tags, _tiny_osm_ids):
"""Test FindTags.check_tags_for_ids()."""
ids = _tiny_osm_ids
Expand Down

0 comments on commit 177401f

Please sign in to comment.