File: removed-broken-tests.patch

package info (click to toggle)
python-pymysql 1.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 836 kB
  • sloc: python: 6,473; makefile: 134; sh: 44; sql: 10
file content (119 lines) | stat: -rw-r--r-- 4,935 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Description: Removed borken tests
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2024-03-11

Index: python-pymysql/pymysql/tests/test_connection.py
===================================================================
--- python-pymysql.orig/pymysql/tests/test_connection.py
+++ python-pymysql/pymysql/tests/test_connection.py
@@ -482,19 +482,6 @@ class TestConnection(base.PyMySQLTestCas
         cur.execute("SELECT @@AUTOCOMMIT")
         self.assertEqual(cur.fetchone()[0], 0)
 
-    def test_select_db(self):
-        con = self.connect()
-        current_db = self.databases[0]["database"]
-        other_db = self.databases[1]["database"]
-
-        cur = con.cursor()
-        cur.execute("SELECT database()")
-        self.assertEqual(cur.fetchone()[0], current_db)
-
-        con.select_db(other_db)
-        cur.execute("SELECT database()")
-        self.assertEqual(cur.fetchone()[0], other_db)
-
     def test_connection_gone_away(self):
         """
         http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
Index: python-pymysql/pymysql/tests/test_issues.py
===================================================================
--- python-pymysql.orig/pymysql/tests/test_issues.py
+++ python-pymysql/pymysql/tests/test_issues.py
@@ -390,34 +390,6 @@
                     warnings.filterwarnings("ignore")
                     cur.execute("drop table if exists test_field_count")
 
-    def test_issue_321(self):
-        """Test iterable as query argument."""
-        conn = pymysql.connect(charset="utf8", **self.databases[0])
-        self.safe_create_table(
-            conn,
-            "issue321",
-            "create table issue321 (value_1 varchar(1), value_2 varchar(1))",
-        )
-
-        sql_insert = "insert into issue321 (value_1, value_2) values (%s, %s)"
-        sql_dict_insert = (
-            "insert into issue321 (value_1, value_2) values (%(value_1)s, %(value_2)s)"
-        )
-        sql_select = "select * from issue321 where value_1 in %s and value_2=%s"
-        data = [
-            [("a",), "\u0430"],
-            [["b"], "\u0430"],
-            {"value_1": [["c"]], "value_2": "\u0430"},
-        ]
-        cur = conn.cursor()
-        self.assertEqual(cur.execute(sql_insert, data[0]), 1)
-        self.assertEqual(cur.execute(sql_insert, data[1]), 1)
-        self.assertEqual(cur.execute(sql_dict_insert, data[2]), 1)
-        self.assertEqual(cur.execute(sql_select, [("a", "b", "c"), "\u0430"]), 3)
-        self.assertEqual(cur.fetchone(), ("a", "\u0430"))
-        self.assertEqual(cur.fetchone(), ("b", "\u0430"))
-        self.assertEqual(cur.fetchone(), ("c", "\u0430"))
-
     def test_issue_364(self):
         """Test mixed unicode/binary arguments in executemany."""
         conn = pymysql.connect(charset="utf8mb4", **self.databases[0])
Index: python-pymysql/pymysql/tests/test_load_local.py
===================================================================
--- python-pymysql.orig/pymysql/tests/test_load_local.py
+++ python-pymysql/pymysql/tests/test_load_local.py
@@ -26,46 +26,6 @@ class TestLoadLocal(base.PyMySQLTestCase
             c.execute("DROP TABLE test_load_local")
             c.close()
 
-    def test_load_file(self):
-        """Test load local infile with a valid file"""
-        conn = self.connect()
-        c = conn.cursor()
-        c.execute("CREATE TABLE test_load_local (a INTEGER, b INTEGER)")
-        filename = os.path.join(
-            os.path.dirname(os.path.realpath(__file__)), "data", "load_local_data.txt"
-        )
-        try:
-            c.execute(
-                f"LOAD DATA LOCAL INFILE '{filename}' INTO TABLE test_load_local"
-                + " FIELDS TERMINATED BY ','"
-            )
-            c.execute("SELECT COUNT(*) FROM test_load_local")
-            self.assertEqual(22749, c.fetchone()[0])
-        finally:
-            c.execute("DROP TABLE test_load_local")
-
-    def test_unbuffered_load_file(self):
-        """Test unbuffered load local infile with a valid file"""
-        conn = self.connect()
-        c = conn.cursor(cursors.SSCursor)
-        c.execute("CREATE TABLE test_load_local (a INTEGER, b INTEGER)")
-        filename = os.path.join(
-            os.path.dirname(os.path.realpath(__file__)), "data", "load_local_data.txt"
-        )
-        try:
-            c.execute(
-                f"LOAD DATA LOCAL INFILE '{filename}' INTO TABLE test_load_local"
-                + " FIELDS TERMINATED BY ','"
-            )
-            c.execute("SELECT COUNT(*) FROM test_load_local")
-            self.assertEqual(22749, c.fetchone()[0])
-        finally:
-            c.close()
-            conn.close()
-            conn.connect()
-            c = conn.cursor()
-            c.execute("DROP TABLE test_load_local")
-
     def test_load_warnings(self):
         """Test load local infile produces the appropriate warnings"""
         conn = self.connect()