Skip to content

Commit

Permalink
Update python-pytest-server-fixtures to version 1.7.0 / rev 8 via SR …
Browse files Browse the repository at this point in the history
…1041859

https://build.opensuse.org/request/show/1041859
by user dgarcia + dimstar_suse
- Remove remote path for pytest-plugins-pr186-fix-psycopg29.patch to avoid
  download that patch from github
- Update source pytest-plugins-pr186-fix-psycopg29.patch
- 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 man-group/pytest-plugins#209
  + python-pytest-server-fixtures-no-six.patch
  • Loading branch information
dgarcia authored and bmwiedemann committed Dec 10, 2022
1 parent 3491d44 commit 9e6e4a3
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 23 deletions.
Binary file modified packages/p/python-pytest-server-fixtures/.files
Binary file not shown.
19 changes: 19 additions & 0 deletions packages/p/python-pytest-server-fixtures/.rev
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,23 @@
<comment></comment>
<requestid>971975</requestid>
</revision>
<revision rev="8" vrev="8">
<srcmd5>a803c7fbd2fba99e7137141e1d9e2cae</srcmd5>
<version>1.7.0</version>
<time>1670703478</time>
<user>dimstar_suse</user>
<comment>- Remove remote path for pytest-plugins-pr186-fix-psycopg29.patch to avoid
download that patch from github
- Update source pytest-plugins-pr186-fix-psycopg29.patch
- 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
</comment>
<requestid>1041859</requestid>
</revision>
</revisionlist>
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ https://github.com/psycopg/psycopg2/issues/941
1 file changed, 8 insertions(+), 4 deletions(-)

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
index 7c6ea33d..aeab36ad 100644
--- 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):
Expand Down
Original file line number Diff line number Diff line change
@@ -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)

Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
-------------------------------------------------------------------
Fri Dec 9 12:03:36 UTC 2022 - Daniel Garcia <[email protected]>

- Remove remote path for pytest-plugins-pr186-fix-psycopg29.patch to avoid
download that patch from github

-------------------------------------------------------------------
Fri Dec 9 11:57:05 UTC 2022 - Daniel Garcia <[email protected]>

- Update source pytest-plugins-pr186-fix-psycopg29.patch

-------------------------------------------------------------------
Thu Dec 8 12:33:38 UTC 2022 - [email protected]

- 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 <[email protected]>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
Name: python-pytest-server-fixtures
Version: 1.7.0
Expand All @@ -27,9 +26,11 @@ Group: Development/Languages/Python
URL: https://github.com/man-group/pytest-plugins
Source: https://files.pythonhosted.org/packages/source/p/pytest-server-fixtures/pytest-server-fixtures-%{version}.tar.gz
# PATCH-FIX-UPSTREAM pytest-plugins-pr186-fix-psycopg29.patch -- gh#man-group/pytest-plugins#186
Patch0: https://github.com/man-group/pytest-plugins/pull/186.patch#/pytest-plugins-pr186-fix-psycopg29.patch
Patch0: 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
Expand All @@ -45,7 +46,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
Expand Down Expand Up @@ -77,7 +77,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
Expand All @@ -96,7 +95,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
Expand Down
30 changes: 15 additions & 15 deletions packages/p/python-pytest-server-fixtures/remove-mock.patch
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 9e6e4a3

Please sign in to comment.