pytest-django icon indicating copy to clipboard operation
pytest-django copied to clipboard

How to Run Tests of Third Party Apps

Open 7xMind opened this issue 5 years ago • 1 comments
trafficstars

How can I run the tests of third party apps? With the default Django test runner, it would be as trivial as issuing: ./manage.py <name_of_the_installed_app>

But this seems not to be the case with pytest. If I install a third-party app and put it inside the istalled_app, how can I run the app's tests using pytest?

7xMind avatar Aug 12 '20 08:08 7xMind

+1. As a workaround I think you can copy the package to the root of your django app, so that it's treated as one of your own packages (maybe you will also have to pip uninstall the package)

> python
>>> import thirdpartyapp
>>> thirdpartyapp.__file__
/path/to/the/package/__init__.py

> cd src/djangoapp
> cp -rf /path/to/the/package .

mnieber avatar Aug 12 '21 07:08 mnieber