MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / test_issue_16

Method test_issue_16

pymysql/tests/test_issues.py:128–145  ·  view source on GitHub ↗

Patch for string and tuple escaping

(self)

Source from the content-addressed store, hash-verified

126 c.execute("drop table issue15")
127
128 def test_issue_16(self):
129 """Patch for string and tuple escaping"""
130 conn = self.connect()
131 c = conn.cursor()
132 with warnings.catch_warnings():
133 warnings.filterwarnings("ignore")
134 c.execute("drop table if exists issue16")
135 c.execute(
136 "create table issue16 (name varchar(32) primary key, email varchar(32))"
137 )
138 try:
139 c.execute(
140 "insert into issue16 (name, email) values ('pete', 'floydophone')"
141 )
142 c.execute("select email from issue16 where name=%s", ("pete",))
143 self.assertEqual("floydophone", c.fetchone()[0])
144 finally:
145 c.execute("drop table issue16")
146
147 @pytest.mark.skip(
148 "test_issue_17() requires a custom, legacy MySQL configuration and will not be run."

Callers

nothing calls this directly

Calls 4

cursorMethod · 0.80
executeMethod · 0.80
connectMethod · 0.45
fetchoneMethod · 0.45

Tested by

no test coverage detected