File tree 4 files changed +10
-10
lines changed 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ The following examples make use of a simple table
93
93
`email` varchar(255) COLLATE utf8_bin NOT NULL,
94
94
`password` varchar(255) COLLATE utf8_bin NOT NULL,
95
95
PRIMARY KEY (`id`)
96
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_bin
96
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
97
97
AUTO_INCREMENT=1 ;
98
98
99
99
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ and edit the new file to match your MySQL configuration::
30
30
31
31
To run all the tests, execute the script ``runtests.py ``::
32
32
33
- $ python runtests.py
33
+ $ pip install pytest
34
+ $ pytest -v pymysql
34
35
35
36
A ``tox.ini `` file is also provided for conveniently running tests on multiple
36
37
Python versions::
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ The following examples make use of a simple table
18
18
`email` varchar(255) COLLATE utf8_bin NOT NULL,
19
19
`password` varchar(255) COLLATE utf8_bin NOT NULL,
20
20
PRIMARY KEY (`id`)
21
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
21
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
22
22
AUTO_INCREMENT=1 ;
23
23
24
24
@@ -34,7 +34,7 @@ The following examples make use of a simple table
34
34
charset = ' utf8mb4' ,
35
35
cursorclass = pymysql.cursors.DictCursor)
36
36
37
- try :
37
+ with connection :
38
38
with connection.cursor() as cursor:
39
39
# Create a new record
40
40
sql = " INSERT INTO `users` (`email`, `password`) VALUES (%s , %s )"
@@ -50,8 +50,7 @@ The following examples make use of a simple table
50
50
cursor.execute(sql, (' webmaster@python.org' ,))
51
51
result = cursor.fetchone()
52
52
print (result)
53
- finally :
54
- connection.close()
53
+
55
54
56
55
This example will print:
57
56
Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ Requirements
18
18
19
19
* Python -- one of the following:
20
20
21
- - CPython _ >= 2.7 or >= 3.5
22
- - Latest PyPy _
21
+ - CPython _ >= 3.6
22
+ - Latest PyPy _ 3
23
23
24
24
* MySQL Server -- one of the following:
25
25
26
- - MySQL _ >= 5.5
27
- - MariaDB _ >= 5.5
26
+ - MySQL _ >= 5.6
27
+ - MariaDB _ >= 10.0
28
28
29
29
.. _CPython : http://www.python.org/
30
30
.. _PyPy : http://pypy.org/
You can’t perform that action at this time.
0 commit comments