repo_id stringclasses 400
values | commit_sha stringclasses 400
values | commit_index int32 0 951 | in_repo_split stringclasses 1
value | cross_repo_split stringclasses 1
value | test_file stringlengths 7 121 | test_function stringlengths 1 108 | assertion_type stringclasses 32
values | difficulty stringclasses 8
values | context_lines int32 3 600 | prefix large_stringlengths 44 113k | target large_stringlengths 1 498 | anchor_sha stringclasses 400
values | anchor_index int32 0 951 | qna_source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_basic.py | test_datatypes | self.assertEqual | complex_expr | 47 | import datetime
import json
import time
import pytest
import pymysql.cursors
from pymysql.tests import base
from pymysql.err import ProgrammingError
__all__ = ["TestConversion", "TestCursor", "TestBulkInserts"]
class TestConversion(base.PyMySQLTestCase):
def test_datatypes(self):
""" test every data typ... | r[10]) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_basic.py | test_datatypes | self.assertEqual | complex_expr | 50 | import datetime
import json
import time
import pytest
import pymysql.cursors
from pymysql.tests import base
from pymysql.err import ProgrammingError
__all__ = ["TestConversion", "TestCursor", "TestBulkInserts"]
class TestConversion(base.PyMySQLTestCase):
def test_datatypes(self):
""" test every data typ... | r[-1]) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_basic.py | test_untyped | self.assertEqual | func_call | 21 | import datetime
import json
import time
import pytest
import pymysql.cursors
from pymysql.tests import base
from pymysql.err import ProgrammingError
__all__ = ["TestConversion", "TestCursor", "TestBulkInserts"]
class TestConversion(base.PyMySQLTestCase):
def test_untyped(self):
""" test conversion of n... | c.fetchone()) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_basic.py | _verify_records | self.assertEqual | func_call | 44 | import datetime
import json
import time
import pytest
import pymysql.cursors
from pymysql.tests import base
from pymysql.err import ProgrammingError
__all__ = ["TestConversion", "TestCursor", "TestBulkInserts"]
class TestBulkInserts(base.PyMySQLTestCase):
cursor_type = pymysql.cursors.DictCursor
def setUp... | sorted(result)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_basic.py | test_binary | self.assertEqual | func_call | 27 | import datetime
import json
import time
import pytest
import pymysql.cursors
from pymysql.tests import base
from pymysql.err import ProgrammingError
__all__ = ["TestConversion", "TestCursor", "TestBulkInserts"]
class TestConversion(base.PyMySQLTestCase):
def test_binary(self):
"""test binary data"""
... | c.fetchone()[0]) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_basic.py | test_single_tuple | self.assertEqual | func_call | 26 | import datetime
import json
import time
import pytest
import pymysql.cursors
from pymysql.tests import base
from pymysql.err import ProgrammingError
__all__ = ["TestConversion", "TestCursor", "TestBulkInserts"]
class TestCursor(base.PyMySQLTestCase):
def test_single_tuple(self):
""" test a single tuple... | list(c.fetchall())) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_basic.py | test_json | self.assertEqual | func_call | 39 | import datetime
import json
import time
import pytest
import pymysql.cursors
from pymysql.tests import base
from pymysql.err import ProgrammingError
__all__ = ["TestConversion", "TestCursor", "TestBulkInserts"]
class TestCursor(base.PyMySQLTestCase):
def test_json(self):
args = self.databases[0].copy()... | json.loads(json_str)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_largedata | assert | variable | 23 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestConnection(base.PyMySQLTestCase):
def test_largedata(self):
"""Large query and response (>=16MB)"""
cur = self.connect().cursor()... | t | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_autocommit | self.assertEqual | numeric_literal | 25 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestConnection(base.PyMySQLTestCase):
def test_autocommit(self):
con = self.connect()
self.assertFalse(con.get_autocommit())
... | 0) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_previous_cursor_not_closed | self.assertEqual | numeric_literal | 26 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
def escape_foo(x, d):
return x.value
class TestEscape(base.PyMySQLTestCase):
def test_previous_cursor_not_closed(self):
con = self.connect(
... | 3) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_escape_custom_object | self.assertEqual | string_literal | 22 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
def escape_foo(x, d):
return x.value
class TestEscape(base.PyMySQLTestCase):
def test_escape_custom_object(self):
con = self.connect()
... | "bar") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_defer_connect | self.assertFalse | complex_expr | 33 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestConnection(base.PyMySQLTestCase):
def test_defer_connect(self):
import socket
d = self.databases[0].copy()
try:
... | c.open) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_ssl_connect | assert_* | string_literal | 33 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestConnection(base.PyMySQLTestCase):
def test_ssl_connect(self):
dummy_ssl_context = mock.Mock(options=0)
with mock.patch(
... | "cert") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_escape_list_item | self.assertEqual | string_literal | 23 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
def escape_foo(x, d):
return x.value
class TestEscape(base.PyMySQLTestCase):
def test_escape_list_item(self):
con = self.connect()
cur... | "(bar)") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_select_db | self.assertEqual | variable | 25 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestConnection(base.PyMySQLTestCase):
def test_select_db(self):
con = self.connect()
current_db = self.databases[0]["db"]
oth... | other_db) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_read_default_group | self.assertTrue | complex_expr | 18 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestConnection(base.PyMySQLTestCase):
def test_read_default_group(self):
conn = self.connect(
read_default_group="client",
... | conn.open) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_escape_no_default | self.assertRaises | variable | 21 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
def escape_foo(x, d):
return x.value
class TestEscape(base.PyMySQLTestCase):
def test_escape_no_default(self):
con = self.connect()
cu... | TypeError) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | realTestPamAuth | self.assertEqual | complex_expr | 201 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestAuthentication(base.PyMySQLTestCase):
socket_auth = False
socket_found = False
two_questions_found = False
three_attempts_found = Fal... | e.args[0]) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_select_db | self.assertEqual | variable | 21 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestConnection(base.PyMySQLTestCase):
def test_select_db(self):
con = self.connect()
current_db = self.databases[0]["db"]
oth... | current_db) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_escape_fallback_encoder | self.assertEqual | string_literal | 25 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
def escape_foo(x, d):
return x.value
class TestEscape(base.PyMySQLTestCase):
def test_escape_fallback_encoder(self):
con = self.connect()
... | "'foobar'") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_connection.py | test_connection_gone_away | self.assertIn | collection | 27 | import datetime
import ssl
import sys
import time
import mock
import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestConnection(base.PyMySQLTestCase):
def test_connection_gone_away(self):
"""
http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
... | (2006, 2013)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_converters.py | test_convert_datetime | self.assertEqual | variable | 13 | import datetime
from unittest import TestCase
from pymysql import converters
__all__ = ["TestConverter"]
class TestConverter(TestCase):
def test_convert_datetime(self):
expected = datetime.datetime(2007, 2, 24, 23, 6, 20)
dt = converters.convert_datetime("2007-02-24 23:06:20")
self.asser... | expected) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_converters.py | test_escape_string | self.assertEqual | string_literal | 10 | import datetime
from unittest import TestCase
from pymysql import converters
__all__ = ["TestConverter"]
class TestConverter(TestCase):
def test_escape_string(self):
self.assertEqual(converters.escape_string("foo\nbar"), | "foo\\nbar") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_cursor.py | test_executemany | self.assertIsNotNone | variable | 33 | import warnings
from pymysql.tests import base
import pymysql.cursors
class CursorTest(base.PyMySQLTestCase):
def setUp(self):
super(CursorTest, self).setUp()
conn = self.connect()
self.safe_create_table(
conn,
"test",
"create table test (data varchar(1... | m) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_cursor.py | test_executemany | assert | none_literal | 62 | import warnings
from pymysql.tests import base
import pymysql.cursors
class CursorTest(base.PyMySQLTestCase):
def setUp(self):
super(CursorTest, self).setUp()
conn = self.connect()
self.safe_create_table(
conn,
"test",
"create table test (data varchar(1... | None | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_cursor.py | test_cleanup_rows_unbuffered | self.assertEqual | collection | 40 | import warnings
from pymysql.tests import base
import pymysql.cursors
class CursorTest(base.PyMySQLTestCase):
def setUp(self):
super(CursorTest, self).setUp()
conn = self.connect()
self.safe_create_table(
conn,
"test",
"create table test (data varchar(1... | (1,)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_cursor.py | test_cleanup_rows_unbuffered | self.assertIsNone | func_call | 41 | import warnings
from pymysql.tests import base
import pymysql.cursors
class CursorTest(base.PyMySQLTestCase):
def setUp(self):
super(CursorTest, self).setUp()
conn = self.connect()
self.safe_create_table(
conn,
"test",
"create table test (data varchar(1... | c2.fetchone()) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_err.py | test_raise_mysql_exception | self.assertRaises | complex_expr | 11 | import unittest
from pymysql import err
__all__ = ["TestRaiseException"]
class TestRaiseException(unittest.TestCase):
def test_raise_mysql_exception(self):
data = b"\xff\x15\x04#28000Access denied"
with self.assertRaises( | err.OperationalError) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_err.py | test_raise_mysql_exception | self.assertEqual | collection | 13 | import unittest
from pymysql import err
__all__ = ["TestRaiseException"]
class TestRaiseException(unittest.TestCase):
def test_raise_mysql_exception(self):
data = b"\xff\x15\x04#28000Access denied"
with self.assertRaises(err.OperationalError) as cm:
err.raise_mysql_exception(data)
... | (1045, "Access denied")) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_issues.py | test_issue_321 | self.assertEqual | numeric_literal | 38 | import datetime
import time
import warnings
import sys
import pytest
import pymysql
from pymysql import cursors
from pymysql.tests import base
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestGitHubIssues(base.PyMySQLTestCase):
def test_issue_321(self):
""" Test iterable as qu... | 1) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_issues.py | test_issue_321 | self.assertEqual | numeric_literal | 41 | import datetime
import time
import warnings
import sys
import pytest
import pymysql
from pymysql import cursors
from pymysql.tests import base
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestGitHubIssues(base.PyMySQLTestCase):
def test_issue_321(self):
""" Test iterable as qu... | 3) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_issues.py | test_issue_79 | self.assertEqual | numeric_literal | 38 | import datetime
import time
import warnings
import sys
import pytest
import pymysql
from pymysql import cursors
from pymysql.tests import base
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestGitHubIssues(base.PyMySQLTestCase):
def test_issue_79(self):
""" Duplicate field over... | 11) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_issues.py | test_issue_79 | self.assertEqual | numeric_literal | 39 | import datetime
import time
import warnings
import sys
import pytest
import pymysql
from pymysql import cursors
from pymysql.tests import base
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestGitHubIssues(base.PyMySQLTestCase):
def test_issue_79(self):
""" Duplicate field over... | 22) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_issues.py | test_issue_175 | assert | variable | 27 | import datetime
import time
import warnings
import sys
import pytest
import pymysql
from pymysql import cursors
from pymysql.tests import base
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestGitHubIssues(base.PyMySQLTestCase):
def test_issue_175(self):
""" The number of field... | length | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_issues.py | test_issue_34 | self.assertEqual | complex_expr | 21 | import datetime
import time
import warnings
import sys
import pytest
import pymysql
from pymysql import cursors
from pymysql.tests import base
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestNewIssues(base.PyMySQLTestCase):
def test_issue_34(self):
try:
pymysql.con... | e.args[0]) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_issues.py | test_issue_37 | self.assertEqual | func_call | 21 | import datetime
import time
import warnings
import sys
import pytest
import pymysql
from pymysql import cursors
from pymysql.tests import base
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestNewIssues(base.PyMySQLTestCase):
def test_issue_37(self):
conn = self.connect()
... | c.fetchone()) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_issues.py | test_issue_364 | self.assertEqual | func_call | 35 | import datetime
import time
import warnings
import sys
import pytest
import pymysql
from pymysql import cursors
from pymysql.tests import base
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestGitHubIssues(base.PyMySQLTestCase):
def test_issue_364(self):
""" Test mixed unicode/... | tuple(values)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_issues.py | test_issue_36 | self.assertFalse | complex_expr | 49 | import datetime
import time
import warnings
import sys
import pytest
import pymysql
from pymysql import cursors
from pymysql.tests import base
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestNewIssues(base.PyMySQLTestCase):
def test_issue_36(self):
# connection 0 is super use... | kill_id in ids) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_issues.py | test_issue_33 | self.assertEqual | func_call | 25 | import datetime
import time
import warnings
import sys
import pytest
import pymysql
from pymysql import cursors
from pymysql.tests import base
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestNewIssues(base.PyMySQLTestCase):
def test_issue_33(self):
conn = pymysql.connect(char... | c.fetchone()[0]) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_load_local.py | test_load_file | self.assertEqual | func_call | 24 | from pymysql import cursors, OperationalError, Warning
from pymysql.tests import base
import os
__all__ = ["TestLoadLocal"]
class TestLoadLocal(base.PyMySQLTestCase):
def test_load_file(self):
"""Test load local infile with a valid file"""
conn = self.connect()
c = conn.cursor()
... | c.fetchone()[0]) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_load_local.py | test_no_file | self.assertRaises | variable | 16 | from pymysql import cursors, OperationalError, Warning
from pymysql.tests import base
import os
__all__ = ["TestLoadLocal"]
class TestLoadLocal(base.PyMySQLTestCase):
def test_no_file(self):
"""Test load local infile when the file does not exist"""
conn = self.connect()
c = conn.cursor()
... | OperationalError) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_nextset.py | test_nextset | self.assertTrue | variable | 19 | import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestNextset(base.PyMySQLTestCase):
def test_nextset(self):
con = self.connect(
init_command='SELECT "bar"; SELECT "baz"',
client_flag=CLIENT.MULTI_STATEMENTS,
)
cu... | r) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_nextset.py | test_nextset | self.assertEqual | func_call | 16 | import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestNextset(base.PyMySQLTestCase):
def test_nextset(self):
con = self.connect(
init_command='SELECT "bar"; SELECT "baz"',
client_flag=CLIENT.MULTI_STATEMENTS,
)
cu... | list(cur)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_nextset.py | test_multi_cursor | self.assertEqual | func_call | 19 | import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestNextset(base.PyMySQLTestCase):
@pytest.mark.xfail
def test_multi_cursor(self):
con = self.connect(client_flag=CLIENT.MULTI_STATEMENTS)
cur1 = con.cursor()
cur2 = con.cursor()
... | list(cur1)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_nextset.py | test_multi_cursor | self.assertEqual | func_call | 20 | import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestNextset(base.PyMySQLTestCase):
@pytest.mark.xfail
def test_multi_cursor(self):
con = self.connect(client_flag=CLIENT.MULTI_STATEMENTS)
cur1 = con.cursor()
cur2 = con.cursor()
... | list(cur2)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_nextset.py | test_nextset | self.assertIsNone | func_call | 22 | import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestNextset(base.PyMySQLTestCase):
def test_nextset(self):
con = self.connect(
init_command='SELECT "bar"; SELECT "baz"',
client_flag=CLIENT.MULTI_STATEMENTS,
)
cu... | cur.nextset()) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_nextset.py | test_multi_cursor | self.assertIsNone | func_call | 26 | import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestNextset(base.PyMySQLTestCase):
@pytest.mark.xfail
def test_multi_cursor(self):
con = self.connect(client_flag=CLIENT.MULTI_STATEMENTS)
cur1 = con.cursor()
cur2 = con.cursor()
... | cur1.nextset()) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_nextset.py | test_nextset_error | self.assertEqual | func_call | 19 | import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestNextset(base.PyMySQLTestCase):
def test_nextset_error(self):
con = self.connect(client_flag=CLIENT.MULTI_STATEMENTS)
cur = con.cursor()
for i in range(3):
cur.execute("S... | cur.fetchall()) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_nextset.py | test_ok_and_next | self.assertFalse | func_call | 17 | import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestNextset(base.PyMySQLTestCase):
def test_ok_and_next(self):
cur = self.connect(client_flag=CLIENT.MULTI_STATEMENTS).cursor()
cur.execute("SELECT 1; commit; SELECT 2;")
self.assertEqua... | bool(cur.nextset())) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_nextset.py | test_nextset_error | self.assertRaises | complex_expr | 17 | import pytest
import pymysql
from pymysql.tests import base
from pymysql.constants import CLIENT
class TestNextset(base.PyMySQLTestCase):
def test_nextset_error(self):
con = self.connect(client_flag=CLIENT.MULTI_STATEMENTS)
cur = con.cursor()
for i in range(3):
cur.execute("S... | pymysql.ProgrammingError) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_optionfile.py | test_string | self.assertEqual | string_literal | 20 | from io import StringIO
from unittest import TestCase
from pymysql.optionfile import Parser
__all__ = ["TestParser"]
_cfg_file = r"""
[default]
string = foo
quoted = "bar"
single_quoted = 'foobar'
skip-slave-start
"""
class TestParser(TestCase):
def test_string(self):
parser = Parser()
parser.rea... | "foo") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_optionfile.py | test_string | self.assertEqual | string_literal | 21 | from io import StringIO
from unittest import TestCase
from pymysql.optionfile import Parser
__all__ = ["TestParser"]
_cfg_file = r"""
[default]
string = foo
quoted = "bar"
single_quoted = 'foobar'
skip-slave-start
"""
class TestParser(TestCase):
def test_string(self):
parser = Parser()
parser.rea... | "bar") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/test_optionfile.py | test_string | self.assertEqual | string_literal | 22 | from io import StringIO
from unittest import TestCase
from pymysql.optionfile import Parser
__all__ = ["TestParser"]
_cfg_file = r"""
[default]
string = foo
quoted = "bar"
single_quoted = 'foobar'
skip-slave-start
"""
class TestParser(TestCase):
def test_string(self):
parser = Parser()
parser.rea... | "foobar") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/capabilities.py | test_transactions | self.assertFalse | variable | 133 | import sys
from time import time
import unittest
class DatabaseTest(unittest.TestCase):
db_module = None
connect_args = ()
connect_kwargs = dict(use_unicode=True, charset="utf8mb4", binary_prefix=True)
create_table_extra = "ENGINE=INNODB CHARACTER SET UTF8MB4"
rows = 10
debug = False
def ... | l) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/capabilities.py | tearDown | self.assertFalse | variable | 40 | import sys
from time import time
import unittest
class DatabaseTest(unittest.TestCase):
db_module = None
connect_args = ()
connect_kwargs = dict(use_unicode=True, charset="utf8mb4", binary_prefix=True)
create_table_extra = "ENGINE=INNODB CHARACTER SET UTF8MB4"
rows = 10
debug = False
def ... | orphans) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/capabilities.py | check_data_integrity | self.assertEqual | complex_expr | 94 | import sys
from time import time
import unittest
class DatabaseTest(unittest.TestCase):
db_module = None
connect_args = ()
connect_kwargs = dict(use_unicode=True, charset="utf8mb4", binary_prefix=True)
create_table_extra = "ENGINE=INNODB CHARACTER SET UTF8MB4"
rows = 10
debug = False
def ... | self.rows) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/capabilities.py | test_transactions | self.assertTrue | func_call | 137 | import sys
from time import time
import unittest
class DatabaseTest(unittest.TestCase):
db_module = None
connect_args = ()
connect_kwargs = dict(use_unicode=True, charset="utf8mb4", binary_prefix=True)
create_table_extra = "ENGINE=INNODB CHARACTER SET UTF8MB4"
rows = 10
debug = False
def ... | len(l) == 1) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/capabilities.py | check_data_integrity | self.assertEqual | func_call | 98 | import sys
from time import time
import unittest
class DatabaseTest(unittest.TestCase):
db_module = None
connect_args = ()
connect_kwargs = dict(use_unicode=True, charset="utf8mb4", binary_prefix=True)
create_table_extra = "ENGINE=INNODB CHARACTER SET UTF8MB4"
rows = 10
debug = False
def ... | generator(i, j)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py | test_cursor_isolation | self.assertEqual | numeric_literal | 83 | __rcs_id__ = "$Id$"
__version__ = "$Revision$"[11:-2]
__author__ = "Stuart Bishop <zen@shangri-la.dropbear.id.au>"
import time
import unittest
class DatabaseAPI20Test(unittest.TestCase):
driver = None
connect_args = () # List of arguments to pass to connect
connect_kw_args = {} # Keyword arguments for ... | 1) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py | test_fetchmany | self.assertEqual | numeric_literal | 177 | __rcs_id__ = "$Id$"
__version__ = "$Revision$"[11:-2]
__author__ = "Stuart Bishop <zen@shangri-la.dropbear.id.au>"
import time
import unittest
class DatabaseAPI20Test(unittest.TestCase):
driver = None
connect_args = () # List of arguments to pass to connect
connect_kw_args = {} # Keyword arguments for ... | 2) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py | test_fetchmany | self.assertEqual | numeric_literal | 179 | __rcs_id__ = "$Id$"
__version__ = "$Revision$"[11:-2]
__author__ = "Stuart Bishop <zen@shangri-la.dropbear.id.au>"
import time
import unittest
class DatabaseAPI20Test(unittest.TestCase):
driver = None
connect_args = () # List of arguments to pass to connect
connect_kw_args = {} # Keyword arguments for ... | 0) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py | test_fetchmany | self.assertEqual | numeric_literal | 186 | __rcs_id__ = "$Id$"
__version__ = "$Revision$"[11:-2]
__author__ = "Stuart Bishop <zen@shangri-la.dropbear.id.au>"
import time
import unittest
class DatabaseAPI20Test(unittest.TestCase):
driver = None
connect_args = () # List of arguments to pass to connect
connect_kw_args = {} # Keyword arguments for ... | 6) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py | test_nextset | assert | none_literal | 163 | __rcs_id__ = "$Id$"
__version__ = "$Revision$"[11:-2]
__author__ = "Stuart Bishop <zen@shangri-la.dropbear.id.au>"
import time
import unittest
class DatabaseAPI20Test(unittest.TestCase):
driver = None
connect_args = () # List of arguments to pass to connect
connect_kw_args = {} # Keyword arguments for ... | None | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py | test_apilevel | self.assertEqual | string_literal | 75 | __rcs_id__ = "$Id$"
__version__ = "$Revision$"[11:-2]
__author__ = "Stuart Bishop <zen@shangri-la.dropbear.id.au>"
import time
import unittest
class DatabaseAPI20Test(unittest.TestCase):
driver = None
connect_args = () # List of arguments to pass to connect
connect_kw_args = {} # Keyword arguments for ... | "2.0") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py | test_callproc | self.assertEqual | string_literal | 77 | __rcs_id__ = "$Id$"
__version__ = "$Revision$"[11:-2]
__author__ = "Stuart Bishop <zen@shangri-la.dropbear.id.au>"
import time
import unittest
class DatabaseAPI20Test(unittest.TestCase):
driver = None
connect_args = () # List of arguments to pass to connect
connect_kw_args = {} # Keyword arguments for ... | "FOO") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py | test_nextset | assert | func_call | 158 | __rcs_id__ = "$Id$"
__version__ = "$Revision$"[11:-2]
__author__ = "Stuart Bishop <zen@shangri-la.dropbear.id.au>"
import time
import unittest
class DatabaseAPI20Test(unittest.TestCase):
driver = None
connect_args = () # List of arguments to pass to connect
connect_kw_args = {} # Keyword arguments for ... | len(self.samples) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py | test_close | self.assertRaises | complex_expr | 79 | __rcs_id__ = "$Id$"
__version__ = "$Revision$"[11:-2]
__author__ = "Stuart Bishop <zen@shangri-la.dropbear.id.au>"
import time
import unittest
class DatabaseAPI20Test(unittest.TestCase):
driver = None
connect_args = () # List of arguments to pass to connect
connect_kw_args = {} # Keyword arguments for ... | self.driver.Error) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/dbapi20.py | test_cursor_isolation | self.assertEqual | string_literal | 85 | __rcs_id__ = "$Id$"
__version__ = "$Revision$"[11:-2]
__author__ = "Stuart Bishop <zen@shangri-la.dropbear.id.au>"
import time
import unittest
class DatabaseAPI20Test(unittest.TestCase):
driver = None
connect_args = () # List of arguments to pass to connect
connect_kw_args = {} # Keyword arguments for ... | "Victoria Bitter") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py | test_stored_procedures | self.assertEqual | numeric_literal | 45 | from . import capabilities
import unittest
import pymysql
from pymysql.tests import base
import warnings
warnings.filterwarnings("error")
class test_MySQLdb(capabilities.DatabaseTest):
db_module = pymysql
connect_args = ()
connect_kwargs = base.PyMySQLTestCase.databases[0].copy()
leak_test = False
... | 1) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py | test_stored_procedures | self.assertEqual | numeric_literal | 46 | from . import capabilities
import unittest
import pymysql
from pymysql.tests import base
import warnings
warnings.filterwarnings("error")
class test_MySQLdb(capabilities.DatabaseTest):
db_module = pymysql
connect_args = ()
connect_kwargs = base.PyMySQLTestCase.databases[0].copy()
leak_test = False
... | 3) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py | test_bug_2671682 | self.assertEqual | complex_expr | 27 | from . import capabilities
import unittest
import pymysql
from pymysql.tests import base
import warnings
warnings.filterwarnings("error")
class test_MySQLdb(capabilities.DatabaseTest):
db_module = pymysql
connect_args = ()
connect_kwargs = base.PyMySQLTestCase.databases[0].copy()
leak_test = False
... | ER.NO_SUCH_TABLE) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py | test_literal_float | self.assertEqual | func_call | 22 | from . import capabilities
import unittest
import pymysql
from pymysql.tests import base
import warnings
warnings.filterwarnings("error")
class test_MySQLdb(capabilities.DatabaseTest):
db_module = pymysql
connect_args = ()
connect_kwargs = base.PyMySQLTestCase.databases[0].copy()
leak_test = False
... | self.connection.literal(3.1415)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py | test_literal_int | self.assertTrue | string_literal | 22 | from . import capabilities
import unittest
import pymysql
from pymysql.tests import base
import warnings
warnings.filterwarnings("error")
class test_MySQLdb(capabilities.DatabaseTest):
db_module = pymysql
connect_args = ()
connect_kwargs = base.PyMySQLTestCase.databases[0].copy()
leak_test = False
... | "2" == self.connection.literal(2)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py | test_literal_string | self.assertTrue | string_literal | 22 | from . import capabilities
import unittest
import pymysql
from pymysql.tests import base
import warnings
warnings.filterwarnings("error")
class test_MySQLdb(capabilities.DatabaseTest):
db_module = pymysql
connect_args = ()
connect_kwargs = base.PyMySQLTestCase.databases[0].copy()
leak_test = False
... | "'foo'" == self.connection.literal("foo")) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py | test_nextset | assert | func_call | 55 | from . import dbapi20
import pymysql
from pymysql.tests import base
import unittest
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = pymysql
connect_args = ()
connect_kw_args = base.PyMySQLTestCase.databases[0].copy()
def test_nextset(self):
pass
def help_nextset_setUp(self, cur):... | len(self.samples) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py | test_fetchall | self.assertRaises | complex_expr | 20 | from . import dbapi20
import pymysql
from pymysql.tests import base
import unittest
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = pymysql
connect_args = ()
connect_kw_args = base.PyMySQLTestCase.databases[0].copy()
def test_fetchall(self):
con = self._connect()
try:
... | self.driver.Error) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py | test_fetchall | self.assertTrue | func_call | 56 | from . import dbapi20
import pymysql
from pymysql.tests import base
import unittest
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = pymysql
connect_args = ()
connect_kw_args = base.PyMySQLTestCase.databases[0].copy()
def test_fetchall(self):
con = self._connect()
try:
... | cur.rowcount in (-1, 0)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py | test_fetchone | self.assertTrue | func_call | 53 | from . import dbapi20
import pymysql
from pymysql.tests import base
import unittest
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = pymysql
connect_args = ()
connect_kw_args = base.PyMySQLTestCase.databases[0].copy()
def test_fetchone(self):
con = self._connect()
try:
... | cur.rowcount in (-1, 1)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py | test_fetchall | self.assertTrue | func_call | 32 | from . import dbapi20
import pymysql
from pymysql.tests import base
import unittest
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = pymysql
connect_args = ()
connect_kw_args = base.PyMySQLTestCase.databases[0].copy()
def test_fetchall(self):
con = self._connect()
try:
... | cur.rowcount in (-1, len(self.samples))) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py | test_fetchall | self.assertEqual | string_literal | 41 | from . import dbapi20
import pymysql
from pymysql.tests import base
import unittest
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = pymysql
connect_args = ()
connect_kw_args = base.PyMySQLTestCase.databases[0].copy()
def test_fetchall(self):
con = self._connect()
try:
... | "cursor.fetchall retrieved incorrect rows") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py | test_fetchone | self.assertEqual | string_literal | 47 | from . import dbapi20
import pymysql
from pymysql.tests import base
import unittest
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = pymysql
connect_args = ()
connect_kw_args = base.PyMySQLTestCase.databases[0].copy()
def test_fetchone(self):
con = self._connect()
try:
... | "cursor.fetchone retrieved incorrect data") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py | test_nextset | self.assertEqual | string_literal | 62 | from . import dbapi20
import pymysql
from pymysql.tests import base
import unittest
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = pymysql
connect_args = ()
connect_kw_args = base.PyMySQLTestCase.databases[0].copy()
def test_nextset(self):
pass
def help_nextset_setUp(self, cur):... | "non-empty result set after other result sets") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py | test_fetchone | self.assertEqual | string_literal | 44 | from . import dbapi20
import pymysql
from pymysql.tests import base
import unittest
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = pymysql
connect_args = ()
connect_kw_args = base.PyMySQLTestCase.databases[0].copy()
def test_fetchone(self):
con = self._connect()
try:
... | "cursor.fetchone should have retrieved a single row") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_version | self.assertEqual | numeric_literal | 18 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreModule(unittest.TestCase):
def test_version(self):
"""Version information sanity."""
self.assertTrue(isinstance(_mysql.__version__, str))
self.ass... | 5) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_NULL | self.assertEqual | string_literal | 15 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreModule(unittest.TestCase):
def test_NULL(self):
"""Should have a NULL constant."""
self.assertEqual(_mysql.NULL, | "NULL") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_thread_id | self.assertRaises | variable | 27 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreAPI(unittest.TestCase):
def setUp(self):
kwargs = base.PyMySQLTestCase.databases[0].copy()
kwargs["read_default_file"] = "~/.my.cnf"
self.conn = _m... | TypeError) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_thread_id | self.assertTrue | func_call | 23 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreAPI(unittest.TestCase):
def setUp(self):
kwargs = base.PyMySQLTestCase.databases[0].copy()
kwargs["read_default_file"] = "~/.my.cnf"
self.conn = _m... | isinstance(tid, int)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_set_equality | self.assertTrue | complex_expr | 13 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class TestDBAPISet(unittest.TestCase):
def test_set_equality(self):
self.assertTrue( | pymysql.STRING == pymysql.STRING) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_set_inequality | self.assertTrue | complex_expr | 14 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class TestDBAPISet(unittest.TestCase):
def test_set_inequality(self):
self.assertTrue( | pymysql.STRING != pymysql.NUMBER) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_set_inequality_membership | self.assertTrue | complex_expr | 14 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class TestDBAPISet(unittest.TestCase):
def test_set_inequality_membership(self):
self.assertTrue( | FIELD_TYPE.DATE != pymysql.STRING) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_version | self.assertTrue | func_call | 15 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreModule(unittest.TestCase):
def test_version(self):
"""Version information sanity."""
self.assertTrue( | isinstance(_mysql.__version__, str)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_thread_safe | self.assertTrue | func_call | 14 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreModule(unittest.TestCase):
def test_thread_safe(self):
self.assertTrue( | isinstance(_mysql.thread_safe(), int)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_version | self.assertTrue | func_call | 17 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreModule(unittest.TestCase):
def test_version(self):
"""Version information sanity."""
self.assertTrue(isinstance(_mysql.__version__, str))
self.as... | isinstance(_mysql.version_info, tuple)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_set_equality_membership | self.assertTrue | complex_expr | 14 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class TestDBAPISet(unittest.TestCase):
def test_set_equality_membership(self):
self.assertTrue( | FIELD_TYPE.VAR_STRING == pymysql.STRING) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_affected_rows | self.assertEqual | string_literal | 22 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreAPI(unittest.TestCase):
def setUp(self):
kwargs = base.PyMySQLTestCase.databases[0].copy()
kwargs["read_default_file"] = "~/.my.cnf"
self.conn = _m... | "Should return 0 before we do anything.") | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_client_info | self.assertTrue | func_call | 14 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreModule(unittest.TestCase):
def test_client_info(self):
self.assertTrue( | isinstance(_mysql.get_client_info(), str)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_proto_info | self.assertTrue | func_call | 22 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreAPI(unittest.TestCase):
def setUp(self):
kwargs = base.PyMySQLTestCase.databases[0].copy()
kwargs["read_default_file"] = "~/.my.cnf"
self.conn = _m... | isinstance(self.conn.get_proto_info(), int)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_server_info | self.assertTrue | func_call | 22 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreAPI(unittest.TestCase):
def setUp(self):
kwargs = base.PyMySQLTestCase.databases[0].copy()
kwargs["read_default_file"] = "~/.my.cnf"
self.conn = _m... | isinstance(self.conn.get_server_info(), str)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyMySQL/PyMySQL | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | train | train | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py | test_charset_name | self.assertTrue | func_call | 22 | import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class CoreAPI(unittest.TestCase):
def setUp(self):
kwargs = base.PyMySQLTestCase.databases[0].copy()
kwargs["read_default_file"] = "~/.my.cnf"
self.conn = _m... | isinstance(self.conn.character_set_name(), str)) | 255b5dd931cbe3f9dda846ae99bed6b0c0ecf778 | 114 | v2_extractor_at_anchor |
PyVRP/PyVRP | 0c4342eb8217ecabe16de774364c71d9506ba046 | 207 | train | train | tests/crossover/test_ordered_crossover.py | test_raises_when_not_tsp | assert_* | numeric_literal | 18 | from numpy.testing import assert_equal, assert_raises
from pyvrp import CostEvaluator, RandomNumberGenerator, Solution, VehicleType
from pyvrp.crossover import ordered_crossover as ox
from pyvrp.crossover._crossover import ordered_crossover as cpp_ox
def test_raises_when_not_tsp(ok_small):
"""
Tests that the ... | 3) | 0c4342eb8217ecabe16de774364c71d9506ba046 | 207 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.