Ejemplo n.º 1
0
    def test_mean_by_day_deprecation_warning(self):
        """Test generation of deprecation warning for mean_by_day"""

        with warnings.catch_warnings(record=True) as war:
            try:
                avg.mean_by_day(None, 'dummy1')
            except TypeError:
                # Setting inst to None should produce a TypeError after
                # warning is generated
                pass

        assert len(war) >= 1
        assert war[0].category == DeprecationWarning
Ejemplo n.º 2
0
 def test_basic_daily_mean(self):
     """ Test basic daily mean"""
     self.testInst.bounds = self.bounds1
     ans = avg.mean_by_day(self.testInst, 'dummy4')
     assert np.all(ans == 86399/2.0)