main_test.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:allennlp 作者: allenai 项目源码 文件源码
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',
            }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号