Skip to content

Commit

Permalink
Tests: remove skiptest_on_failure
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaEsmukov committed Sep 26, 2021
1 parent 7b01aa1 commit cf74ae6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 0 additions & 2 deletions test/geocoders/geonames.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ async def test_geocode(self):
await self.geocode_run(
{"query": "Mount Everest, Nepal"},
{"latitude": 27.987, "longitude": 86.925},
skiptest_on_failure=True, # sometimes the result is empty
)

async def test_query_urlencoding(self):
location = await self.geocode_run(
{"query": "Ry\u016b\u014d"},
{"latitude": 35.65, "longitude": 138.5},
skiptest_on_failure=True, # sometimes the result is empty
)
assert "Ry\u016b\u014d" in location.address

Expand Down
12 changes: 2 additions & 10 deletions test/geocoders/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ async def geocode_run(
*,
skiptest_on_errors=True,
expect_failure=False,
skiptest_on_failure=False
):
"""
Calls geocoder.geocode(**payload), then checks against `expected`.
Expand All @@ -113,10 +112,7 @@ async def geocode_run(
assert result is None
return
if result is None:
if skiptest_on_failure:
pytest.skip('%s: Skipping test due to empty result' % cls.__name__)
else:
pytest.fail('%s: No result found' % cls.__name__)
pytest.fail('%s: No result found' % cls.__name__)
if result == []:
pytest.fail('%s returned an empty list instead of None' % cls.__name__)
self._verify_request(result, exactly_one=payload.get('exactly_one', True),
Expand All @@ -128,7 +124,6 @@ async def reverse_run(
*,
skiptest_on_errors=True,
expect_failure=False,
skiptest_on_failure=False
):
"""
Calls geocoder.reverse(**payload), then checks against `expected`.
Expand All @@ -143,10 +138,7 @@ async def reverse_run(
assert result is None
return
if result is None:
if skiptest_on_failure:
pytest.skip('%s: Skipping test due to empty result' % cls.__name__)
else:
pytest.fail('%s: No result found' % cls.__name__)
pytest.fail('%s: No result found' % cls.__name__)
if result == []:
pytest.fail('%s returned an empty list instead of None' % cls.__name__)
self._verify_request(result, exactly_one=payload.get('exactly_one', True),
Expand Down

0 comments on commit cf74ae6

Please sign in to comment.