Skip to content

Commit

Permalink
test(async): remove the event loop session scoped fixture
Browse files Browse the repository at this point in the history
Signed-off-by: florian <florian@harfanglab.fr>
  • Loading branch information
florianvazelle committed Jul 21, 2023
1 parent 8d04eaa commit 92fb09e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
12 changes: 2 additions & 10 deletions test_opensearchpy/test_async/test_server/test_helpers/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.

import asyncio
import re
from datetime import datetime

Expand All @@ -34,21 +33,14 @@
pytestmark = pytest.mark.asyncio


@pytest.fixture(scope="session")
def event_loop():
loop = asyncio.get_event_loop()
yield loop
loop.close()


@fixture(scope="session")
@fixture(scope="function")
async def client():
client = await get_test_client(verify_certs=False, http_auth=("admin", "admin"))
await add_connection("default", client)
return client


@fixture(scope="session")
@fixture(scope="function")
async def opensearch_version(client):
info = await client.info()
print(info)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class MetricSearch(AsyncFacetedSearch):
}


@pytest.fixture(scope="session")
@pytest.fixture(scope="function")
def commit_search_cls(opensearch_version):
interval_kwargs = {"fixed_interval": "1d"}

Expand All @@ -77,7 +77,7 @@ class CommitSearch(AsyncFacetedSearch):
return CommitSearch


@pytest.fixture(scope="session")
@pytest.fixture(scope="function")
def repo_search_cls(opensearch_version):
interval_type = "calendar_interval"

Expand All @@ -98,7 +98,7 @@ def search(self):
return RepoSearch


@pytest.fixture(scope="session")
@pytest.fixture(scope="function")
def pr_search_cls(opensearch_version):
interval_type = "calendar_interval"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@

import unittest

import pytest

from opensearchpy.helpers.test import OPENSEARCH_VERSION

from .. import AsyncOpenSearchTestCase

pytestmark = pytest.mark.asyncio


class TestAlertingPlugin(AsyncOpenSearchTestCase):
@unittest.skipUnless(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@

from __future__ import unicode_literals

import pytest

from opensearchpy.exceptions import NotFoundError

from .. import AsyncOpenSearchTestCase

pytestmark = pytest.mark.asyncio


class TestIndexManagementPlugin(AsyncOpenSearchTestCase):
POLICY_NAME = "example-policy"
Expand Down

0 comments on commit 92fb09e

Please sign in to comment.