Files
python-pydocstyle/integration-tests-invocation.patch
Tomáš Chvátal 4991c37f73 Accepting request 731067 from home:jayvdb:py3only
- Update integration-tests-invocation.patch to match PR submitted
  upstream, including an additional use of sys.executable in tests,
  and move disabling of problematic fixture to the .spec
- Update to v4.0.1
  * D401: Fixed a false positive where one stem had multiple
    imperative forms, e.g., init and initialize / initiate
  * Fix parser hanging when there's a comment directly after ``__all__``
  * Fixed RST error in table which resulted in the online
    documentation missing the violation code table
  * Fixed IndentationError when parsing function arguments
- from v4.0.0
  * Support for Python 2.x and PyPy has been dropped
  * Added initial support for Google convention
  * Added pre-commit hook (#346)
  * Fix parsing tuple syntax ``__all__`` (#355, #352).

OBS-URL: https://build.opensuse.org/request/show/731067
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydocstyle?expand=0&rev=12
2019-09-16 07:34:48 +00:00

40 lines
1.7 KiB
Diff

From 9379ef5b73a8a07a6e8c95185db33b849a9d015f Mon Sep 17 00:00:00 2001
From: John Vandenberg <jayvdb@gmail.com>
Date: Sun, 15 Sep 2019 14:13:44 +0700
Subject: [PATCH] test_integration: Use sys.executable
Literal `python` is often `python2` and may not be present at all.
Closes https://github.com/PyCQA/pydocstyle/issues/177
---
src/tests/test_integration.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/tests/test_integration.py b/src/tests/test_integration.py
index d4ee72b..1f9507f 100644
--- a/src/tests/test_integration.py
+++ b/src/tests/test_integration.py
@@ -80,9 +80,10 @@ def invoke(self, args="", target=None):
run_target = self.tempdir if target is None else \
os.path.join(self.tempdir, target)
- cmd = shlex.split("{} {} {}"
- .format(self.script_name, run_target, args),
- posix=False)
+ cmd = shlex.split(
+ ('"{}" -m {} {} {}' if sys.platform == "nt" else '{} -m {} {} {}')
+ .format(sys.executable, self.script_name, run_target, args),
+ posix=False)
p = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
@@ -203,7 +204,7 @@ def test_run_as_named_module():
return
# Add --match='' so that no files are actually checked (to make sure that
# the return code is 0 and to reduce execution time).
- cmd = shlex.split("python -m pydocstyle --match=''")
+ cmd = shlex.split("\"{}\" -m pydocstyle --match=''".format(sys.executable))
p = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)