Skip to content

Commit 1ffd1ae

Browse files
authored
Update test_automatic_loop.py
1 parent 7790653 commit 1ffd1ae

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

tests/tests_pytorch/loops/optimization/test_automatic_loop.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
from collections.abc import Iterator, Mapping
15-
from contextlib import nullcontext
1615
from typing import Generic, TypeVar
1716

1817
import pytest
@@ -84,27 +83,3 @@ def training_step(self, batch, batch_idx):
8483

8584
with pytest.raises(MisconfigurationException, match=match):
8685
trainer.fit(model)
87-
88-
89-
@pytest.mark.parametrize("world_size", [1, 2])
90-
def test_skip_training_step_not_allowed(world_size, tmp_path):
91-
"""Test that skipping the training_step in distributed training is not allowed."""
92-
93-
class TestModel(BoringModel):
94-
def training_step(self, batch, batch_idx):
95-
return None
96-
97-
model = TestModel()
98-
trainer = Trainer(
99-
default_root_dir=tmp_path,
100-
max_steps=1,
101-
barebones=True,
102-
)
103-
trainer.strategy.world_size = world_size # mock world size without launching processes
104-
error_context = (
105-
pytest.raises(RuntimeError, match="Skipping the `training_step` .* is not supported")
106-
if world_size > 1
107-
else nullcontext()
108-
)
109-
with error_context:
110-
trainer.fit(model)

0 commit comments

Comments
 (0)