@@ -38,6 +38,8 @@ the `test_daily_mean_zeros()` and `test_daily_mean_integers()`
3838into a single test function:
3939
4040~~~
41+ from inflammation.models import daily_mean
42+
4143@pytest.mark.parametrize(
4244 "test, expected",
4345 [
@@ -46,7 +48,6 @@ into a single test function:
4648 ])
4749def test_daily_mean(test, expected):
4850 """Test mean function works for array of zeroes and positive integers."""
49- from inflammation.models import daily_mean
5051 npt.assert_array_equal(daily_mean(np.array(test)), np.array(expected))
5152~~~
5253{: .language-python}
@@ -85,6 +86,8 @@ and adding more tests scales better as our code becomes more complex.
8586>
8687> > ## Solution
8788> > ~~~
89+ > > from inflammation.models import daily_max
90+ > > from inflammation.models import daily_min
8891> > ...
8992> > @pytest.mark.parametrize(
9093> > "test, expected",
@@ -95,7 +98,6 @@ and adding more tests scales better as our code becomes more complex.
9598> > ])
9699> > def test_daily_max(test, expected):
97100> > """Test max function works for zeroes, positive integers, mix of positive/negative integers."""
98- > > from inflammation.models import daily_max
99101> > npt.assert_array_equal(daily_max(np.array(test)), np.array(expected))
100102> >
101103> >
@@ -108,7 +110,6 @@ and adding more tests scales better as our code becomes more complex.
108110> > ])
109111> > def test_daily_min(test, expected):
110112> > """Test min function works for zeroes, positive integers, mix of positive/negative integers."""
111- > > from inflammation.models import daily_min
112113> > npt.assert_array_equal(daily_min(np.array(test)), np.array(expected))
113114> > ...
114115> > ~~~
0 commit comments