Skip to content

Commit d3f8dbf

Browse files
committed
moved event loop back into test files
1 parent 614c32a commit d3f8dbf

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

tests/system/data/__init__.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
import asyncio
1716
import pytest
1817
import uuid
1918
from google.cloud.bigtable.data._cross_sync import CrossSync
@@ -29,14 +28,6 @@ class SystemTestRunner:
2928
used by standard system tests, and metrics tests
3029
"""
3130

32-
@CrossSync.drop
33-
@pytest.fixture(scope="session")
34-
def event_loop(self):
35-
loop = asyncio.get_event_loop()
36-
yield loop
37-
loop.stop()
38-
loop.close()
39-
4031
@pytest.fixture(scope="session")
4132
def init_table_id(self):
4233
"""

tests/system/data/test_metrics_async.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ def __repr__(self):
5858
@CrossSync.convert_class(sync_name="TestMetrics")
5959
class TestMetricsAsync(SystemTestRunner):
6060

61+
@CrossSync.drop
62+
@pytest.fixture(scope="session")
63+
def event_loop(self):
64+
loop = asyncio.get_event_loop()
65+
yield loop
66+
loop.stop()
67+
loop.close()
68+
6169
def _make_client(self):
6270
project = os.getenv("GOOGLE_CLOUD_PROJECT") or None
6371
return CrossSync.DataClient(project=project)

tests/system/data/test_system_async.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import asyncio
1516
import pytest
1617
import datetime
1718
import uuid
@@ -152,6 +153,15 @@ async def create_row_and_mutation(
152153

153154
@CrossSync.convert_class(sync_name="TestSystem")
154155
class TestSystemAsync(SystemTestRunner):
156+
157+
@CrossSync.drop
158+
@pytest.fixture(scope="session")
159+
def event_loop(self):
160+
loop = asyncio.get_event_loop()
161+
yield loop
162+
loop.stop()
163+
loop.close()
164+
155165
def _make_client(self):
156166
project = os.getenv("GOOGLE_CLOUD_PROJECT") or None
157167
return CrossSync.DataClient(project=project)

0 commit comments

Comments
 (0)