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

Method test_datetime_microseconds

pymysql/tests/test_basic.py:190–202  ·  view source on GitHub ↗

test datetime conversion w microseconds

(self)

Source from the content-addressed store, hash-verified

188 )
189
190 def test_datetime_microseconds(self):
191 """test datetime conversion w microseconds"""
192
193 conn = self.connect()
194 c = conn.cursor()
195 dt = datetime.datetime(2013, 11, 12, 9, 9, 9, 123450)
196 c.execute("create table test_datetime (id int, ts datetime(6))")
197 try:
198 c.execute("insert into test_datetime values (%s, %s)", (1, dt))
199 c.execute("select ts from test_datetime")
200 self.assertEqual((dt,), c.fetchone())
201 finally:
202 c.execute("drop table test_datetime")
203
204
205class TestCursor(base.PyMySQLTestCase):

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