Project structure for a pytest project

project/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app.py
β”‚   β”œβ”€β”€ ...
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ conftest.py
β”‚   β”œβ”€β”€ test_login.py
β”‚   β”œβ”€β”€ test_register.py
β”‚   β”œβ”€β”€ ...
β”œβ”€β”€ pytest.ini
β”œβ”€β”€ requirements.txt
└── README.md
  • src/: directory for application code.

  • tests/: directory for test code.

  • conftest.py: file containing fixtures and hooks used across all tests.

  • test_login.py, test_register.py, etc.: test files containing test functions.

  • pytest.ini: configuration file for pytest.

  • requirements.txt: file containing project dependencies.

  • README.md: file containing project documentation.

Last updated