Unit tests (#23)

* Added unit tests and linting tools for development

* Added pre-commit config file

* Added lint github action

* Add tests and coverage comments to PRs

* Set coverage options

* Fixed yaml

* Fixed permissions

* Omit tests in coverage report

* Run linting only on PRs
This commit is contained in:
Esteban Sánchez
2023-11-20 13:12:43 +01:00
committed by GitHub
parent 03a9ac78c6
commit 03e4222043
9 changed files with 345 additions and 15 deletions

View File

@@ -1,16 +1,17 @@
import time
import os
import sys
import signal
import faulthandler
from qbittorrentapi import Client, TorrentStates
from prometheus_client import start_http_server
from prometheus_client.core import GaugeMetricFamily, CounterMetricFamily, REGISTRY
import logging
from pythonjsonlogger import jsonlogger
from enum import StrEnum, auto
from typing import Iterable, Any
import os
import signal
import sys
import time
from dataclasses import dataclass, field
from enum import StrEnum, auto
from typing import Any, Iterable
from prometheus_client import start_http_server
from prometheus_client.core import REGISTRY, CounterMetricFamily, GaugeMetricFamily
from pythonjsonlogger import jsonlogger
from qbittorrentapi import Client, TorrentStates
# Enable dumps on stderr in case of segfault
faulthandler.enable()