Repository: allisonkarlitskaya/systemd_ctypes (language: python)

Issue:
pyflakes fixes and CI



Discussion / hints:

Fix patch:
diff --git a/.gitignore b/.gitignore
index 3b462a2..b173c7e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+/.coverage
 /.tox/
 
 __pycache__/
diff --git a/pyproject.toml b/pyproject.toml
index f6e2e74..02462ad 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -21,9 +21,13 @@ envlist = site
 
 [testenv]
 deps=
+  coverage
   pytest
   python-dbusmock
-commands = python3 -m pytest {posargs}
+commands =
+  python3 -m coverage erase
+  python3 -m coverage run --source systemd_ctypes --module pytest {posargs}
+  python3 -m coverage report --skip-covered  --fail-under=85 --show-missing
 
 [testenv:site]
 sitepackages = true


Test patch:
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index 2ea5103..eff6e28 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -26,12 +26,28 @@ jobs:
         run: |
           if type apt >/dev/null 2>&1; then
               apt-get update
-              DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-dbusmock libsystemd0 python3-pytest tox
+              DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+                  libsystemd0 \
+                  python3-coverage \
+                  python3-dbusmock \
+                  python3-pytest \
+                  tox
           elif grep -q platform:el8 /etc/os-release; then
-              dnf install -y python3-pip systemd-libs
-              pip3 install python-dbusmock pytest tox
+              dnf install -y \
+                  python3-pip \
+                  systemd-libs
+              pip3 install \
+                  coverage \
+                  pytest \
+                  python-dbusmock \
+                  tox
           else
-              dnf install -y python3-dbusmock systemd-libs pytest tox
+              dnf install -y \
+                  pytest \
+                  python3-coverage \
+                  python3-dbusmock \
+                  systemd-libs \
+                  tox
           fi
 
       - name: Run tests
@@ -61,5 +77,10 @@ jobs:
           arch: ${{ matrix.arch }}
           install: |
             apt-get update
-            DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-dbusmock libsystemd0 python3-pytest tox
+            DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+                libsystemd0 \
+                python3-coverage \
+                python3-dbusmock \
+                python3-pytest \
+                tox
           run: tox -- -v