pytest-django
pytest-django copied to clipboard
How to Run Tests of Third Party Apps
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?
+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 .