def test_warn_on_deprecated_flags(self):
sys.argv = ["[executable]",
"evaluate",
"--archive_file", "tests/fixtures/bidaf/serialization/model.tar.gz",
"--evaluation_data_file", "tests/fixtures/data/squad.json",
"--cuda_device", "-1"]
with self.assertLogs(level=logging.WARNING) as context:
main()
assert set(context.output) == {
'WARNING:allennlp.commands:Argument name --archive_file is deprecated '
'(and will likely go away at some point), please use --archive-file instead',
'WARNING:allennlp.commands:Argument name --evaluation_data_file is deprecated '
'(and will likely go away at some point), please use --evaluation-data-file instead',
'WARNING:allennlp.commands:Argument name --cuda_device is deprecated '
'(and will likely go away at some point), please use --cuda-device instead',
}
评论列表
文章目录