deptry icon indicating copy to clipboard operation
deptry copied to clipboard

Deptry should detect missing dependencies in tests/

Open MaxG87 opened this issue 2 years ago • 8 comments

As of now, deptry simply ignores eveything under tests/. This means that imports that are used but not present will be noticed only at execution time, not before.

For instance, suppose I have a tests/test_sending_request.py with the following content:

import httpretty

def test_sending_request():
    with httpretty.enabled():
        # do stuff
        pass

If httpretty is not included in the dev-dependencies, my test would crash with ModuleNotFoundError, even if I used deptry. Given that deptry can detect exactly this kind of issue for normal dependencies, I would love to see that extended to tests/ and, possibly, other folders as well.

MaxG87 avatar Feb 22 '23 14:02 MaxG87