forked from pool/python-proselint
Accepting request 682718 from home:jayvdb:py-check-failures
- Add test-use-sys-executable.patch to avoid invoking Python 3 CLI during Python 2 tests. OBS-URL: https://build.opensuse.org/request/show/682718 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-proselint?expand=0&rev=11
This commit is contained in:
committed by
Git OBS Bridge
parent
5d0a78e4d7
commit
6385757bb3
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 8 07:30:20 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||||
|
||||
- Add test-use-sys-executable.patch to avoid invoking Python 3 CLI
|
||||
during Python 2 tests.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 14 03:33:55 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||||
|
||||
|
@@ -27,6 +27,7 @@ URL: http://github.com/amperser/proselint
|
||||
Source: https://files.pythonhosted.org/packages/source/p/proselint/proselint-%{version}.tar.gz
|
||||
# test_weasel_words_misc is empty in this release, and `setup.py test` doesnt recognise nose's SkipTest
|
||||
Patch0: disable-empty-test.patch
|
||||
Patch1: test-use-sys-executable.patch
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
@@ -62,6 +63,7 @@ existing tools.
|
||||
%prep
|
||||
%setup -q -n proselint-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
sed -i -e '/^#!\//, 1d' proselint/*.py
|
||||
|
||||
%build
|
||||
@@ -72,8 +74,7 @@ sed -i -e '/^#!\//, 1d' proselint/*.py
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
# One test exec's without using sys.executable
|
||||
%python_expand PATH=%{buildroot}%{_bindir}:$PATH $python setup.py test
|
||||
%python_exec setup.py test
|
||||
|
||||
%files %{python_files}
|
||||
%doc CHANGELOG.md README.md
|
||||
|
29
test-use-sys-executable.patch
Normal file
29
test-use-sys-executable.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
From f6950839960354cf7986f2dcd73195cdb9588dc8 Mon Sep 17 00:00:00 2001
|
||||
From: John Vandenberg <jayvdb@gmail.com>
|
||||
Date: Fri, 8 Mar 2019 14:18:47 +0700
|
||||
Subject: [PATCH] test_version: Use sys.executable
|
||||
|
||||
---
|
||||
tests/_test_version.py | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tests/_test_version.py b/tests/_test_version.py
|
||||
index 7eb0d96f..2324b2ae 100644
|
||||
--- a/tests/_test_version.py
|
||||
+++ b/tests/_test_version.py
|
||||
@@ -5,6 +5,7 @@
|
||||
from .check import Check
|
||||
from proselint.version import __version__
|
||||
import subprocess
|
||||
+import sys
|
||||
|
||||
|
||||
class TestCheck(Check):
|
||||
@@ -14,5 +15,6 @@ class TestCheck(Check):
|
||||
|
||||
def test_version(self):
|
||||
"""Make sure the version number is correct."""
|
||||
- out = subprocess.check_output(["proselint", "--version"])
|
||||
+ out = subprocess.check_output(
|
||||
+ [sys.executable, "-m", "proselint", "--version"])
|
||||
assert out.decode('utf-8') == __version__ + "\n"
|
Reference in New Issue
Block a user