From 7c2d082cf4a69dcb6007acbba012ef66c6443069 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 26 Jan 2021 17:11:07 +0100 Subject: [PATCH] =?UTF-8?q?On=20lint=20le=20fichier=20de=20tests=20=C3=A9g?= =?UTF-8?q?alement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yohann D'ANELLO --- .gitlab-ci.yml | 6 +++--- main.py | 3 +++ main_test.py | 2 -- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a38fe0c..0aad755 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ flake8: image: python:3-alpine before_script: - pip install flake8 --no-cache-dir - script: flake8 main.py + script: flake8 main.py main_test.py allow_failure: true @@ -17,7 +17,7 @@ pylint: image: python:3-alpine before_script: - pip install pylint --no-cache-dir - script: pylint main.py + script: pylint main.py main_test.py allow_failure: true @@ -26,4 +26,4 @@ test: image: python:3-alpine before_script: - pip install pytest --no-cache-dir - script: pytest --show-locals . + script: pytest --showlocals . diff --git a/main.py b/main.py index 4394901..a17332f 100755 --- a/main.py +++ b/main.py @@ -28,6 +28,9 @@ def main(): def commande(name: str, *args): + """ + Exécute la commande `name` avec les arguments donnés. + """ return globals()[name](*args) diff --git a/main_test.py b/main_test.py index 4c2a21c..474379d 100755 --- a/main_test.py +++ b/main_test.py @@ -4,8 +4,6 @@ Exécution des tests du script. """ -import unittest - import main