Hello community,

here is the log from the commit of package python-treq for openSUSE:Factory 
checked in at 2019-03-10 09:34:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-treq (Old)
 and      /work/SRC/openSUSE:Factory/.python-treq.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-treq"

Sun Mar 10 09:34:28 2019 rev:2 rq:682433 version:18.6.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-treq/python-treq.changes  2018-11-10 
16:55:11.084061495 +0100
+++ /work/SRC/openSUSE:Factory/.python-treq.new.28833/python-treq.changes       
2019-03-10 09:34:34.152187824 +0100
@@ -1,0 +2,7 @@
+Thu Mar  7 11:33:03 UTC 2019 - Tomáš Chvátal <tchva...@suse.com>
+
+- Add patch to fix testrun on python3.7:
+  * python37.patch
+- Fix macro expansion to run the tests under python3
+
+-------------------------------------------------------------------

New:
----
  python37.patch

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

Other differences:
------------------
++++++ python-treq.spec ++++++
--- /var/tmp/diff_new_pack.ZthQlW/_old  2019-03-10 09:34:36.004187381 +0100
+++ /var/tmp/diff_new_pack.ZthQlW/_new  2019-03-10 09:34:36.008187380 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-treq
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,7 @@
 Group:          Development/Languages/Python
 URL:            https://github.com/twisted/treq
 Source:         
https://files.pythonhosted.org/packages/source/t/treq/treq-%{version}.tar.gz
+Patch0:         python37.patch
 BuildRequires:  %{python_module Twisted >= 16.4.0}
 BuildRequires:  %{python_module attrs}
 BuildRequires:  %{python_module httpbin}
@@ -49,6 +50,7 @@
 
 %prep
 %setup -q -n treq-%{version}
+%patch0 -p1
 
 %build
 %python_build
@@ -59,7 +61,7 @@
 
 %check
 export PYTHONDONTWRITEBYTECODE=1
-%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} 
%{_bindir}/trial-%{python_bin_suffix} treq
+%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} 
%{_bindir}/trial-%{$python_bin_suffix} treq
 
 %files %{python_files}
 %license LICENSE

++++++ python37.patch ++++++
>From d7e141113d00541c9183b243d0a2f66ded2f0536 Mon Sep 17 00:00:00 2001
From: Chih-Hsuan Yen <yan12...@gmail.com>
Date: Wed, 25 Jul 2018 20:53:50 +0800
Subject: [PATCH] Add Python 3.7 support and enable testing

---
 src/treq/test/test_multipart.py | 17 ++++++++++++++---
 4 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/src/treq/test/test_multipart.py b/src/treq/test/test_multipart.py
index 4aece22..e0d81a2 100644
--- a/src/treq/test/test_multipart.py
+++ b/src/treq/test/test_multipart.py
@@ -3,6 +3,7 @@
 # See LICENSE for details.
 
 import cgi
+import sys
 
 from io import BytesIO
 
@@ -594,9 +595,19 @@ def test_worksWithCgi(self):
             )
         )
 
-        form = cgi.parse_multipart(BytesIO(output), {"boundary": b"heyDavid"})
-        self.assertEqual(set([b'just a string\r\n', b'another string']),
-                         set(form['cfield']))
+        form = cgi.parse_multipart(BytesIO(output), {
+            "boundary": b"heyDavid",
+            "CONTENT-LENGTH": str(len(output)),
+        })
+
+        # Since Python 3.7, the value for a non-file field is now a list
+        # of strings, not bytes.
+        if sys.version_info >= (3, 7):
+            self.assertEqual(set(['just a string\r\n', 'another string']),
+                             set(form['cfield']))
+        else:
+            self.assertEqual(set([b'just a string\r\n', b'another string']),
+                             set(form['cfield']))
 
         self.assertEqual(set([b'my lovely bytes2']), set(form['efield']))
         self.assertEqual(set([b'my lovely bytes219']), set(form['xfield']))

Reply via email to