Browse Source

修改Test_trainer_other_things中Trainer.on的参数

tags/v1.0.0alpha
x54-729 3 years ago
parent
commit
96de608ef9
2 changed files with 5 additions and 4 deletions
  1. +4
    -4
      tests/core/controllers/test_trainer_other_things.py
  2. +1
    -0
      tests/core/controllers/test_trainer_wo_evaluator_torch.py

+ 4
- 4
tests/core/controllers/test_trainer_other_things.py View File

@@ -7,16 +7,16 @@ from tests.helpers.utils import magic_argv_env_context

@magic_argv_env_context
def test_trainer_torch_without_evaluator():
@Trainer.on(Events.on_train_epoch_begin(every=10))
@Trainer.on(Events.on_train_epoch_begin(every=10), marker="test_trainer_other_things")
def fn1(trainer):
pass

@Trainer.on(Events.on_train_batch_begin(every=10))
@Trainer.on(Events.on_train_batch_begin(every=10), marker="test_trainer_other_things")
def fn2(trainer, batch, indices):
pass

with pytest.raises(AssertionError):
@Trainer.on(Events.on_train_batch_begin(every=10))
with pytest.raises(BaseException):
@Trainer.on(Events.on_train_batch_begin(every=10), marker="test_trainer_other_things")
def fn3(trainer, batch):
pass



+ 1
- 0
tests/core/controllers/test_trainer_wo_evaluator_torch.py View File

@@ -286,6 +286,7 @@ def test_trainer_on_exception(
dist.destroy_process_group()


@pytest.mark.torch
@pytest.mark.parametrize("version", [0, 1, 2, 3])
@magic_argv_env_context
def test_torch_distributed_launch_1(version):


Loading…
Cancel
Save