Skip to content

Commit

Permalink
Remove reset_{meta,file}_index_cache() from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Sep 22, 2020
1 parent 624b56e commit f0e3c88
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
10 changes: 0 additions & 10 deletions tests/indexing/test_file_index_creation.py
Expand Up @@ -5,7 +5,6 @@
from wetterdienst.enumerations.column_names_enumeration import DWDMetaColumns
from wetterdienst.indexing.file_index_creation import (
create_file_index_for_climate_observations,
reset_file_index_cache,
)
from wetterdienst.enumerations.parameter_enumeration import Parameter
from wetterdienst.enumerations.time_resolution_enumeration import TimeResolution
Expand All @@ -14,7 +13,6 @@

@pytest.mark.remote
def test_file_index_creation():
reset_file_index_cache()

# Existing combination of parameters
file_index = create_file_index_for_climate_observations(
Expand All @@ -23,14 +21,6 @@ def test_file_index_creation():

assert not file_index.empty

reset_file_index_cache()

file_index2 = create_file_index_for_climate_observations(
Parameter.CLIMATE_SUMMARY, TimeResolution.DAILY, PeriodType.RECENT
)

assert file_index.equals(file_index2)

assert (
file_index.loc[
file_index[DWDMetaColumns.STATION_ID.value] == 1048,
Expand Down
12 changes: 1 addition & 11 deletions tests/indexing/test_meta_index_creation.py
Expand Up @@ -6,7 +6,6 @@
from wetterdienst.enumerations.column_names_enumeration import DWDMetaColumns
from wetterdienst.indexing.meta_index_creation import (
create_meta_index_for_climate_observations,
reset_meta_index_cache,
)
from wetterdienst.enumerations.parameter_enumeration import Parameter
from wetterdienst.enumerations.time_resolution_enumeration import TimeResolution
Expand All @@ -15,7 +14,6 @@

@pytest.mark.remote
def test_meta_index_creation():
reset_meta_index_cache()

# Existing combination of parameters
meta_index = create_meta_index_for_climate_observations(
Expand All @@ -24,14 +22,6 @@ def test_meta_index_creation():

assert not meta_index.empty

reset_meta_index_cache()

meta_index2 = create_meta_index_for_climate_observations(
Parameter.CLIMATE_SUMMARY, TimeResolution.DAILY, PeriodType.HISTORICAL
)

assert meta_index.equals(meta_index2)

# todo: replace IndexError with UrlError/WrongSetOfParametersError
with pytest.raises(requests.exceptions.HTTPError):
create_meta_index_for_climate_observations(
Expand All @@ -41,7 +31,7 @@ def test_meta_index_creation():

@pytest.mark.remote
def test_meta_index_1mph_creation():
reset_meta_index_cache()

meta_index_1mph = create_meta_index_for_climate_observations(
Parameter.PRECIPITATION, TimeResolution.MINUTE_1, PeriodType.HISTORICAL
)
Expand Down
11 changes: 0 additions & 11 deletions tests/test_parse_metadata.py
Expand Up @@ -2,7 +2,6 @@
import requests
from pandas import Timestamp

from wetterdienst import reset_meta_index_cache
from wetterdienst.additionals.geo_location import stations_to_geojson
from wetterdienst.enumerations.column_names_enumeration import DWDMetaColumns
from wetterdienst.parse_metadata import metadata_for_climate_observations
Expand All @@ -13,7 +12,6 @@

@pytest.mark.remote
def test_metadata_for_climate_observations():
reset_meta_index_cache()

# Existing combination of parameters
metadata = metadata_for_climate_observations(
Expand All @@ -22,14 +20,6 @@ def test_metadata_for_climate_observations():

assert not metadata.empty

reset_meta_index_cache()

metadata2 = metadata_for_climate_observations(
Parameter.CLIMATE_SUMMARY, TimeResolution.DAILY, PeriodType.HISTORICAL
)

assert metadata.equals(metadata2)

assert metadata.loc[
metadata[DWDMetaColumns.STATION_ID.value] == 1, :
].values.tolist() == [
Expand All @@ -55,7 +45,6 @@ def test_metadata_for_climate_observations():

@pytest.mark.remote
def test_metadata_geojson():
reset_meta_index_cache()

# Existing combination of parameters
df = metadata_for_climate_observations(
Expand Down

0 comments on commit f0e3c88

Please sign in to comment.