Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rename test objects to avoid pytest warnings #3779

Closed
@xrmx

Description

@xrmx

Describe your environment

Steps to reproduce

tox -e py311-opentelemetry-api

You can substitute py311 with whatever python version you have locally.

What is the expected behavior?

No pytest warnings

What is the actual behavior?

opentelemetry-api/tests/logs/test_proxy.py:35
  /home/rm/src/opentelemetry-python/opentelemetry-api/tests/logs/test_proxy.py:35: PytestCollectionWarning: cannot collect test class 'TestLogger' because it has a __init__ constructor (from: opentelemetry-api/tests/logs/test_proxy.py)
    class TestLogger(_logs.NoOpLogger):

opentelemetry-api/tests/trace/test_globals.py:10
  /home/rm/src/opentelemetry-python/opentelemetry-api/tests/trace/test_globals.py:10: PytestCollectionWarning: cannot collect test class 'TestSpan' because it has a __init__ constructor (from: opentelemetry-api/tests/trace/test_globals.py)
    class TestSpan(trace.NonRecordingSpan):

opentelemetry-api/tests/trace/test_proxy.py:49
  /home/rm/src/opentelemetry-python/opentelemetry-api/tests/trace/test_proxy.py:49: PytestCollectionWarning: cannot collect test class 'TestSpan' because it has a __init__ constructor (from: opentelemetry-api/tests/trace/test_proxy.py)
    class TestSpan(NonRecordingSpan):

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions