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

ddtrace pytest integration breaks on pytest 8 #8217

Closed
leifwalsh opened this issue Jan 29, 2024 · 3 comments
Closed

ddtrace pytest integration breaks on pytest 8 #8217

leifwalsh opened this issue Jan 29, 2024 · 3 comments

Comments

@leifwalsh
Copy link

Summary of problem

I think ddtrace uses an API that was changed in pytest 8. Now, when running pytest in a project with ddtrace enabled, instead of running tests, it crashes.

The crash is on this line:

return pytest_package_item.module.__name__

I believe the explanation is that pytest-dev/pytest#11137 broke the ddtrace plugin's expectation that Package is a Module. This is explained more plainly in the changelog: https://github.com/pytest-dev/pytest/blob/c0dfc451861a0fbf9b9659e8f8d723ea730a5619/doc/en/changelog.rst#L137-L147

Which version of dd-trace-py are you using?

2.5.1

Which version of pip are you using?

23.3.2

Which libraries and their versions are you using?

pytest 8.0.0

How can we reproduce your problem?

Try upgrading to pytest 8 and see if you can run tests with the ddtrace plugin enabled.

What is the result that you get?

A pytest INTERNALERROR that ends with:

INTERNALERROR>   File "/.../site-packages/ddtrace/contrib/pytest/plugin.py", line 835, in pytest_ddtrace_get_item_module_name
INTERNALERROR>     return pytest_package_item.module.__name__
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> AttributeError: 'Package' object has not attribute 'module'

What is the result that you expected?

The tests should run.

@emmettbutler
Copy link
Collaborator

Thanks for bringing this to our attention, @leifwalsh. I've added a ticket about this to an internal backlog, and it will be included in future prioritization passes.

@emmettbutler emmettbutler closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2024
@leifwalsh
Copy link
Author

Thanks. Would you mind taking a note to update this ticket again when it's resolved or something?

@emmettbutler
Copy link
Collaborator

Will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants