示例#1
0
def _fix_clean_db(request, settings_session):
    # loop fixture has function scope so can't be used here.
    from atoolbox.db import prepare_database

    loop = asyncio.new_event_loop()
    loop.run_until_complete(prepare_database(settings_session, True))
    teardown_test_loop(loop)
示例#2
0
def _fix_clean_db(request, settings_session):
    # loop fixture has function scope so can't be used here.
    loop = asyncio.new_event_loop()
    loop.run_until_complete(
        prepare_database(settings_session,
                         not request.config.getoption('--reuse-db')))
    teardown_test_loop(loop)
def function1698():
    '\n    a test client, called multiple times, should\n    not attempt to close the server again.\n    '
    var1555 = setup_test_loop()
    var2252 = function2617()
    var65 = _TestClient(var2252, loop=var1555)
    var1555.run_until_complete(var65.close())
    var1555.run_until_complete(var65.close())
    teardown_test_loop(var1555)
示例#4
0
def test_aiohttp_client_close_is_idempotent():
    """
    a test client, called multiple times, should
    not attempt to close the server again.
    """
    loop = setup_test_loop()
    app = _create_example_app()
    client = _TestClient(_TestServer(app, loop=loop), loop=loop)
    loop.run_until_complete(client.close())
    loop.run_until_complete(client.close())
    teardown_test_loop(loop)
示例#5
0
def test_test_client_close_is_idempotent():
    """
    a test client, called multiple times, should
    not attempt to close the loop again.
    """
    loop = setup_test_loop()
    app = _create_example_app(loop)
    client = _TestClient(app)
    client.close()
    teardown_test_loop(loop)
    client.close()
示例#6
0
def test_test_client_close_is_idempotent():
    """
    a test client, called multiple times, should
    not attempt to close the loop again.
    """
    loop = setup_test_loop()
    app = _create_example_app(loop)
    client = TestClient(app)
    client.close()
    teardown_test_loop(loop)
    client.close()
示例#7
0
 def tearDown(self):
     from aiohttp.test_utils import teardown_test_loop
     self.loop.run_until_complete(self.tearDownAsync())
     teardown_test_loop(self.loop)
 def tearDown(self):
     self.loop.run_until_complete(self.as_class.graceful_cancel())
     teardown_test_loop(self.loop)
示例#9
0
 def tearDown(self):
     self.loop.run_until_complete(self.client.close())
     teardown_test_loop(self.loop)
示例#10
0
    def tearDown(self):
        Post.delete().execute()

        self.loop.run_until_complete(self.manager.manager.close())
        teardown_test_loop(self.loop)
示例#11
0
文件: utils.py 项目: welc32/aiovk
 def tearDown(self):
     self.loop.run_until_complete(self.tearDownAsync())
     teardown_test_loop(self.loop)
 def tearDown(self):
     self.loop.run_until_complete(self.as_class.graceful_cancel())
     teardown_test_loop(self.loop)