Skip to content

Commit

Permalink
Update deprecation versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ddrevicky committed Oct 27, 2020
1 parent 4f92fba commit f911f37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pytorch_lightning/trainer/connectors/profiler_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def on_trainer_init(self, profiler: Union[BaseProfiler, bool, str]):

if isinstance(profiler, bool):
rank_zero_warn("Passing a bool value as a `profiler` argument to `Trainer` is deprecated"
" and will be removed in v1.2.0. Use str ('simple' or 'advanced') instead.",
" and will be removed in v1.3. Use str ('simple' or 'advanced') instead.",
DeprecationWarning)
if profiler:
profiler = SimpleProfiler()
Expand Down
8 changes: 4 additions & 4 deletions tests/test_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ def test_tbd_remove_in_v1_2_0():
checkpoint_cb = ModelCheckpoint(filepath='.', dirpath='.')


# TODO: remove bool from Trainer.profiler param in v1.2.0, update profiler_connector.py
# TODO: remove bool from Trainer.profiler param in v1.3.0, update profiler_connector.py
@pytest.mark.parametrize(['profiler', 'expected'], [
(True, SimpleProfiler),
(False, PassThroughProfiler),
])
def test_trainer_profiler_remove_in_v1_2_0(profiler, expected):
with pytest.deprecated_call(match='will be removed in v1.2.0'):
def test_trainer_profiler_remove_in_v1_3_0(profiler, expected):
with pytest.deprecated_call(match='will be removed in v1.3'):
trainer = Trainer(profiler=profiler)
assert isinstance(trainer.profiler, expected)

Expand All @@ -45,7 +45,7 @@ def test_trainer_profiler_remove_in_v1_2_0(profiler, expected):
('--profiler False', False, PassThroughProfiler),
],
)
def test_trainer_cli_profiler_remove_in_v1_2_0(cli_args, expected_parsed_arg, expected_profiler):
def test_trainer_cli_profiler_remove_in_v1_3_0(cli_args, expected_parsed_arg, expected_profiler):
cli_args = cli_args.split(' ')
with mock.patch("argparse._sys.argv", ["any.py"] + cli_args):
parser = ArgumentParser(add_help=False)
Expand Down

0 comments on commit f911f37

Please sign in to comment.