15
0

Accepting request 681588 from home:jayvdb:coala:python3-bears

- Fix %check to run the tests from GitHub tarball, and use integration-tests-invocation.patch to invoke pycodestyle using sys.executable, and do not install and uninstall pip during tests.
- Fix line endings and remove hashbangs
- Update to v3.0.0, including support for Python 3.7

OBS-URL: https://build.opensuse.org/request/show/681588
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydocstyle?expand=0&rev=9
This commit is contained in:
Tomáš Chvátal
2019-03-05 09:59:08 +00:00
committed by Git OBS Bridge
parent 19aa9a01b1
commit e59f9a72fb
5 changed files with 96 additions and 22 deletions

View File

@@ -0,0 +1,44 @@
--- pydocstyle-3.0.0-orig/src/tests/test_integration.py 2018-10-14 17:54:04.000000000 +0700
+++ pydocstyle-3.0.0/src/tests/test_integration.py 2019-02-22 03:23:27.301363601 +0700
@@ -80,8 +80,9 @@
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),
+ cmd = shlex.split("{} -m {} {} {}"
+ .format(sys.executable, self.script_name,
+ run_target, args),
posix=False)
p = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
@@ -102,19 +103,6 @@
pass
-@pytest.yield_fixture(scope="module")
-def install_package(request):
- """Install the package in development mode for the tests.
-
- This is so we can run the integration tests on the installed console
- script.
- """
- cwd = os.path.join(os.path.dirname(__file__), '..', '..')
- subprocess.check_call(shlex.split("pip install -e ."), cwd=cwd)
- yield
- subprocess.check_call(shlex.split("pip uninstall -y pydocstyle"), cwd=cwd)
-
-
@pytest.yield_fixture(scope="function")
def env(request):
"""Add a testing environment to a test method."""
@@ -122,9 +110,6 @@
yield test_env
-pytestmark = pytest.mark.usefixtures("install_package")
-
-
def parse_errors(err):
"""Parse `err` to a dictionary of {filename: error_codes}.