forked from pool/python-pytest-server-fixtures
Accepting request 1041392 from home:pgajdos:python
- do not require six - use -p1 as quilt does not like higher - modified patches % pytest-plugins-pr186-fix-psycopg29.patch (refreshed) % remove-mock.patch (refreshed) - added patches fix https://github.com/man-group/pytest-plugins/issues/209 + python-pytest-server-fixtures-no-six.patch OBS-URL: https://build.opensuse.org/request/show/1041392 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-server-fixtures?expand=0&rev=14
This commit is contained in:
@@ -12,8 +12,8 @@ https://github.com/psycopg/psycopg2/issues/941
|
||||
|
||||
diff --git a/pytest-server-fixtures/pytest_server_fixtures/postgres.py b/pytest-server-fixtures/pytest_server_fixtures/postgres.py
|
||||
index 7c6ea33..aeab36a 100644
|
||||
--- a/pytest-server-fixtures/pytest_server_fixtures/postgres.py
|
||||
+++ b/pytest-server-fixtures/pytest_server_fixtures/postgres.py
|
||||
--- a/pytest_server_fixtures/postgres.py
|
||||
+++ b/pytest_server_fixtures/postgres.py
|
||||
@@ -103,18 +103,22 @@ def run_cmd(self):
|
||||
|
||||
def check_server_up(self):
|
||||
|
||||
103
python-pytest-server-fixtures-no-six.patch
Normal file
103
python-pytest-server-fixtures-no-six.patch
Normal file
@@ -0,0 +1,103 @@
|
||||
Index: pytest-server-fixtures-1.7.0/pytest_server_fixtures/base.py
|
||||
===================================================================
|
||||
--- pytest-server-fixtures-1.7.0.orig/pytest_server_fixtures/base.py
|
||||
+++ pytest-server-fixtures-1.7.0/pytest_server_fixtures/base.py
|
||||
@@ -14,8 +14,6 @@ import logging
|
||||
import random
|
||||
import errno
|
||||
|
||||
-from six import string_types
|
||||
-
|
||||
from pytest_server_fixtures import CONFIG
|
||||
from pytest_shutil.workspace import Workspace
|
||||
|
||||
@@ -109,7 +107,7 @@ class ProcessReader(threading.Thread):
|
||||
def run(self):
|
||||
while self.process.poll() is None:
|
||||
l = self.stream.readline()
|
||||
- if not isinstance(l, string_types):
|
||||
+ if not isinstance(l, str):
|
||||
l = l.decode('utf-8')
|
||||
|
||||
if l.strip():
|
||||
Index: pytest-server-fixtures-1.7.0/pytest_server_fixtures/http.py
|
||||
===================================================================
|
||||
--- pytest-server-fixtures-1.7.0.orig/pytest_server_fixtures/http.py
|
||||
+++ pytest-server-fixtures-1.7.0/pytest_server_fixtures/http.py
|
||||
@@ -9,7 +9,6 @@ import sys
|
||||
import pytest
|
||||
import requests
|
||||
from contextlib import contextmanager
|
||||
-from six.moves import http_client
|
||||
|
||||
from pytest_shutil.env import unset_env
|
||||
from pytest_server_fixtures import CONFIG
|
||||
@@ -83,7 +82,7 @@ class HTTPTestServer(TestServer):
|
||||
with self.handle_proxy():
|
||||
returned = requests.get('http://%s:%d/%s' % (self.hostname, self.port, path))
|
||||
return returned.json() if as_json else returned
|
||||
- except (http_client.BadStatusLine, requests.ConnectionError) as e:
|
||||
+ except (http.client.BadStatusLine, requests.ConnectionError) as e:
|
||||
time.sleep(int(i) / 10)
|
||||
pass
|
||||
raise e
|
||||
@@ -107,7 +106,7 @@ class HTTPTestServer(TestServer):
|
||||
with self.handle_proxy():
|
||||
returned = requests.post('http://%s:%d/%s' % (self.hostname, self.port, path), data=data)
|
||||
return returned.json() if as_json else returned
|
||||
- except (http_client.BadStatusLine, requests.ConnectionError) as e:
|
||||
+ except (http.client.BadStatusLine, requests.ConnectionError) as e:
|
||||
time.sleep(int(i) / 10)
|
||||
pass
|
||||
raise e
|
||||
Index: pytest-server-fixtures-1.7.0/pytest_server_fixtures/jenkins.py
|
||||
===================================================================
|
||||
--- pytest-server-fixtures-1.7.0.orig/pytest_server_fixtures/jenkins.py
|
||||
+++ pytest-server-fixtures-1.7.0/pytest_server_fixtures/jenkins.py
|
||||
@@ -9,7 +9,6 @@ import os.path
|
||||
import shutil
|
||||
|
||||
import pytest
|
||||
-import six
|
||||
|
||||
from pytest_server_fixtures import CONFIG
|
||||
from pytest_fixture_config import yield_requires_config
|
||||
@@ -95,7 +94,7 @@ class JenkinsTestServer(HTTPTestServer):
|
||||
if plugins is None:
|
||||
plugins = available_plugins.keys()
|
||||
else:
|
||||
- if isinstance(plugins, six.string_types):
|
||||
+ if isinstance(plugins, str):
|
||||
plugins = [plugins]
|
||||
|
||||
errors = []
|
||||
Index: pytest-server-fixtures-1.7.0/pytest_server_fixtures/postgres.py
|
||||
===================================================================
|
||||
--- pytest-server-fixtures-1.7.0.orig/pytest_server_fixtures/postgres.py
|
||||
+++ pytest-server-fixtures-1.7.0/pytest_server_fixtures/postgres.py
|
||||
@@ -8,7 +8,6 @@ import subprocess
|
||||
|
||||
import errno
|
||||
import pytest
|
||||
-from six import text_type
|
||||
|
||||
from pytest_server_fixtures import CONFIG
|
||||
from pytest_fixture_config import requires_config
|
||||
@@ -65,7 +64,7 @@ class PostgresServer(TestServer):
|
||||
try:
|
||||
self.pg_bin = subprocess.check_output([CONFIG.pg_config_executable, "--bindir"]).decode('utf-8').rstrip()
|
||||
except OSError as e:
|
||||
- msg = "Failed to get pg_config --bindir: " + text_type(e)
|
||||
+ msg = "Failed to get pg_config --bindir: " + str(e)
|
||||
print(msg)
|
||||
self._fail(msg)
|
||||
initdb_path = self.pg_bin + '/initdb'
|
||||
@@ -76,7 +75,7 @@ class PostgresServer(TestServer):
|
||||
try:
|
||||
subprocess.check_call([initdb_path, str(self.workspace / 'db')])
|
||||
except OSError as e:
|
||||
- msg = "Failed to launch postgres: " + text_type(e)
|
||||
+ msg = "Failed to launch postgres: " + str(e)
|
||||
print(msg)
|
||||
self._fail(msg)
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 8 12:33:38 UTC 2022 - pgajdos@suse.com
|
||||
|
||||
- do not require six
|
||||
- use -p1 as quilt does not like higher
|
||||
- modified patches
|
||||
% pytest-plugins-pr186-fix-psycopg29.patch (refreshed)
|
||||
% remove-mock.patch (refreshed)
|
||||
- added patches
|
||||
fix https://github.com/man-group/pytest-plugins/issues/209
|
||||
+ python-pytest-server-fixtures-no-six.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 21 20:21:33 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ Source: https://files.pythonhosted.org/packages/source/p/pytest-server-f
|
||||
Patch0: https://github.com/man-group/pytest-plugins/pull/186.patch#/pytest-plugins-pr186-fix-psycopg29.patch
|
||||
# PATCH-FEATURE-UPSTREAM remove-mock.patch -- gh#man-group#pytest-plugins#171
|
||||
Patch1: remove-mock.patch
|
||||
# https://github.com/man-group/pytest-plugins/issues/209
|
||||
Patch2: python-pytest-server-fixtures-no-six.patch
|
||||
BuildRequires: %{python_module setuptools-git}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
@@ -45,7 +47,6 @@ Requires: python-pytest-fixture-config
|
||||
Requires: python-pytest-shutil
|
||||
Requires: python-requests
|
||||
Requires: python-retry
|
||||
Requires: python-six
|
||||
Suggests: apache2
|
||||
Suggests: postgresql-server-devel
|
||||
Suggests: python-boto3
|
||||
@@ -77,7 +78,6 @@ BuildRequires: %{python_module redis}
|
||||
BuildRequires: %{python_module requests}
|
||||
BuildRequires: %{python_module rethinkdb}
|
||||
BuildRequires: %{python_module retry}
|
||||
BuildRequires: %{python_module six}
|
||||
%if %{with python2}
|
||||
BuildRequires: python2-mock
|
||||
%endif
|
||||
@@ -96,7 +96,7 @@ BuildRequires: xorg-x11-server
|
||||
Extensible server fixtures for pytest
|
||||
|
||||
%prep
|
||||
%autosetup -p2 -n pytest-server-fixtures-%{version}
|
||||
%autosetup -p1 -n pytest-server-fixtures-%{version}
|
||||
|
||||
# Tests requiring a server
|
||||
rm tests/integration/test_mongo_server.py
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Index: a/pytest-server-fixtures-1.7.0/tests/integration/test_xvfb_server.py
|
||||
Index: a/tests/integration/test_xvfb_server.py
|
||||
===================================================================
|
||||
--- a/pytest-server-fixtures-1.7.0/tests/integration/test_xvfb_server.py
|
||||
+++ b/pytest-server-fixtures-1.7.0/tests/integration/test_xvfb_server.py
|
||||
--- a/tests/integration/test_xvfb_server.py
|
||||
+++ b/tests/integration/test_xvfb_server.py
|
||||
@@ -4,7 +4,11 @@ import time
|
||||
|
||||
from itertools import chain, repeat
|
||||
@@ -15,10 +15,10 @@ Index: a/pytest-server-fixtures-1.7.0/tests/integration/test_xvfb_server.py
|
||||
import pytest
|
||||
from pytest import raises
|
||||
|
||||
Index: a/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_docker_unit.py
|
||||
Index: a/tests/unit/serverclass/test_docker_unit.py
|
||||
===================================================================
|
||||
--- a/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_docker_unit.py
|
||||
+++ b/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_docker_unit.py
|
||||
--- a/tests/unit/serverclass/test_docker_unit.py
|
||||
+++ b/tests/unit/serverclass/test_docker_unit.py
|
||||
@@ -1,4 +1,8 @@
|
||||
-from mock import sentinel, patch, Mock
|
||||
+try:
|
||||
@@ -29,10 +29,10 @@ Index: a/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_docker_unit.py
|
||||
|
||||
from pytest_server_fixtures.serverclass.docker import DockerServer
|
||||
|
||||
Index: a/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_thread_unit.py
|
||||
Index: a/tests/unit/serverclass/test_thread_unit.py
|
||||
===================================================================
|
||||
--- a/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_thread_unit.py
|
||||
+++ b/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_thread_unit.py
|
||||
--- a/tests/unit/serverclass/test_thread_unit.py
|
||||
+++ b/tests/unit/serverclass/test_thread_unit.py
|
||||
@@ -1,4 +1,8 @@
|
||||
-from mock import sentinel, patch, Mock
|
||||
+try:
|
||||
@@ -43,10 +43,10 @@ Index: a/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_thread_unit.py
|
||||
|
||||
from pytest_server_fixtures import CONFIG
|
||||
from pytest_server_fixtures.serverclass.thread import ThreadServer
|
||||
Index: a/pytest-server-fixtures-1.7.0/tests/unit/test_server_unit.py
|
||||
Index: a/tests/unit/test_server_unit.py
|
||||
===================================================================
|
||||
--- a/pytest-server-fixtures-1.7.0/tests/unit/test_server_unit.py
|
||||
+++ b/pytest-server-fixtures-1.7.0/tests/unit/test_server_unit.py
|
||||
--- a/tests/unit/test_server_unit.py
|
||||
+++ b/tests/unit/test_server_unit.py
|
||||
@@ -1,4 +1,8 @@
|
||||
-from mock import create_autospec, sentinel, call, patch, Mock
|
||||
+try:
|
||||
@@ -57,10 +57,10 @@ Index: a/pytest-server-fixtures-1.7.0/tests/unit/test_server_unit.py
|
||||
|
||||
from pytest_server_fixtures.base import TestServer as _TestServer # So that pytest doesnt think this is a test case
|
||||
|
||||
Index: pytest-server-fixtures-1.7.0/tests/unit/test_server_v2_unit.py
|
||||
Index: tests/unit/test_server_v2_unit.py
|
||||
===================================================================
|
||||
--- a/pytest-server-fixtures-1.7.0/tests/unit/test_server_v2_unit.py
|
||||
+++ b/pytest-server-fixtures-1.7.0/tests/unit/test_server_v2_unit.py
|
||||
--- a/tests/unit/test_server_v2_unit.py
|
||||
+++ b/tests/unit/test_server_v2_unit.py
|
||||
@@ -1,4 +1,8 @@
|
||||
-from mock import create_autospec, sentinel, call, patch, Mock
|
||||
+try:
|
||||
|
||||
Reference in New Issue
Block a user