Skip to content

Commit 32beed8

Browse files
committed
Clean up and simplify example unit tests
1 parent 32b9bc8 commit 32beed8

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

examples/pure-hatch/tests/examplePy/test_temporal.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@
1313

1414
@pytest.fixture
1515
def temperatures():
16-
"""Pytest fixture for temperature data, used to avoid duplicate code
17-
in all of our tests."""
16+
"""Pytest fixture for temperature data, used to avoid duplicate code in all of our tests."""
1817
filename = TEST_DATA / "temperatures_testdata.csv"
1918
df = pandas.read_csv(filename)
2019
return df
2120

2221

2322
def test_calc_annual_mean(temperatures):
24-
"""Test the calculation of the annual and total mean temperatures in the
25-
data"""
26-
expected_mean_1988 = temperature.fahrenheit_to_celsius(56.0)
27-
expected_mean_final = temperature.fahrenheit_to_celsius(50.78252)
23+
"""Test the calculation of the annual and total mean temperatures in the data"""
24+
expected_mean_1988 = 13.3333
25+
expected_mean_final = 10.4347
2826

2927
# Calculate the means
3028
df_mean, df_final = temporal.calc_annual_mean(temperatures)
@@ -36,8 +34,7 @@ def test_calc_annual_mean(temperatures):
3634

3735

3836
def test_calc_annual_mean_no_data():
39-
"""Negative test - test the calculation of the annual and total mean
40-
temperatures in the data when given no data results in an empty result"""
37+
"""Negative test - test the calculation of the annual and total mean temperatures in the data when given no data results in an empty result"""
4138
temperatures = pandas.DataFrame(columns=("Year", "Month", "Temperature"))
4239

4340
# Calculate the means with no data

0 commit comments

Comments
 (0)