Skip to content

Commit 38a572d

Browse files
committed
Update test_remove_1-5.py
1 parent de32ceb commit 38a572d

File tree

1 file changed

+0
-90
lines changed

1 file changed

+0
-90
lines changed

tests/deprecated_api/test_remove_1-5.py

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -259,96 +259,6 @@ def on_train_epoch_end(self):
259259
trainer.fit(model)
260260

261261

262-
def test_v1_5_0_old_on_validation_epoch_end(tmpdir):
263-
callback_warning_cache.clear()
264-
265-
class OldSignature(Callback):
266-
267-
def on_validation_epoch_end(self, trainer, pl_module): # noqa
268-
...
269-
270-
model = BoringModel()
271-
trainer = Trainer(default_root_dir=tmpdir, max_epochs=1, callbacks=OldSignature())
272-
273-
with pytest.deprecated_call(match="old signature will be removed in v1.5"):
274-
trainer.fit(model)
275-
276-
class OldSignatureModel(BoringModel):
277-
278-
def on_validation_epoch_end(self): # noqa
279-
...
280-
281-
model = OldSignatureModel()
282-
283-
with pytest.deprecated_call(match="old signature will be removed in v1.5"):
284-
trainer.fit(model)
285-
286-
callback_warning_cache.clear()
287-
288-
class NewSignature(Callback):
289-
290-
def on_validation_epoch_end(self, trainer, pl_module, outputs):
291-
...
292-
293-
trainer.callbacks = [NewSignature()]
294-
with no_deprecated_call(match="`Callback.on_validation_epoch_end` signature has changed in v1.3."):
295-
trainer.fit(model)
296-
297-
class NewSignatureModel(BoringModel):
298-
299-
def on_validation_epoch_end(self, outputs):
300-
...
301-
302-
model = NewSignatureModel()
303-
with no_deprecated_call(match="`ModelHooks.on_validation_epoch_end` signature has changed in v1.3."):
304-
trainer.fit(model)
305-
306-
307-
def test_v1_5_0_old_on_test_epoch_end(tmpdir):
308-
callback_warning_cache.clear()
309-
310-
class OldSignature(Callback):
311-
312-
def on_test_epoch_end(self, trainer, pl_module): # noqa
313-
...
314-
315-
model = BoringModel()
316-
trainer = Trainer(default_root_dir=tmpdir, max_epochs=1, callbacks=OldSignature())
317-
318-
with pytest.deprecated_call(match="old signature will be removed in v1.5"):
319-
trainer.test(model)
320-
321-
class OldSignatureModel(BoringModel):
322-
323-
def on_test_epoch_end(self): # noqa
324-
...
325-
326-
model = OldSignatureModel()
327-
328-
with pytest.deprecated_call(match="old signature will be removed in v1.5"):
329-
trainer.test(model)
330-
331-
callback_warning_cache.clear()
332-
333-
class NewSignature(Callback):
334-
335-
def on_test_epoch_end(self, trainer, pl_module, outputs):
336-
...
337-
338-
trainer.callbacks = [NewSignature()]
339-
with no_deprecated_call(match="`Callback.on_test_epoch_end` signature has changed in v1.3."):
340-
trainer.test(model)
341-
342-
class NewSignatureModel(BoringModel):
343-
344-
def on_test_epoch_end(self, outputs):
345-
...
346-
347-
model = NewSignatureModel()
348-
with no_deprecated_call(match="`ModelHooks.on_test_epoch_end` signature has changed in v1.3."):
349-
trainer.test(model)
350-
351-
352262
@pytest.mark.parametrize("cls", (BaseProfiler, SimpleProfiler, AdvancedProfiler, PyTorchProfiler))
353263
def test_v1_5_0_profiler_output_filename(tmpdir, cls):
354264
filepath = str(tmpdir / "test.txt")

0 commit comments

Comments
 (0)