0

Pycharm imports works correctly, but when I execute test_settings.py in the terminal, I have this error:

ImportError while importing test module '/home/ed/PycharmProjects/TTime/tests/test_settings.py'.

Hint: make sure your test modules/packages have valid Python names.

Traceback: tests/test_settings.py:3: in from ttime import app, db E ModuleNotFoundError: No module named 'ttime'

Here is my Flask project structure. I tried to include init.py in the main folder and in the tests folder, but nothing changes. It seems like somethings is wrong with python paths.

.
├── config.py
├── README.md
├── requirements.txt
├── runserver.py
├── tests
│   ├── functional
│   │   └── __init__.py
│   ├── pytest.ini
│   ├── test_settings.py
│   └── unit
│       ├── __init__.py
│       └── test_models.py
└── ttime
    ├── __init__.py
    ├── models.py
    ├── routes.py
    ├── static
    └── templates
        ├── base.html
        └── index.html

0 Answers0