test_fixtures.py 文件源码

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

项目:ccs-twistedextensions 作者: apple 项目源码 文件源码
def test_buildConnectionPool(self):
        """
        L{buildConnectionPool} returns a L{ConnectionPool} which will be
        running only for the duration of the test.
        """
        collect = []

        class SampleTest(TestCase):

            def setUp(self):
                self.pool = buildConnectionPool(self)

            def test_sample(self):
                collect.append(self.pool.running)

            def tearDown(self):
                collect.append(self.pool.running)

        r = TestResult()
        t = SampleTest("test_sample")
        t.run(r)
        self.assertIsInstance(t.pool, ConnectionPool)
        self.assertEqual([True, False], collect)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号