File tree Expand file tree Collapse file tree 2 files changed +22
-21
lines changed Expand file tree Collapse file tree 2 files changed +22
-21
lines changed Original file line number Diff line number Diff line change 11from etcd3 .client import Client
2- from etcd3 import AioClient
32import pytest
43from .etcd_cluster import EtcdTestCluster
54
@@ -51,26 +50,6 @@ def _clear():
5150 return _clear
5251
5352
54- @pytest .fixture
55- async def aio_client (event_loop , request , etcd_cluster ):
56- """
57- init Etcd3Client, close its connection-pool when teardown
58- """
59-
60- c = AioClient (endpoints = etcd_cluster .get_endpoints (),
61- protocol = 'https' if etcd_cluster .ssl else 'http' )
62-
63- def teardown ():
64- async def _t ():
65- await c .close ()
66-
67- event_loop .run_until_complete (_t ())
68- event_loop ._close ()
69-
70- request .addfinalizer (teardown )
71- return c
72-
73-
7453def teardown_auth (etcd_cluster ): # pragma: no cover
7554 """
7655 disable auth, delete all users and roles
Original file line number Diff line number Diff line change 1+ import pytest
2+ from etcd3 import AioClient
3+
4+
5+ @pytest .fixture
6+ async def aio_client (event_loop , request , etcd_cluster ):
7+ """
8+ init Etcd3Client, close its connection-pool when teardown
9+ """
10+
11+ c = AioClient (endpoints = etcd_cluster .get_endpoints (),
12+ protocol = 'https' if etcd_cluster .ssl else 'http' )
13+
14+ def teardown ():
15+ async def _t ():
16+ await c .close ()
17+
18+ event_loop .run_until_complete (_t ())
19+ event_loop ._close ()
20+
21+ request .addfinalizer (teardown )
22+ return c
You can’t perform that action at this time.
0 commit comments