Skip to content

Commit

Permalink
remove duplicate test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Oct 26, 2024
1 parent cbd64cf commit 50e69c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
7 changes: 5 additions & 2 deletions docs/working_with_kml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ Open a KML file:
>>> k = KML.parse("docs/Document-clean.kml")
Extract all placemarks and print their geometries:
Extract all placemarks and print their geometries.
The function ``find_all`` recursively searches a KML document for elements of a specific
type and returns an iterator of all matching elements found in the document tree.

.. code-block:: pycon
Expand All @@ -39,7 +41,8 @@ Extract all placemarks and print their geometries:
You can also define what you are looking for by specifying additional parameters:
``find_all`` can also search for arbitrary elements by their attributes, by passing the
attribute name and value as keyword arguments:


.. code-block:: pycon
Expand Down
2 changes: 1 addition & 1 deletion fastkml/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def find_all(
):
yield obj
try:
attrs = [attr for attr in obj.__dict__ if not attr.startswith("_")]
attrs = (attr for attr in obj.__dict__ if not attr.startswith("_"))
except AttributeError:
return
for attr_name in attrs:
Expand Down
21 changes: 0 additions & 21 deletions tests/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,6 @@ def __init__(self, a: A, b: B, c: C) -> None:
result = list(find_all(d1, of_type=A, x=2))
assert not result

result = list(find_all(d1, of_type=A, x=1))
assert result == [a1]

result = list(find_all(d1, of_type=A, x=2))
assert not result

result = list(find_all(d1, of_type=A, x=1))
assert result == [a1]

result = list(find_all(d1, of_type=A, x=2))
assert not result

result = list(find_all(d1, of_type=A, x=1))
assert result == [a1]

result = list(find_all(d1, of_type=A, x=2))
assert not result

result = list(find_all(d1, of_type=A, x=1))
assert result == [a1]

result = list(find_all(d2, of_type=A, x=2))
assert result == [a2]

Expand Down

0 comments on commit 50e69c2

Please sign in to comment.