test_runtest.py 文件源码

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

项目:maas 作者: maas 项目源码 文件源码
def test_catches_generator_tests(self):

        class BrokenTests(TestCase):

            run_tests_with = self.executor

            def test(self):
                yield None

        test = BrokenTests("test")
        result = test.run()

        self.assertThat(result.errors, HasLength(1))
        self.assertThat(result.errors[0], MatchesListwise((
            Is(test),
            DocTestMatches(
                """\
                ...InvalidTest:
                    Test returned a generator. Should it be
                    decorated with inlineCallbacks?
                """
            ),
        )))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号