Configuring the Testing Environment

Learn to configure Pytest in our Django application and run a basic test case.

Pytest, taken alone, is simply a Python framework to write unit tests in Python programs. Thankfully, there is a plugin for Pytest to write tests in Django projects and applications.

Creating the configuration file

Once the package is installed, we’ll create a new file called pytest.ini at the root of the Django project. Once it’s done, run the pytest command:

Get hands-on with 1200+ tech skills courses.