From 3ef97a2f6217e4335df0c8e3ae4c6390edf14463 Mon Sep 17 00:00:00 2001 From: Vsevolod Glumov Date: Mon, 25 Dec 2023 20:33:17 -0800 Subject: [PATCH 1/2] Update flake8 configuration --- .github/workflows/pythonpackage.yml | 9 +++++---- tox.ini | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 470da2f..e2e84e6 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -30,10 +30,11 @@ jobs: pip install -r requirements/test.txt - name: Lint with flake8 run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + flake8 ddt.py test + # # stop the build if there are Python syntax errors or undefined names + # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | pytest diff --git a/tox.ini b/tox.ini index 9c1ddef..5a082a9 100644 --- a/tox.ini +++ b/tox.ini @@ -24,3 +24,8 @@ commands = pytest --cov=ddt --cov-report html flake8 ddt.py test sphinx-build -b html docs docs/_build + +[flake8] +max-line-length = 127 +exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,.tox,.venv +max-complexity = 10 From b10a0678b2fdc47a128cb52287d85bfd85fd3ae8 Mon Sep 17 00:00:00 2001 From: Vsevolod Glumov Date: Mon, 25 Dec 2023 20:35:59 -0800 Subject: [PATCH 2/2] Fix flake8 issues --- test/test_functional.py | 4 ++-- test/test_named_data.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test/test_functional.py b/test/test_functional.py index a930dc3..d935c94 100644 --- a/test/test_functional.py +++ b/test/test_functional.py @@ -119,7 +119,7 @@ def hello(): extra_attrs.sort() assert len(extra_attrs) == 2 assert getattr(data_hello, extra_attrs[0]) == 1 - assert getattr(data_hello, extra_attrs[1]) == (1,2) + assert getattr(data_hello, extra_attrs[1]) == (1, 2) def test_file_data_decorator_with_dict(): @@ -137,7 +137,7 @@ def hello(): dh_keys = set(data_hello.__dict__.keys()) post_size = len(data_hello.__dict__) assert post_size == pre_size + 2 - + extra_attrs = list(dh_keys - keys) extra_attrs.sort() assert len(extra_attrs) == 2 diff --git a/test/test_named_data.py b/test/test_named_data.py index 51cae63..4ce523c 100644 --- a/test/test_named_data.py +++ b/test/test_named_data.py @@ -61,6 +61,3 @@ def test_missing_name_dict(self): ) def _internal_test(value): pass - - -