From b095dacd75f38f89765360b278ea134e9d2e26f3f26d3ee330160ff3bd24ff44 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 15 Mar 2021 14:00:06 +0000 Subject: [PATCH] Accepting request 879137 from home:bnavigator:branches:devel:languages:python:pytest - Add fix-pytest-makefile.patch to make it work with Pytest 6 gh#shopkeep/pytest-black#53 OBS-URL: https://build.opensuse.org/request/show/879137 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-black?expand=0&rev=10 --- fix-pytest-makefile.patch | 46 +++++++++++++++++++++++++++++++++++++ python-pytest-black.changes | 6 +++++ python-pytest-black.spec | 6 +++-- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 fix-pytest-makefile.patch diff --git a/fix-pytest-makefile.patch b/fix-pytest-makefile.patch new file mode 100644 index 0000000..c0cc27c --- /dev/null +++ b/fix-pytest-makefile.patch @@ -0,0 +1,46 @@ +From 475cf71aa9de3ededa972ffb36fb47ad79278531 Mon Sep 17 00:00:00 2001 +From: Ben Greiner +Date: Mon, 15 Mar 2021 11:42:27 +0100 +Subject: [PATCH] fix pytest.tmpdir.makefile call + +--- + tests/test_black.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/tests/test_black.py b/tests/test_black.py +index 0405169..a7a6026 100644 +--- a/tests/test_black.py ++++ b/tests/test_black.py +@@ -72,8 +72,8 @@ def test_exclude(testdir): + """Assert test is skipped if path is excluded even if also included + """ + testdir.makefile( +- "pyproject.toml", +- """ ++ ".toml", ++ pyproject = """ + [tool.black] + include = 'test_exclude.py' + exclude = '.*' +@@ -100,8 +100,8 @@ def test_exclude_folder(testdir): + """Assert test is skipped for files in a folder + """ + testdir.makefile( +- "pyproject.toml", +- """ ++ ".toml", ++ pyproject = """ + [tool.black] + exclude = ''' + ( +@@ -137,8 +137,8 @@ def test_include(testdir): + """Assert test is not skipped if path is included but not excluded + """ + testdir.makefile( +- "pyproject.toml", +- """ ++ ".toml", ++ pyproject = """ + [tool.black] + include = 'test_include' + """, diff --git a/python-pytest-black.changes b/python-pytest-black.changes index 84fd048..437794c 100644 --- a/python-pytest-black.changes +++ b/python-pytest-black.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 15 10:47:48 UTC 2021 - Ben Greiner + +- Add fix-pytest-makefile.patch to make it work with Pytest 6 + gh#shopkeep/pytest-black#53 + ------------------------------------------------------------------- Wed Oct 7 13:57:46 UTC 2020 - Marketa Calabkova diff --git a/python-pytest-black.spec b/python-pytest-black.spec index 0b8120d..5abcc62 100644 --- a/python-pytest-black.spec +++ b/python-pytest-black.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytest-black # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 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 @@ Summary: Black format checking plugin for pytest License: MIT URL: https://github.com/shopkeep/pytest-black Source: https://files.pythonhosted.org/packages/source/p/pytest-black/pytest-black-%{version}.tar.gz +# PATCH-FIX-UPSTREAM fix-pytest-makefile.patch -- gh#shopkeep/pytest-black#53 +Patch0: https://github.com/shopkeep/pytest-black/pull/53.patch#/fix-pytest-makefile.patch BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -44,7 +46,7 @@ BuildRequires: %{python_module toml} A pytest plugin to enable format checking with black. %prep -%setup -q -n pytest-black-%{version} +%autosetup -p1 -n pytest-black-%{version} %build %python_build