forked from pool/python-flake8
Accepting request 930697 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/930697 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-flake8?expand=0&rev=36
This commit is contained in:
commit
5abe8f6f45
@ -3,52 +3,38 @@ Subject: Fix mock.patch with python3.4
|
|||||||
|
|
||||||
In python 3.5, mock.patch uses create=True automatically if you are patching
|
In python 3.5, mock.patch uses create=True automatically if you are patching
|
||||||
builtins in a module, but in python 3.4 the argument is still needed.
|
builtins in a module, but in python 3.4 the argument is still needed.
|
||||||
--- a/tests/unit/test_debug.py
|
diff --git a/tests/unit/test_base_formatter.py b/tests/unit/test_base_formatter.py
|
||||||
+++ b/tests/unit/test_debug.py
|
index d096457..47e74a6 100644
|
||||||
@@ -64,7 +64,7 @@ def test_information(system, pyversion,
|
|
||||||
system.assert_called_once_with()
|
|
||||||
|
|
||||||
|
|
||||||
-@mock.patch('flake8.main.debug.print')
|
|
||||||
+@mock.patch('flake8.main.debug.print', create=True)
|
|
||||||
@mock.patch('flake8.main.debug.information', return_value={})
|
|
||||||
@mock.patch('json.dumps', return_value='{}')
|
|
||||||
def test_print_information_no_plugins(dumps, information, print_mock):
|
|
||||||
@@ -79,7 +79,7 @@ def test_print_information_no_plugins(du
|
|
||||||
assert print_mock.called is False
|
|
||||||
|
|
||||||
|
|
||||||
-@mock.patch('flake8.main.debug.print')
|
|
||||||
+@mock.patch('flake8.main.debug.print', create=True)
|
|
||||||
@mock.patch('flake8.main.debug.information', return_value={})
|
|
||||||
@mock.patch('json.dumps', return_value='{}')
|
|
||||||
def test_print_information(dumps, information, print_mock):
|
|
||||||
--- a/tests/unit/test_base_formatter.py
|
--- a/tests/unit/test_base_formatter.py
|
||||||
+++ b/tests/unit/test_base_formatter.py
|
+++ b/tests/unit/test_base_formatter.py
|
||||||
@@ -20,7 +20,7 @@ def test_start(filename):
|
@@ -23,7 +23,7 @@ def test_start(filename):
|
||||||
"""Verify we open a new file in the start method."""
|
"""Verify we open a new file in the start method."""
|
||||||
mock_open = mock.mock_open()
|
mock_open = mock.mock_open()
|
||||||
formatter = base.BaseFormatter(options(output_file=filename))
|
formatter = base.BaseFormatter(options(output_file=filename))
|
||||||
- with mock.patch('flake8.formatting.base.open', mock_open):
|
- with mock.patch("flake8.formatting.base.open", mock_open):
|
||||||
+ with mock.patch('flake8.formatting.base.open', mock_open, create=True):
|
+ with mock.patch("flake8.formatting.base.open", mock_open, create=True):
|
||||||
formatter.start()
|
formatter.start()
|
||||||
|
|
||||||
if filename is None:
|
if filename is None:
|
||||||
@@ -100,7 +100,7 @@ def test_write_uses_an_output_file(tee):
|
diff --git a/tests/unit/test_debug.py b/tests/unit/test_debug.py
|
||||||
formatter = base.BaseFormatter(options(tee=tee))
|
index 2da4bf8..074b409 100644
|
||||||
formatter.output_fd = filemock
|
--- a/tests/unit/test_debug.py
|
||||||
|
+++ b/tests/unit/test_debug.py
|
||||||
- with mock.patch('flake8.formatting.base.print') as print_func:
|
@@ -95,7 +95,7 @@ def test_information(system, pyversion, pyimpl):
|
||||||
+ with mock.patch('flake8.formatting.base.print', create=True) as print_func:
|
system.assert_called_once_with()
|
||||||
formatter.write(line, source)
|
|
||||||
if tee:
|
|
||||||
assert print_func.called
|
|
||||||
@@ -119,7 +119,7 @@ def test_write_uses_an_output_file(tee):
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
-@mock.patch('flake8.formatting.base.print')
|
-@mock.patch("flake8.main.debug.print")
|
||||||
+@mock.patch('flake8.formatting.base.print', create=True)
|
+@mock.patch("flake8.main.debug.print", create=True)
|
||||||
def test_write_uses_print(print_function):
|
@mock.patch("flake8.main.debug.information", return_value={})
|
||||||
"""Verify that we use the print function without an output file."""
|
@mock.patch("json.dumps", return_value="{}")
|
||||||
line = 'Something to write'
|
def test_print_information_no_plugins(dumps, information, print_mock):
|
||||||
|
@@ -112,7 +112,7 @@ def test_print_information_no_plugins(dumps, information, print_mock):
|
||||||
|
assert print_mock.called is False
|
||||||
|
|
||||||
|
|
||||||
|
-@mock.patch("flake8.main.debug.print")
|
||||||
|
+@mock.patch("flake8.main.debug.print", create=True)
|
||||||
|
@mock.patch("flake8.main.debug.information", return_value={})
|
||||||
|
@mock.patch("json.dumps", return_value="{}")
|
||||||
|
def test_print_information(dumps, information, print_mock):
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b
|
|
||||||
size 164777
|
|
3
flake8-4.0.1.tar.gz
Normal file
3
flake8-4.0.1.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:806e034dda44114815e23c16ef92f95c91e4c71100ff52813adf7132a6ad870d
|
||||||
|
size 154905
|
@ -1,21 +0,0 @@
|
|||||||
From d34581b83f75e12e2c021577aa2523eea8a9b590 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Anthony Sottile <asottile@umich.edu>
|
|
||||||
Date: Sun, 15 Aug 2021 18:47:16 -0400
|
|
||||||
Subject: [PATCH] test using python3.10
|
|
||||||
|
|
||||||
---
|
|
||||||
.github/workflows/main.yml | 3 +++
|
|
||||||
pytest.ini | 4 +++-
|
|
||||||
tests/integration/test_main.py | 8 ++++++--
|
|
||||||
tests/unit/test_plugin_type_manager.py | 21 +++++++--------------
|
|
||||||
4 files changed, 19 insertions(+), 17 deletions(-)
|
|
||||||
|
|
||||||
Index: flake8-3.9.2/pytest.ini
|
|
||||||
===================================================================
|
|
||||||
--- flake8-3.9.2.orig/pytest.ini
|
|
||||||
+++ flake8-3.9.2/pytest.ini
|
|
||||||
@@ -8,3 +8,4 @@ filterwarnings =
|
|
||||||
# python3 raises this when importing setuptools
|
|
||||||
ignore:the imp module is deprecated in favour of importlib.*:PendingDeprecationWarning
|
|
||||||
ignore:the imp module is deprecated in favour of importlib.*:DeprecationWarning
|
|
||||||
+ ignore:SelectableGroups:DeprecationWarning
|
|
@ -1,3 +1,36 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Nov 9 08:06:25 UTC 2021 - Martin Liška <mliska@suse.cz>
|
||||||
|
|
||||||
|
- update to 4.0.1:
|
||||||
|
* Update spec python module dependencies accordingly.
|
||||||
|
* Fix parallel execution collecting a SyntaxError (See also #1410 #1408).
|
||||||
|
|
||||||
|
- update to 4.0.0:
|
||||||
|
* Remove --install-hook vcs integration (See also #1008).
|
||||||
|
* Remove setuptools command (See also #1009).
|
||||||
|
* Migrate from GitLab to GitHub (See also #1305).
|
||||||
|
* Due to constant confusion by users, user-level |Flake8| configuration files
|
||||||
|
are no longer supported. Files will not be searched for in the user's home
|
||||||
|
directory (e.g., ~/.flake8) nor in the XDG config directory (e.g.,
|
||||||
|
~/.config/flake8). (See also #1404).
|
||||||
|
|
||||||
|
* pycodestyle has been updated to >= 2.8.0, < 2.9.0 (See also #1406).
|
||||||
|
* Pyflakes has been updated to >= 2.4.0, < 2.5.0 (See also #1406).
|
||||||
|
* flake8 requires python >= 3.6 (See also #1010).
|
||||||
|
|
||||||
|
* Add --extend-select option (See also #1312 #1061).
|
||||||
|
* Automatically create directories for output files (See also #1329).
|
||||||
|
|
||||||
|
* ast parse before tokenizing to improve SyntaxError errors (See also
|
||||||
|
#1320 #740).
|
||||||
|
* Fix warning in --indent-size argparse help (See also #1367).
|
||||||
|
* Fix handling SyntaxError in python 3.10+ (See also #1374
|
||||||
|
#1372).
|
||||||
|
* Fix writing non-cp1252-encodable when output is piped on windows (See also
|
||||||
|
#1382 #1381).
|
||||||
|
|
||||||
|
- Rebase fix-mock-patch-with-python3.4.patch and remove ignore-selectable-groups-warning.patch.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Sep 24 09:06:44 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
|
Fri Sep 24 09:06:44 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
@ -19,21 +19,20 @@
|
|||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
%bcond_without python2
|
%bcond_without python2
|
||||||
Name: python-flake8
|
Name: python-flake8
|
||||||
Version: 3.9.2
|
Version: 4.0.1
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Modular source code checker: pep8, pyflakes and co
|
Summary: Modular source code checker: pep8, pyflakes and co
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://gitlab.com/pycqa/flake8
|
URL: https://gitlab.com/pycqa/flake8
|
||||||
Source: https://files.pythonhosted.org/packages/source/f/flake8/flake8-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/f/flake8/flake8-%{version}.tar.gz
|
||||||
Patch0: fix-mock-patch-with-python3.4.patch
|
Patch0: fix-mock-patch-with-python3.4.patch
|
||||||
Patch1: ignore-selectable-groups-warning.patch
|
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-importlib-metadata
|
Requires: python-importlib-metadata
|
||||||
Requires: python-mccabe >= 0.6.0
|
Requires: python-mccabe >= 0.6.0
|
||||||
Requires: python-pycodestyle >= 2.7.0
|
Requires: python-pycodestyle >= 2.8.0
|
||||||
Requires: python-pyflakes >= 2.3.0
|
Requires: python-pyflakes >= 2.4.0
|
||||||
Requires: python-typing
|
Requires: python-typing
|
||||||
Requires(post): update-alternatives
|
Requires(post): update-alternatives
|
||||||
Requires(postun):update-alternatives
|
Requires(postun):update-alternatives
|
||||||
@ -42,8 +41,8 @@ BuildArch: noarch
|
|||||||
BuildRequires: %{python_module importlib-metadata}
|
BuildRequires: %{python_module importlib-metadata}
|
||||||
BuildRequires: %{python_module mccabe >= 0.6.0}
|
BuildRequires: %{python_module mccabe >= 0.6.0}
|
||||||
BuildRequires: %{python_module mock}
|
BuildRequires: %{python_module mock}
|
||||||
BuildRequires: %{python_module pycodestyle >= 2.7.0}
|
BuildRequires: %{python_module pycodestyle >= 2.8.0}
|
||||||
BuildRequires: %{python_module pyflakes >= 2.3.0}
|
BuildRequires: %{python_module pyflakes >= 2.4.0}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module typing}
|
BuildRequires: %{python_module typing}
|
||||||
%if %{with python2}
|
%if %{with python2}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user