lundi 6 janvier 2020

Python regular and unittest import models conflict

I'm having problems with two different import ways requested by running my project and it's unittest. The project has the following structure:

project
|-- app
|   |-- __init__.py
|   |-- model.py
|   |-- other.py
|
|-- test
    |-- __init__.py
    |-- model.py

Well, while I use python3 project to run it, I'm using the -m flag to run unittest, however the way you need to write imports for this two methods are different.

while for unittest I need to use the models to find each archive I want to import, I can't do this way for the regular interpretation.

How to go around it?

Aucun commentaire:

Enregistrer un commentaire