Commit graph

9 commits

Author SHA1 Message Date
Simon de Vlieger
5cb2da55f1 test: run mypy in test-src not in GH actions 2022-09-09 18:51:57 +02:00
Christian Kellner
5c8d11ebe1 test/pylint: check error code instead of exception
Instead of using `subprocess` with `check=True`, which will
echo the command used, including all the files it checked,
check the error code and if non-zero, fail the test with a
nice small error message.
2022-08-05 09:41:05 +02:00
Christian Kellner
cae23de605 test/pylint: add autopep8 test
Add a test to ensure our source code is PEP-8 compliant.
2022-08-05 09:41:05 +02:00
Christian Kellner
620f7c0f3e test/pylint: extract source files into fixture
Extract the code that discovers the source files into a fixture;
this is done so that we can share that other future tests.
2022-08-05 09:41:05 +02:00
Christian Kellner
bf2789fd91 test/pylint: convert to pytest
Convert the test to using pytest instead of unittest.
2022-08-05 09:41:05 +02:00
David Rheinsberg
240905d4a0 test: make TestBase inherit unittest.TestCase
We want to extend our base-class to support extensions to
unittest.TestCase, so make sure we inherit from it.

Adjust all callers to no longer inherit from TestCase, since this is now
done automatically by TestBase.
2020-06-05 09:27:40 +02:00
David Rheinsberg
4a6ee7081b test/pylint: select files via git-ls-tree
We currently run pylint on all files we find in the checkout. This is
particularly annoying when we have osbuild-stores in the checkout, which
then contain lots of python files in their stored trees.

Change the pylint test to use `git ls-tree` to find all files in the
index and then only run pylint against the subset that we are interested
in.
2020-05-29 11:07:44 +02:00
David Rheinsberg
39e989245d test: enable pylint warnings
Make pylint complain about warnings, not just errors. There are lots of
useful warnings and we generally do adhere to the coding-styles.
2020-05-28 11:06:05 +02:00
David Rheinsberg
082b840d94 test: integrate pylint into the test infrastructure
Introduce a third test-group called `src` alongside `mod` and `run.
This will contain tests that run against the source code of osbuild.

This initial commit introduces `test/src/test_pylint.py` which will run
the python linter against all our sources.
2020-05-13 14:26:05 +02:00