From 92339c3ed1cedd50010fe03da21f4c21e68eefcdcbb1ea1bd71f2f6bb14ca23a Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Tue, 4 Oct 2022 16:21:23 +0000 Subject: [PATCH] - Add 29.patch to fix tests OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8-pep3101?expand=0&rev=5 --- 29.patch | 25 +++++++++++++++++++++++++ python-flake8-pep3101.changes | 5 +++++ python-flake8-pep3101.spec | 6 ++++-- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 29.patch diff --git a/29.patch b/29.patch new file mode 100644 index 0000000..30004a5 --- /dev/null +++ b/29.patch @@ -0,0 +1,25 @@ +From c196256a0f24d43bc45afb4c2d88b2b1a0008f37 Mon Sep 17 00:00:00 2001 +From: Daniel Garcia Moreno +Date: Tue, 4 Oct 2022 18:15:16 +0200 +Subject: [PATCH] tests: Fix test_multiline_formatter + +This test fails with the latest version of flake8 because it tries to +write to sys.stdout.buffer and the OutputCapture by default uses +StringIO. This patch changes this specific test to use files instead. +--- + run_tests.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/run_tests.py b/run_tests.py +index 95f5c28..9c5e911 100644 +--- a/run_tests.py ++++ b/run_tests.py +@@ -62,7 +62,7 @@ def test_multiline_formatter(self): + '% (\'world\'))', + ])) + app = application.Application() +- with OutputCapture() as output: ++ with OutputCapture(fd=True) as output: + app.run([file_path, ]) + + self.assertIn( diff --git a/python-flake8-pep3101.changes b/python-flake8-pep3101.changes index 5ebf6e1..eb1396c 100644 --- a/python-flake8-pep3101.changes +++ b/python-flake8-pep3101.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 4 16:20:28 UTC 2022 - Daniel Garcia + +- Add 29.patch to fix tests + ------------------------------------------------------------------- Thu Apr 16 10:40:00 UTC 2020 - Tomáš Chvátal diff --git a/python-flake8-pep3101.spec b/python-flake8-pep3101.spec index 249b561..0b14abe 100644 --- a/python-flake8-pep3101.spec +++ b/python-flake8-pep3101.spec @@ -1,7 +1,7 @@ # # spec file for package python-flake8-pep3101 # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,6 +25,8 @@ License: GPL-2.0-only Group: Development/Languages/Python URL: https://github.com/gforcada/flake8-pep3101 Source: https://files.pythonhosted.org/packages/source/f/flake8-pep3101/flake8-pep3101-%{version}.tar.gz +# PATCH-FIX-UPSTREAM 29.patch gh#gforcada/flake8-pep3101#29 +Patch: https://github.com/gforcada/flake8-pep3101/pull/29.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -41,7 +43,7 @@ BuildRequires: %{python_module testfixtures} Checks for old string formatting. %prep -%setup -q -n flake8-pep3101-%{version} +%autosetup -p1 -n flake8-pep3101-%{version} %build %python_build