Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pytest-server-fixtures for 
openSUSE:Factory checked in at 2021-10-19 23:04:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-server-fixtures (Old)
 and      /work/SRC/openSUSE:Factory/.python-pytest-server-fixtures.new.1890 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pytest-server-fixtures"

Tue Oct 19 23:04:05 2021 rev:5 rq:926333 version:1.7.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-pytest-server-fixtures/python-pytest-server-fixtures.changes
      2021-05-02 18:39:07.880176886 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-pytest-server-fixtures.new.1890/python-pytest-server-fixtures.changes
    2021-10-19 23:04:37.201294544 +0200
@@ -1,0 +2,7 @@
+Sun Oct 17 17:03:09 UTC 2021 - Ben Greiner <c...@bnavigator.de>
+
+- Fix compatibikity with with Psycopg 2.9
+  * pytest-plugins-pr186-fix-psycopg29.patch
+  * gh#man-group/pytest-plugins#186
+
+-------------------------------------------------------------------

New:
----
  pytest-plugins-pr186-fix-psycopg29.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pytest-server-fixtures.spec ++++++
--- /var/tmp/diff_new_pack.8ruEkW/_old  2021-10-19 23:04:37.693294768 +0200
+++ /var/tmp/diff_new_pack.8ruEkW/_new  2021-10-19 23:04:37.693294768 +0200
@@ -23,8 +23,10 @@
 Summary:        Extensible server fixures for py.test
 License:        MIT
 Group:          Development/Languages/Python
-URL:            https://github.com/manahl/pytest-plugins
+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
 BuildRequires:  %{python_module setuptools-git}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
@@ -89,7 +91,7 @@
 Extensible server fixures for py.test.
 
 %prep
-%setup -q -n pytest-server-fixtures-%{version}
+%autosetup -p2 -n pytest-server-fixtures-%{version}
 
 # Tests requiring a server
 rm tests/integration/test_mongo_server.py

++++++ pytest-plugins-pr186-fix-psycopg29.patch ++++++
>From 291995b3cfe60a5b30d5c6e1f3279ea40d35c7bb Mon Sep 17 00:00:00 2001
From: Ben Greiner <c...@bnavigator.de>
Date: Sun, 17 Oct 2021 18:57:06 +0200
Subject: [PATCH] Don't use context manager for CREATE DATABASE

Psycopg 2.9 uses transaction blocks withing context managers,
which is not allowed for CREATE DATABASE
https://github.com/psycopg/psycopg2/issues/941
---
 .../pytest_server_fixtures/postgres.py               | 12 ++++++++----
 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
@@ -103,18 +103,22 @@ def run_cmd(self):
 
     def check_server_up(self):
         from psycopg2 import OperationalError
+        conn = None
         try:
             print("Connecting to Postgres at localhost:{}".format(self.port))
-            with self.connect('postgres') as conn:
-                conn.set_session(autocommit=True)
-                with conn.cursor() as cursor:
-                    cursor.execute("CREATE DATABASE " + self.database_name)
+            conn = self.connect('postgres')
+            conn.set_session(autocommit=True)
+            with conn.cursor() as cursor:
+                cursor.execute("CREATE DATABASE " + self.database_name)
             self.connection = self.connect(self.database_name)
             with open(self.workspace / 'db' / 'postmaster.pid', 'r') as f:
                 self.pid = int(f.readline().rstrip())
             return True
         except OperationalError as e:
             print("Could not connect to test postgres: {}".format(e))
+        finally:
+            if conn:
+                conn.close()
         return False
 
     def connect(self, database=None):

Reply via email to