--- /dev/null
+Fix testdir.makefile usage according to:
+https://github.com/pytest-dev/pytest/issues/8192
+
+--- pytest-black-0.3.12/tests/test_black.py.orig 2020-10-05 11:41:50.000000000 +0200
++++ pytest-black-0.3.12/tests/test_black.py 2022-03-20 15:31:40.434889879 +0100
+@@ -71,8 +71,7 @@ def test_mtime_cache(testdir):
+ def test_exclude(testdir):
+ """Assert test is skipped if path is excluded even if also included
+ """
+- testdir.makefile(
+- "pyproject.toml",
++ testdir.makepyprojecttoml(
+ """
+ [tool.black]
+ include = 'test_exclude.py'
+@@ -89,9 +88,6 @@ def test_exclude(testdir):
+ # replace trailing newline (stripped by testdir.makepyfile)
+ p = p.write(p.read() + "\n")
+
+- # Rename pyproject.toml ¯\_(ツ)_/¯
+- testdir.run("mv", "test_exclude.pyproject.toml", "pyproject.toml")
+-
+ result = testdir.runpytest("--black")
+ result.assert_outcomes(skipped=1, passed=0)
+
+@@ -99,8 +95,7 @@ def test_exclude(testdir):
+ def test_exclude_folder(testdir):
+ """Assert test is skipped for files in a folder
+ """
+- testdir.makefile(
+- "pyproject.toml",
++ testdir.makepyprojecttoml(
+ """
+ [tool.black]
+ exclude = '''
+@@ -126,9 +121,6 @@ def test_exclude_folder(testdir):
+ ignore_folder = testdir.mkdir("ignore_folder")
+ testdir.run("mv", "test_exclude_folder.py", ignore_folder)
+
+- # Rename pyproject.toml ¯\_(ツ)_/¯
+- testdir.run("mv", "test_exclude_folder.pyproject.toml", "pyproject.toml")
+-
+ result = testdir.runpytest("--black")
+ result.assert_outcomes(skipped=1, passed=0)
+
+@@ -136,8 +128,7 @@ def test_exclude_folder(testdir):
+ def test_include(testdir):
+ """Assert test is not skipped if path is included but not excluded
+ """
+- testdir.makefile(
+- "pyproject.toml",
++ testdir.makepyprojecttoml(
+ """
+ [tool.black]
+ include = 'test_include'
+@@ -153,9 +144,6 @@ def test_include(testdir):
+ # replace trailing newline (stripped by testdir.makepyfile)
+ p = p.write(p.read() + "\n")
+
+- # Rename pyproject.toml ¯\_(ツ)_/¯
+- testdir.run("mv", "test_include.pyproject.toml", "pyproject.toml")
+-
+ result = testdir.runpytest("--black")
+ result.assert_outcomes(skipped=0, passed=1)
+
Summary(pl.UTF-8): Wtyczka pytesta do sprawdzania formatowania przy użyciu modułu black
Name: python-pytest-black
Version: 0.3.12
-Release: 1
+Release: 2
License: MIT
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/pytest-black/
Source0: https://files.pythonhosted.org/packages/source/p/pytest-black/pytest-black-%{version}.tar.gz
# Source0-md5: 5c44840754f9edfb5c775768aa07990a
+Patch0: %{name}-pytest.patch
URL: https://pypi.org/project/pytest-black/
%if %{with python2}
BuildRequires: python-modules >= 1:2.7
BuildRequires: python3-setuptools_scm
%if %{with tests}
BuildRequires: python3-black >= 19.3b0
-BuildRequires: python3-pytest >= 3.5.0
+BuildRequires: python3-pytest >= 6
BuildRequires: python3-toml
%endif
%endif
%prep
%setup -q -n pytest-black-%{version}
+%patch0 -p1
%build
%if %{with python2}