Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nakagami committed Feb 4, 2024
1 parent 70789fa commit 6fc4dfa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions test_db2.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_error(self):
cur.execute("invalid query"),

@unittest.skip
def test_issue_18(self):
def test_issue18(self):
cur = self.connection.cursor()
try:
cur.execute("DROP TABLE test_issue18")
Expand All @@ -158,7 +158,10 @@ def test_issue_18(self):
for _ in range(count):
cur.execute("INSERT INTO test_issue18(s) values(?)", [s])
cur.execute("SELECT * FROM test_issue18")
self.assertEqual(cur.fetchall(), [s] * count)
self.assertEqual(
list(cur.fetchall()),
[(s,) for _ in range(count)],
)


class TestDataType(unittest.TestCase):
Expand Down
9 changes: 6 additions & 3 deletions test_derby.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def test_double(self):
self.assertEqual(cur.fetchall(), [(-1, -1, -1.0, -1.0)])

@unittest.skip
def test_issue_18(self):
def test_issue18(self):
cur = self.connection.cursor()
try:
cur.execute("DROP TABLE test_issue18")
Expand All @@ -281,12 +281,15 @@ def test_issue_18(self):
s varchar(4096)
)
""")
s = "x" * 4096
count = 20
for _ in range(count):
s = "x" * 4096
cur.execute(f"INSERT INTO test_issue18(s) values('{s}')")
cur.execute("SELECT * FROM test_issue18")
self.assertEqual(cur.fetchall(), [s] * count)
self.assertEqual(
list(cur.fetchall()),
[(s,) for _ in range(count)],
)

def tearDown(self):
self.connection.close()
Expand Down

0 comments on commit 6fc4dfa

Please sign in to comment.