MCPcopy Index your code
hub / github.com/PyMySQL/PyMySQL / setUp

Method setUp

pymysql/tests/test_cursor.py:34–50  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

32
33class CursorTest(base.PyMySQLTestCase):
34 def setUp(self):
35 super().setUp()
36
37 conn = self.connect()
38 self.safe_create_table(
39 conn,
40 "test",
41 "create table test (data varchar(10))",
42 )
43 cursor = conn.cursor()
44 cursor.execute(
45 "insert into test (data) values ('row1'), ('row2'), ('row3'), ('row4'), ('row5')"
46 )
47 conn.commit()
48 cursor.close()
49 self.test_connection = pymysql.connect(**self.databases[0])
50 self.addCleanup(self.test_connection.close)
51
52 def test_cursor_is_iterator(self):
53 """Test that the cursor is an iterator"""

Callers

nothing calls this directly

Calls 6

safe_create_tableMethod · 0.80
cursorMethod · 0.80
executeMethod · 0.80
commitMethod · 0.80
connectMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected