Accepting request 829551 from home:mcalabkova:branches:devel:languages:python:pytest

- Add patch pytest6.patch to fix tests
- Drop python2 because newer pytest is needed

OBS-URL: https://build.opensuse.org/request/show/829551
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-isort?expand=0&rev=13
This commit is contained in:
Tomáš Chvátal
2020-08-25 12:56:51 +00:00
committed by Git OBS Bridge
parent 7e6c469122
commit 823191f03a
3 changed files with 32 additions and 1 deletions

22
pytest6.patch Normal file
View File

@@ -0,0 +1,22 @@
Index: pytest-isort-1.1.0/test_isort.py
===================================================================
--- pytest-isort-1.1.0.orig/test_isort.py
+++ pytest-isort-1.1.0/test_isort.py
@@ -155,7 +155,7 @@ class TestIsortItem:
path = testdir.tmpdir
kwargs = {}
- test_obj = IsortItem(path, parent, **kwargs)
+ test_obj = IsortItem.from_parent(parent, **kwargs, fspath=path)
assert test_obj.name == path.basename
assert test_obj.parent == parent
@@ -183,7 +183,7 @@ class TestIsortItem:
path = testdir.tmpdir
kwargs = {'fspath': path}
- test_obj = IsortItem(None, parent, **kwargs)
+ test_obj = IsortItem.from_parent(parent, **kwargs)
assert test_obj.name == path.basename
assert test_obj.parent == parent

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Aug 25 11:53:40 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- Add patch pytest6.patch to fix tests
- Drop python2 because newer pytest is needed
-------------------------------------------------------------------
Sat Jul 11 23:13:19 UTC 2020 - Benjamin Greiner <code@bnavigator.de>

View File

@@ -17,6 +17,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-pytest-isort
Version: 1.1.0
Release: 0
@@ -24,8 +25,9 @@ Summary: Plugin for pytest to perform isort checks
License: BSD-3-Clause
URL: https://github.com/moccu/pytest-isort/
Source: https://files.pythonhosted.org/packages/source/p/pytest-isort/pytest-isort-%{version}.tar.gz
Patch0: pytest6.patch
BuildRequires: %{python_module isort >= 4.0}
BuildRequires: %{python_module pytest >= 3.5}
BuildRequires: %{python_module pytest >= 5}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -39,6 +41,7 @@ This is a py.test plugin to check import ordering using isort.
%prep
%setup -q -n pytest-isort-%{version}
%patch0 -p1
%build
%python_build