S allius/pytest (#211)

* - fix pytest setup that can be startet from the rootdir
  - support python venv environment
  - add pytest.ini
  - move common settings from .vscode/settings.json into pytest.ini
  - add missing requirements
  - fix import paths for pytests

* - support python venv environment

* initial version

* - add missing requirements python-dotenv

* fix import paths for pytests

* fix pytest warnings

* initial version

* report 5 slowest test durations

* add more vscode settings for python
This commit is contained in:
Stefan Allius
2024-11-24 22:07:43 +01:00
committed by GitHub
parent 84231c034c
commit 3bada76516
40 changed files with 187 additions and 248 deletions

View File

@@ -3,19 +3,11 @@ import weakref
from typing import Callable
from enum import Enum
if __name__ == "app.src.messages":
from app.src.async_ifc import AsyncIfc
from app.src.protocol_ifc import ProtocolIfc
from app.src.infos import Infos, Register
from app.src.modbus import Modbus
from app.src.my_timer import Timer
else: # pragma: no cover
from async_ifc import AsyncIfc
from protocol_ifc import ProtocolIfc
from infos import Infos, Register
from modbus import Modbus
from my_timer import Timer
from async_ifc import AsyncIfc
from protocol_ifc import ProtocolIfc
from infos import Infos, Register
from modbus import Modbus
from my_timer import Timer
logger = logging.getLogger('msg')