Typical folder structure for a python project with unit and integration tests?

python, unit-testing

Solution

Similar to what you have shown, the typical python project structure is as follows.

├── app_name
    │
    ├── app_name
    │   ├── __init__.py
    │   ├── folder_name
    │   └── etc...
    ├── tests
    │   ├── unit
    │   └── integration
    ├── README.md
    ├── setup.py
    └── requirements.txt

This statement is largely due to personal experience, but it is also the structure advocated here.

I have also seen an `integration_tests` directory as a sibling of the `tests` directory instead, but I believe that this is much less common.

Contrary to Bhavish Agarwal's answer, I see no mention of integration tests for Django (only integration tests using Django). It seems they decided not to have any.

Problem

What would be a typical structure and path/import conventions used? Would anyone have a link to a representative python project? ``` project.scratch/ project/ scratch/ __init__.py dostuff.py tests/ unit/ test_dostuff.py integration/ test_integration.py ```

Original source