def test_if_test_works_after_train(tmp_path):
    """Ensure that .test() works after .fit()"""
    model = BoringModel()
    trainer = Trainer(max_epochs=1, accelerator="tpu", devices="auto", default_root_dir=tmp_path, fast_dev_run=True)
    trainer.fit(model)
    out = trainer.test(model)
    assert len(out) == 1
Ensure that .test() works after .fit()
tests/tests_pytorch/accelerators/test_xla.py