1919
2020
2121def test_v2_0_0_unsupported_agg_and_log_metrics (tmpdir ):
22+ logger = CSVLogger (tmpdir )
23+ with pytest .raises (
24+ RuntimeError ,
25+ match = "CSVLogger.agg_and_log_metrics`.*no longer supported as of v1.8" ,
26+ ):
27+ logger .agg_and_log_metrics ()
28+
2229 class AggAndLogMetricsLogger (CSVLogger ):
2330 def agg_and_log_metrics (self , metrics , step ):
2431 pass
2532
26- model = BoringModel ()
2733 logger = AggAndLogMetricsLogger (tmpdir )
28-
34+ model = BoringModel ()
2935 trainer = Trainer (logger = logger )
30-
3136 with pytest .raises (
3237 RuntimeError ,
33- match = "`AggAndLogMetricsLogger.agg_and_log_metrics` was deprecated in v1.6 and is no longer supported" ,
38+ match = "`AggAndLogMetricsLogger.agg_and_log_metrics`.* no longer supported as of v1.8 " ,
3439 ):
3540 trainer .fit (model )
3641
3742
3843def test_v2_0_0_unsupported_update_agg_funcs (tmpdir ):
44+ logger = CSVLogger (tmpdir )
45+ with pytest .raises (
46+ RuntimeError ,
47+ match = "CSVLogger.update_agg_funcs`.*no longer supported as of v1.8" ,
48+ ):
49+ logger .update_agg_funcs ()
50+
3951 class UpdateAggFuncsLogger (CSVLogger ):
4052 def update_agg_funcs (self , metrics , step ):
4153 pass
4254
4355 model = BoringModel ()
4456 logger = UpdateAggFuncsLogger (tmpdir )
45-
4657 trainer = Trainer (logger = logger )
47-
4858 with pytest .raises (
4959 RuntimeError ,
5060 match = "`UpdateAggFuncsLogger.update_agg_funcs` was deprecated in v1.6 and is no longer supported" ,
@@ -55,10 +65,10 @@ def update_agg_funcs(self, metrics, step):
5565def test_v2_0_0_unsupported_logger_collection_class ():
5666 from pytorch_lightning .loggers .base import LoggerCollection
5767
58- with pytest .raises (RuntimeError , match = "`LoggerCollection` was deprecated in v1.6 and removed in v1.8." ):
68+ with pytest .raises (NotImplementedError , match = "`LoggerCollection` was deprecated in v1.6 and removed as of v1.8." ):
5969 LoggerCollection (None )
6070
6171 from pytorch_lightning .loggers .logger import LoggerCollection
6272
63- with pytest .raises (RuntimeError , match = "`LoggerCollection` was deprecated in v1.6 and removed in v1.8." ):
73+ with pytest .raises (RuntimeError , match = "`LoggerCollection` was deprecated in v1.6 and removed as of v1.8." ):
6474 LoggerCollection (None )
0 commit comments