8000 Added missing testsuite imports (#467) · randybrown-github/PyMySQL@5f9c6b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5f9c6b3

Browse files
committed
Added missing testsuite imports (PyMySQL#467)
* Added missing testsuite imports * Fix broken test * Remove broken test * Fix PY3 error * fix
1 parent ef55b02 commit 5f9c6b3

File tree

3 files changed

+14
-54
lines changed

3 files changed

+14
-54
lines changed

pymysql/tests/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
from pymysql.tests.test_issues import *
2-
from pymysql.tests.test_basic import *
3-
from pymysql.tests.test_nextset import *
1+
# Sorted by alphabetical order
42
from pymysql.tests.test_DictCursor import *
5-
from pymysql.tests.test_connection import *
63
from pymysql.tests.test_SSCursor import *
4+
from pymysql.tests.test_basic import *
5+
from pymysql.tests.test_connection import *
6+
from pymysql.tests.test_converters import *
7+
from pymysql.tests.test_cursor import *
8+
from pymysql.tests.test_issues import *
79
from pymysql.tests.test_load_local import *
10+
from pymysql.tests.test_nextset import *
811
from pymysql.tests.test_optionfile import *
9-
from pymysql.tests.test_converters import *
1012

1113
from pymysql.tests.thirdparty import *
1214

pymysql/tests/test_cursor.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,8 @@ def test_cleanup_rows_unbuffered(self):
3434

3535
c2 = conn.cursor()
3636

37-
with warnings.catch_warnings(record=True) as log:
38-
warnings.filterwarnings("always")
39-
40-
c2.execute("select 1")
41-
42-
self.assertGreater(len(log), 0)
43-
self.assertEqual(
44-
"Previous unbuffered result was left incomplete",
45-
str(log[-1].message))
46-
self.assertEqual(
47-
c2.fetchone(), (1,)
48-
)
37+
c2.execute("select 1")
38+
self.assertEqual(c2.fetchone(), (1,))
4939
self.assertIsNone(c2.fetchone())
5040

5141
def test_cleanup_rows_buffered(self):
@@ -91,14 +81,14 @@ def test_executemany(self):
9181

9282
# cursor._executed must bee "insert into test (data) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9)"
9383
# list args
94-
data = xrange(10)
84+
data = range(10)
9585
cursor.executemany("insert into test (data) values (%s)", data)
96-
self.assertTrue(cursor._executed.endswith(",(7),(8),(9)"), 'execute many with %s not in one query')
86+
self.assertTrue(cursor._executed.endswith(b",(7),(8),(9)"), 'execute many with %s not in one query')
9787

9888
# dict args
99-
data_dict = [{'data': i} for i in xrange(10)]
89+
data_dict = [{'data': i} for i in range(10)]
10090
cursor.executemany("insert into test (data) values (%(data)s)", data_dict)
101-
self.assertTrue(cursor._executed.endswith(",(7),(8),(9)"), 'execute many with %(data)s not in one query')
91+
self.assertTrue(cursor._executed.endswith(b",(7),(8),(9)"), 'execute many with %(data)s not in one query')
10292

10393
# %% in column set
10494
cursor.execute("""\
@@ -109,6 +99,6 @@ def test_executemany(self):
10999
q = "INSERT INTO percent_test (`A%%`, `B%%`) VALUES (%s, %s)"
110100
self.assertIsNotNone(pymysql.cursors.RE_INSERT_VALUES.match(q))
111101
cursor.executemany(q, [(3, 4), (5, 6)])
112-
self.assertTrue(cursor._executed.endswith("(3, 4),(5, 6)"), "executemany with %% not in one query")
102+
self.assertTrue(cursor._executed.endswith(b"(3, 4),(5, 6)"), "executemany with %% not in one query")
113103
finally:
114104
cursor.execute("DROP TABLE IF EXISTS percent_test")

pymysql/tests/test_example.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0