File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
examples/pure-hatch/tests/examplePy Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 13
13
14
14
@pytest .fixture
15
15
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."""
18
17
filename = TEST_DATA / "temperatures_testdata.csv"
19
18
df = pandas .read_csv (filename )
20
19
return df
21
20
22
21
23
22
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
28
26
29
27
# Calculate the means
30
28
df_mean , df_final = temporal .calc_annual_mean (temperatures )
@@ -36,8 +34,7 @@ def test_calc_annual_mean(temperatures):
36
34
37
35
38
36
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"""
41
38
temperatures = pandas .DataFrame (columns = ("Year" , "Month" , "Temperature" ))
42
39
43
40
# Calculate the means with no data
You can’t perform that action at this time.
0 commit comments