Skip to content

Commit

Permalink
Fix flaky test caused by weak reference (#14157)
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca authored and awaelchli committed Aug 11, 2022
1 parent 1b320a5 commit 552f496
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ def test_dataloader_source_direct_access():
def test_dataloader_source_request_from_module():
"""Test requesting a dataloader from a module works."""
module = BoringModel()
module.trainer = Trainer()
trainer = Trainer()
module.trainer = trainer
module.foo = Mock(return_value=module.train_dataloader())

source = _DataLoaderSource(module, "foo")
Expand Down

0 comments on commit 552f496

Please sign in to comment.