1
0
forked from pool/python-mutmut

- Update to 1.6.0:

* Various minor fixes around in the package
- Remove merged patches pr_148.patch merged_4405bafe.patch
- Rebase patch pr_134.patch
- Add patch no-direct-python-call.patch to avoid direct calls
  to python binary

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mutmut?expand=0&rev=3
This commit is contained in:
Tomáš Chvátal 2019-10-15 08:19:02 +00:00 committed by Git OBS Bridge
parent 3fd620780d
commit bed5e7ccf2
8 changed files with 49 additions and 114 deletions

3
1.6.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:608f6368572594d673c798b420fdd0298a1ce5a52a398072f5a52ae8de897d0f
size 42053

View File

@ -1,22 +0,0 @@
From 4405bafe48981e63c2b560e28f6e85ed0e601f23 Mon Sep 17 00:00:00 2001
From: Nathan Klapstein <nklapste@ualberta.ca>
Date: Thu, 22 Aug 2019 18:07:48 -0400
Subject: [PATCH] fixing issue with whatthepatch 0.0.6
---
mutmut/__main__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mutmut/__main__.py b/mutmut/__main__.py
index 5066393..396767a 100644
--- a/mutmut/__main__.py
+++ b/mutmut/__main__.py
@@ -635,7 +635,7 @@ def read_patch_data(patch_file_path):
diffs = whatthepatch.parse_patch(f.read())
return {
- diff.header.new_path: {line_number for old_line_number, line_number, text in diff.changes if old_line_number is None}
+ diff.header.new_path: {line_number for old_line_number, line_number, text, *_ in diff.changes if old_line_number is None}
for diff in diffs
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b9895f93c456f4a6b8f0d597ccbe647f3d36a0a86415494c25ffc42894e3c4ae
size 41691

View File

@ -0,0 +1,13 @@
Index: mutmut-1.6.0/tests/test_main.py
===================================================================
--- mutmut-1.6.0.orig/tests/test_main.py
+++ mutmut-1.6.0/tests/test_main.py
@@ -337,7 +337,7 @@ def test_use_coverage(capsys, filesystem
assert int(root.attrib['disabled']) == 0
# generate a `.coverage` file by invoking pytest
- subprocess.run(["python", "-m", "pytest", "--cov=.", "foo.py"])
+ subprocess.run([sys.executable, "-m", "pytest", "--cov=.", "foo.py"])
assert os.path.isfile('.coverage')
result = CliRunner().invoke(climain, ['run', '--paths-to-mutate=foo.py', "--test-time-base=15.0", "--use-coverage"], catch_exceptions=False)

View File

@ -8,16 +8,16 @@ It's more likely to be the correct Python executable in case where someone speci
mutmut/__main__.py | 2 +- mutmut/__main__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mutmut/__main__.py b/mutmut/__main__.py Index: mutmut-1.6.0/mutmut/__main__.py
index 1f86048..d300a23 100644 ===================================================================
--- a/mutmut/__main__.py --- mutmut-1.6.0.orig/mutmut/__main__.py
+++ b/mutmut/__main__.py +++ mutmut-1.6.0/mutmut/__main__.py
@@ -193,7 +193,7 @@ def print_progress(self): @@ -193,7 +193,7 @@ class Progress(object):
@click.option('--post-mutation')
@config_from_setup_cfg( @config_from_setup_cfg(
dict_synonyms='', dict_synonyms='',
paths_to_exclude='',
- runner='python -m pytest -x', - runner='python -m pytest -x',
+ runner='"' + sys.executable + '" -m pytest -x', + runner='"' + sys.executable + '" -m pytest -x',
tests_dir=DEFAULT_TESTS_DIR, tests_dir='tests/:test/',
pre_mutation=None, pre_mutation=None,
post_mutation=None, post_mutation=None,

View File

@ -1,62 +0,0 @@
From b963cf66e26599fa7ac4a1646dd1be5704624673 Mon Sep 17 00:00:00 2001
From: John Vandenberg <jayvdb@gmail.com>
Date: Wed, 4 Sep 2019 12:37:28 +0700
Subject: [PATCH] test_main: Use sys.executable
Avoids test failures related to multiple pythons,
especially when the `python` executable is Python 2.
---
tests/test_main.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
Index: mutmut-1.5.1/tests/test_main.py
===================================================================
--- mutmut-1.5.1.orig/tests/test_main.py
+++ mutmut-1.5.1/tests/test_main.py
@@ -20,6 +20,7 @@ try:
except ImportError:
from mock import MagicMock, call
+PYTHON = '"{}"'.format(sys.executable)
file_to_mutate_lines = [
"def foo(a, b):",
@@ -168,7 +169,10 @@ def test_python_source_files__with_paths
def test_popen_streaming_output_timeout():
start = time()
with pytest.raises(TimeoutError):
- popen_streaming_output('python -c "import time; time.sleep(4)"', lambda line: line, timeout=0.1)
+ popen_streaming_output(
+ PYTHON + ' -c "import time; time.sleep(4)"',
+ lambda line: line, timeout=0.1,
+ )
assert (time() - start) < 3
@@ -176,20 +180,23 @@ def test_popen_streaming_output_timeout(
def test_popen_streaming_output_stream():
mock = MagicMock()
popen_streaming_output(
- 'python -c "print(\'first\'); print(\'second\')"',
+ PYTHON + ' -c "print(\'first\'); print(\'second\')"',
callback=mock
)
mock.assert_has_calls([call('first'), call('second')])
mock = MagicMock()
popen_streaming_output(
- 'python -c "import time; print(\'first\'); time.sleep(1); print(\'second\'); print(\'third\')"',
+ PYTHON +
+ ' -c "import time; print(\'first\'); time.sleep(1); print(\'second\'); print(\'third\')"',
callback=mock
)
mock.assert_has_calls([call('first'), call('second'), call('third')])
mock = MagicMock()
- popen_streaming_output('python -c "exit(0);"', callback=mock)
+ popen_streaming_output(
+ PYTHON + ' -c "exit(0);"',
+ callback=mock)
mock.assert_not_called()

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue Oct 15 07:51:17 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 1.6.0:
* Various minor fixes around in the package
- Remove merged patches pr_148.patch merged_4405bafe.patch
- Rebase patch pr_134.patch
- Add patch no-direct-python-call.patch to avoid direct calls
to python binary
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Aug 7 03:15:06 AM UTC 2019 - John Vandenberg <jayvdb@gmail.com> Wed Aug 7 03:15:06 AM UTC 2019 - John Vandenberg <jayvdb@gmail.com>

View File

@ -20,19 +20,27 @@
# tri.declarative is Python 3 only # tri.declarative is Python 3 only
%define skip_python2 1 %define skip_python2 1
Name: python-mutmut Name: python-mutmut
Version: 1.5.1 Version: 1.6.0
Release: 0 Release: 0
Summary: Python mutation testing Summary: Python mutation testing
License: BSD-3-Clause License: BSD-3-Clause
Group: Development/Languages/Python URL: https://github.com/boxed/mutmut
Url: https://github.com/boxed/mutmut Source: https://github.com/boxed/mutmut/archive/%{version}.tar.gz
Source: https://files.pythonhosted.org/packages/source/m/mutmut/mutmut-%{version}.tar.gz Patch1: pr_134.patch
Patch0: https://github.com/boxed/mutmut/commit/merged_4405bafe.patch Patch2: no-direct-python-call.patch
Patch1: https://github.com/boxed/mutmut/commit/bd386631.patch#/pr_134.patch
# Backport of https://github.com/boxed/mutmut/pull/148
Patch2: pr_148.patch
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-click
Requires: python-glob2
Requires: python-junit-xml >= 1.8
Requires: python-parso
Requires: python-pony
Requires: python-tri.declarative >= 3.0.0
Recommends: python-coverage
Recommends: python-pytest
Suggests: python-pytest-cov
BuildArch: noarch
# SECTION test requirements # SECTION test requirements
BuildRequires: %{python_module click} BuildRequires: %{python_module click}
BuildRequires: %{python_module coverage} BuildRequires: %{python_module coverage}
@ -48,18 +56,6 @@ BuildRequires: %{python_module whatthepatch >= 0.0.5}
BuildRequires: ed BuildRequires: ed
BuildRequires: patch BuildRequires: patch
# /SECTION # /SECTION
BuildRequires: fdupes
Requires: python-click
Requires: python-glob2
Requires: python-junit-xml >= 1.8
Requires: python-parso
Requires: python-pony
Requires: python-tri.declarative >= 3.0.0
Recommends: python-coverage
Recommends: python-pytest
Suggests: python-pytest-cov
BuildArch: noarch
%python_subpackages %python_subpackages
%description %description