From 31fb39b3ae309bcb92e1ba7e3828a0807ff3d85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 12 Mar 2019 18:53:12 +0100 Subject: [PATCH] Support pytest 4 (#1687942) --- 174.patch | 23 +++++++++++++++++++++++ python-chardet.spec | 5 ++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 174.patch diff --git a/174.patch b/174.patch new file mode 100644 index 0000000..eef88e9 --- /dev/null +++ b/174.patch @@ -0,0 +1,23 @@ +From 0561ddcedcd12ea1f98b7ddedb93686ed8a5ffa4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Tue, 12 Mar 2019 18:44:36 +0100 +Subject: [PATCH] Support pytest 4, don't apply marks directly to parameters + +Fixes https://github.com/chardet/chardet/issues/173 +--- + test.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test.py b/test.py +index 9833307..ad2b753 100644 +--- a/test.py ++++ b/test.py +@@ -59,7 +59,7 @@ def gen_test_params(): + full_path = join(path, file_name) + test_case = full_path, encoding + if full_path in EXPECTED_FAILURES: +- test_case = pytest.mark.xfail(test_case) ++ test_case = pytest.param(*test_case, marks=pytest.mark.xfail) + yield test_case + + diff --git a/python-chardet.spec b/python-chardet.spec index c002fb5..33a1346 100644 --- a/python-chardet.spec +++ b/python-chardet.spec @@ -7,6 +7,9 @@ License: LGPLv2 URL: https://github.com/%{pypi_name}/%{pypi_name} Source0: %pypi_source +# pytest 4 support +Patch1: https://github.com/chardet/chardet/pull/174.patch + BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2-setuptools @@ -45,7 +48,7 @@ smart as your browser. Open source. Python 3 version. %prep -%setup -q -n %{pypi_name}-%{version} +%autosetup -p1 -n %{pypi_name}-%{version} sed -ie '1d' %{pypi_name}/cli/chardetect.py %build