Package: python-pymysql
Version: 0.6.2-1
Followup-For: Bug #796010
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu wily ubuntu-patch

Dear Maintainer,

In Ubuntu, the attached patch was applied to achieve the following:

  * d/p/test-issue-36.patch: Added to fix failing test, test_issue_36().
  * d/p/test-datatypes.patch: Added to fix failing test, test_datatypes.

Thanks for considering the patch.


-- System Information:
Debian Release: jessie/sid
  APT prefers vivid-updates
  APT policy: (500, 'vivid-updates'), (500, 'vivid-security'), (500, 'vivid'), 
(100, 'vivid-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.19.0-26-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
=== removed file '.pc/applied-patches'
=== modified file 'debian/changelog'

=== added directory 'debian/patches'
=== added file 'debian/patches/series'
--- debian/patches/series	1970-01-01 00:00:00 +0000
+++ debian/patches/series	2015-08-24 20:56:08 +0000
@@ -0,0 +1,2 @@
+test-datatypes.patch
+test-issue-36.patch

=== added file 'debian/patches/test-datatypes.patch'
--- debian/patches/test-datatypes.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/test-datatypes.patch	2015-08-24 20:58:36 +0000
@@ -0,0 +1,27 @@
+Description: Partial cherry-pick from upstream commit f43aeeaf
+             to fix failing test, test_datatypes().
+Author: Corey Bryant <corey.bry...@canonical.com>
+Forwarded: not-needed
+
+--- a/pymysql/tests/test_basic.py
++++ b/pymysql/tests/test_basic.py
+@@ -18,16 +18,13 @@
+         c.execute("create table test_datatypes (b bit, i int, l bigint, f real, s varchar(32), u varchar(32), bb blob, d date, dt datetime, ts timestamp, td time, t time, st datetime)")
+         try:
+             # insert values
+-            v = (True, -3, 123456789012, 5.7, "hello'\" world", u"Espa\xc3\xb1ol", "binary\x00data".encode(conn.charset), datetime.date(1988,2,2), datetime.datetime.now(), datetime.timedelta(5,6), datetime.time(16,32), time.localtime())
++
++            v = (True, -3, 123456789012, 5.7, "hello'\" world", u"Espa\xc3\xb1ol", "binary\x00data".encode(conn.charset), datetime.date(1988,2,2), datetime.datetime(2014, 5, 15, 7, 45, 57), datetime.timedelta(5,6), datetime.time(16,32), time.localtime())
+             c.execute("insert into test_datatypes (b,i,l,f,s,u,bb,d,dt,td,t,st) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)", v)
+             c.execute("select b,i,l,f,s,u,bb,d,dt,td,t,st from test_datatypes")
+             r = c.fetchone()
+             self.assertEqual(util.int2byte(1), r[0])
+-            self.assertEqual(v[1:8], r[1:8])
+-            # mysql throws away microseconds so we need to check datetimes
+-            # specially. additionally times are turned into timedeltas.
+-            self.assertEqual(datetime.datetime(*v[8].timetuple()[:6]), r[8])
+-            self.assertEqual(v[9], r[9]) # just timedeltas
++            self.assertEqual(v[1:10], r[1:10])
+             self.assertEqual(datetime.timedelta(0, 60 * (v[10].hour * 60 + v[10].minute)), r[10])
+             self.assertEqual(datetime.datetime(*v[-1][:6]), r[-1])
+ 

=== added file 'debian/patches/test-issue-36.patch'
--- debian/patches/test-issue-36.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/test-issue-36.patch	2015-08-24 20:57:30 +0000
@@ -0,0 +1,16 @@
+Description: Partial cherry-pick from upstream commit eb172754
+             to fix failing test, test_issue_36().
+Author: Corey Bryant <corey.bry...@canonical.com>
+Forwarded: not-needed
+
+--- a/pymysql/tests/test_issues.py
++++ b/pymysql/tests/test_issues.py
+@@ -197,7 +197,7 @@
+                 kill_id = id
+                 break
+         # now nuke the connection
+-        conn.kill(kill_id)
++        self.connections[1].kill(kill_id)
+         # make sure this connection has broken
+         try:
+             c.execute("show tables")

Reply via email to