diff --git a/python-proselint.changes b/python-proselint.changes index c14a2cc..6bab2be 100644 --- a/python-proselint.changes +++ b/python-proselint.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 8 07:30:20 UTC 2019 - John Vandenberg + +- 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 diff --git a/python-proselint.spec b/python-proselint.spec index e1196c3..45da441 100644 --- a/python-proselint.spec +++ b/python-proselint.spec @@ -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 diff --git a/test-use-sys-executable.patch b/test-use-sys-executable.patch new file mode 100644 index 0000000..1b2eab0 --- /dev/null +++ b/test-use-sys-executable.patch @@ -0,0 +1,29 @@ +From f6950839960354cf7986f2dcd73195cdb9588dc8 Mon Sep 17 00:00:00 2001 +From: John Vandenberg +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"