15
0

Accepting request 894266 from home:pgajdos:python

- actually run the testsuite, use %pytest macro
- added patches
  fix use unittest.mock instead of mock
  + python-flake8-polyfill-use-unittest-mock.patch

OBS-URL: https://build.opensuse.org/request/show/894266
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8-polyfill?expand=0&rev=7
This commit is contained in:
2021-05-19 10:20:06 +00:00
committed by Git OBS Bridge
parent 81313a4458
commit 3a120e97f6
3 changed files with 38 additions and 11 deletions

View File

@@ -0,0 +1,16 @@
Index: flake8-polyfill-1.0.2/tests/test_options.py
===================================================================
--- flake8-polyfill-1.0.2.orig/tests/test_options.py 2017-12-30 14:45:28.000000000 +0100
+++ flake8-polyfill-1.0.2/tests/test_options.py 2021-05-19 09:45:18.723426614 +0200
@@ -2,7 +2,10 @@
import optparse
import os
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
from flake8_polyfill import options

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed May 19 07:13:03 UTC 2021 - pgajdos@suse.com
- actually run the testsuite, use %pytest macro
- added patches
fix use unittest.mock instead of mock
+ python-flake8-polyfill-use-unittest-mock.patch
-------------------------------------------------------------------
Tue Dec 4 12:48:07 UTC 2018 - Matej Cepl <mcepl@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-flake8-polyfill
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# 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
@@ -17,24 +17,28 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name: python-flake8-polyfill
Version: 1.0.2
Release: 0
Summary: Polyfill package for Flake8 plugins
License: MIT
Group: Development/Languages/Python
Url: https://gitlab.com/pycqa/flake8-polyfill
URL: https://gitlab.com/pycqa/flake8-polyfill
Source: https://files.pythonhosted.org/packages/source/f/flake8-polyfill/flake8-polyfill-%{version}.tar.gz
# https://gitlab.com/pycqa/flake8-polyfill/-/merge_requests/8
Patch0: python-flake8-polyfill-use-unittest-mock.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module flake8}
%endif
Requires: python-flake8
BuildArch: noarch
# SECTION test requirements
%if %{suse_version} <= 1500
BuildRequires: python2-mock
%endif
BuildRequires: %{python_module flake8}
BuildRequires: %{python_module pytest}
# /SECTION
%python_subpackages
%description
@@ -43,6 +47,7 @@ Flake8 plugins that intend to support Flake8 2.x and 3.x simultaneously.
%prep
%setup -q -n flake8-polyfill-%{version}
%patch0 -p1
%build
%python_build
@@ -51,13 +56,11 @@ Flake8 plugins that intend to support Flake8 2.x and 3.x simultaneously.
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with test}
%check
%python_exec setup.py test
%endif
# tests/test_stdin.py: we do not have pep8 module in TW
%pytest -c /dev/null tests/test_options.py
%files %{python_files}
%defattr(-,root,root,-)
%doc AUTHORS.rst CHANGELOG.rst README.rst
%license LICENSE
%{python_sitelib}/*