Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop TestBase DeprecationWarnings from instrumentor test span info checks #3033

Closed
tammy-baylis-swi opened this issue Nov 20, 2024 · 0 comments · Fixed by #3037
Closed

Stop TestBase DeprecationWarnings from instrumentor test span info checks #3033

tammy-baylis-swi opened this issue Nov 20, 2024 · 0 comments · Fixed by #3037
Assignees
Labels
bug Something isn't working

Comments

@tammy-baylis-swi
Copy link
Contributor

Describe your environment

OS: Ubuntu
Python version: Python 3.12.5
Package version: 0.50b0.dev (local)
SDK version: 1.29.0.dev (local)
API version: 1.29.0.dev (local)

What happened?

Several instrumentor tests are using core util assertEqualSpanInstrumentationInfo and this results in deprecation warnings, e.g.

instrumentation/opentelemetry-instrumentation-mysqlclient/tests/test_mysqlclient_integration.py::TestMySQLClientIntegration::test_instrumentor
  /Users/tammy/opentelemetry-python-contrib/.tox/py312-test-instrumentation-mysqlclient/lib/python3.12/site-packages/opentelemetry/test/test_base.py:74: DeprecationWarning: Call to deprecated function (or staticmethod) instrumentation_info. (You should use instrumentation_scope) -- Deprecated since version 1.11.1.
    self.assertEqual(span.instrumentation_info.name, module.__name__)

instrumentation/opentelemetry-instrumentation-mysqlclient/tests/test_mysqlclient_integration.py::TestMySQLClientIntegration::test_instrumentor
  /Users/tammy/opentelemetry-python-contrib/.tox/py312-test-instrumentation-mysqlclient/lib/python3.12/site-packages/opentelemetry/test/test_base.py:75: DeprecationWarning: Call to deprecated function (or staticmethod) instrumentation_info. (You should use instrumentation_scope) -- Deprecated since version 1.11.1.
    self.assertEqual(span.instrumentation_info.version, module.__version__)

I think they should all switch to using assertEqualSpanInstrumentationScope.

Steps to Reproduce

  1. Checkout the contrib repo at main.
  2. Run any instrumentor unit tests that call assertEqualSpanInstrumentationInfo, e.g. tox -e py312-test-instrumentation-mysqlclient.
  3. Check tox output for warnings.

Expected Result

No Deprecation warnings.

Actual Result

DeprecationWarning as described above.

Additional context

No response

Would you like to implement a fix?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant