Skip to content

Commit

Permalink
Remove contextvars workaround (#2009)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl authored Aug 16, 2021
1 parent 93fa54d commit 4e0642b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions 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 @@ -16,15 +16,10 @@

from opentelemetry.context.context import Context, _RuntimeContext

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

aiocontextvars # pylint:disable=pointless-statement

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

opentelemetry.context.aiocontextvarsfix # pylint:disable=pointless-statement
aiocontextvars # pylint: disable=pointless-statement


class ContextVarsRuntimeContext(_RuntimeContext):
Expand Down
10 changes: 1 addition & 9 deletions opentelemetry-api/tests/context/test_contextvars_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest
from sys import version_info
from unittest.mock import patch

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

from .base_context import ContextTestCases

if version_info.minor < 7:
raise unittest.SkipTest("contextvars not available")

from opentelemetry.context.contextvars_context import ( # pylint:disable=wrong-import-position
ContextVarsRuntimeContext,
)


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

0 comments on commit 4e0642b

Please sign in to comment.