Skip to content

Commit efe64f2

Browse files
committed
try fixing tests
1 parent 186897d commit efe64f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/tests_pytorch/utilities/test_model_summary.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,15 +338,15 @@ def test_model_size_precision(tmp_path, accelerator, precision):
338338
assert model.pre_calculated_model_size == summary.model_size
339339

340340

341-
def test_model_size_warning_on_unsupported_precision():
341+
def test_model_size_warning_on_unsupported_precision(tmp_path):
342342
"""Test that a warning is raised when the precision is not supported."""
343343
model = PreCalculatedModel(precision=32) # fallback to 32 bits
344344

345345
# supported precision by lightning but not by the model summary
346-
trainer = Trainer(max_epochs=1, precision="16-mixed")
346+
trainer = Trainer(max_epochs=1, precision="16-mixed", default_root_dir=tmp_path)
347347
trainer.fit(model)
348348

349-
with pytest.warns(UserWarning, match="Precision 16-mixed is not supported by the model summary.*"):
349+
with pytest.warns(UserWarning, match="Precision .* is not supported by the model summary.*"):
350350
summary = summarize(model)
351351
assert model.pre_calculated_model_size == summary.model_size
352352

0 commit comments

Comments
 (0)