Skip to content

Commit

Permalink
fixup! Add deprecation tests and move deprecated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ddrevicky committed Oct 1, 2020
1 parent f5c17ac commit 98c0d7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/test_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ def test_tbd_remove_in_v0_11_0_trainer_gpu():
gpu_usage = GpuUsageLogger()


@pytest.mark.parametrize(['input', 'expected'], [
@pytest.mark.parametrize(['input_arg', 'expected'], [
(True, SimpleProfiler),
(False, PassThroughProfiler),
])
def test_trainer_profiler_remove_in_v0_11_0_trainer(input, expected):
def test_trainer_profiler_remove_in_v0_11_0_trainer(input_arg, expected):
with pytest.deprecated_call(match='will be removed in v0.11.0'):
trainer = Trainer(profiler=input)
trainer = Trainer(profiler=input_arg)
assert isinstance(trainer.profiler, expected)


Expand Down
6 changes: 3 additions & 3 deletions tests/trainer/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,15 +1130,15 @@ def setup(self, stage):
assert trainer.get_model().stage == 'test'


@pytest.mark.parametrize(['input', 'expected'], [
@pytest.mark.parametrize(['input_arg', 'expected'], [
(None, PassThroughProfiler),
(SimpleProfiler(), SimpleProfiler),
(AdvancedProfiler(), AdvancedProfiler),
('simple', SimpleProfiler),
('advanced', AdvancedProfiler),
])
def test_trainer_profiler_correct_args(input, expected):
kwargs = {'profiler': input} if input is not None else {}
def test_trainer_profiler_correct_args(input_arg, expected):
kwargs = {'profiler': input_arg} if input_arg is not None else {}
trainer = Trainer(**kwargs)
assert isinstance(trainer.profiler, expected)

Expand Down

0 comments on commit 98c0d7f

Please sign in to comment.