Skip to content

Commit

Permalink
Remove contextvars workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Jul 29, 2021
1 parent 9d55e64 commit c3ec6cd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 103 deletions.
86 changes: 0 additions & 86 deletions opentelemetry-api/src/opentelemetry/context/aiocontextvarsfix.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from contextvars import ContextVar
from sys import version_info

from opentelemetry.context.context import Context, _RuntimeContext

if (3, 5, 3) <= version_info < (3, 7):
import aiocontextvars # type: ignore # pylint:disable=unused-import,import-error

elif (3, 4) < version_info <= (3, 5, 2):
import opentelemetry.context.aiocontextvarsfix # pylint:disable=unused-import


class ContextVarsRuntimeContext(_RuntimeContext):
"""An implementation of the RuntimeContext interface which wraps ContextVar under
Expand Down
11 changes: 1 addition & 10 deletions opentelemetry-api/tests/context/test_contextvars_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest
from unittest.mock import patch

from opentelemetry import context
from opentelemetry.context.contextvars_context import ContextVarsRuntimeContext

from .base_context import ContextTestCases

try:
import contextvars # pylint: disable=unused-import

from opentelemetry.context.contextvars_context import (
ContextVarsRuntimeContext,
)
except ImportError:
raise unittest.SkipTest("contextvars not available")


class TestContextVarsContext(ContextTestCases.BaseTest):
def setUp(self) -> None:
Expand Down

0 comments on commit c3ec6cd

Please sign in to comment.