From 4ef2e574f060b539939aecdc3526ccb7edcded04 Mon Sep 17 00:00:00 2001 From: moink Date: Fri, 1 Jan 2021 10:43:44 +0100 Subject: [PATCH 1/4] TST: GH30999 test commit to run in the CI to figure out the error messages in test_sql and test_compat --- pandas/tests/computation/test_compat.py | 5 +++-- pandas/tests/io/test_sql.py | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pandas/tests/computation/test_compat.py b/pandas/tests/computation/test_compat.py index 9fc3ed4800d09..f5103564bb7eb 100644 --- a/pandas/tests/computation/test_compat.py +++ b/pandas/tests/computation/test_compat.py @@ -41,8 +41,9 @@ def testit(): pytest.skip("no numexpr") else: if LooseVersion(ne.__version__) < LooseVersion(VERSIONS["numexpr"]): - with pytest.raises(ImportError): - testit() + # TODO comment this back in once we know the exception message + # with pytest.raises(ImportError): + testit() else: testit() else: diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index 52869f3f2fd42..2293e71b2f11c 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -2896,8 +2896,9 @@ def test_execute_fail(self): sql.execute('INSERT INTO test VALUES("foo", "bar", 1.234)', self.conn) sql.execute('INSERT INTO test VALUES("foo", "baz", 2.567)', self.conn) - with pytest.raises(Exception): - sql.execute('INSERT INTO test VALUES("foo", "bar", 7)', self.conn) + # TODO comment this back in once we know the exception message + # with pytest.raises(Exception): + sql.execute('INSERT INTO test VALUES("foo", "bar", 7)', self.conn) def test_execute_closed_connection(self, request, datapath): drop_sql = "DROP TABLE IF EXISTS test" @@ -2917,8 +2918,9 @@ def test_execute_closed_connection(self, request, datapath): sql.execute('INSERT INTO test VALUES("foo", "bar", 1.234)', self.conn) self.conn.close() - with pytest.raises(Exception): - tquery("select * from test", con=self.conn) + # TODO comment this back in once we know the exception message + # with pytest.raises(Exception): + tquery("select * from test", con=self.conn) # Initialize connection again (needed for tearDown) self.setup_method(request, datapath) From 670630fd56796976746b7a61fa37c001deb42bc0 Mon Sep 17 00:00:00 2001 From: moink Date: Fri, 1 Jan 2021 14:58:44 +0100 Subject: [PATCH 2/4] TST: GH30999 also comment out the pytest.skip --- pandas/tests/io/test_sql.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index 2293e71b2f11c..16e6ce9389eda 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -2755,9 +2755,9 @@ def clean_up(test_table_to_drop): @pytest.mark.single @pytest.mark.db -@pytest.mark.skip( - reason="gh-13611: there is no support for MySQL if SQLAlchemy is not installed" -) +# @pytest.mark.skip( +# reason="gh-13611: there is no support for MySQL if SQLAlchemy is not installed" +# ) class TestXMySQL(MySQLMixIn): @pytest.fixture(autouse=True, scope="class") def setup_class(cls): From cf273ad6f965ff218eb69a2b4c05c1f82678c049 Mon Sep 17 00:00:00 2001 From: moink Date: Sun, 3 Jan 2021 12:48:16 +0100 Subject: [PATCH 3/4] TST: 30999 add placeholder messages to test_sql and remove version check from test_compat --- pandas/tests/computation/test_compat.py | 9 ++------- pandas/tests/io/test_sql.py | 10 ++++------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/pandas/tests/computation/test_compat.py b/pandas/tests/computation/test_compat.py index f5103564bb7eb..8fa11ab75dd67 100644 --- a/pandas/tests/computation/test_compat.py +++ b/pandas/tests/computation/test_compat.py @@ -36,15 +36,10 @@ def testit(): if engine == "numexpr": try: - import numexpr as ne + import numexpr as ne # noqa F401 except ImportError: pytest.skip("no numexpr") else: - if LooseVersion(ne.__version__) < LooseVersion(VERSIONS["numexpr"]): - # TODO comment this back in once we know the exception message - # with pytest.raises(ImportError): - testit() - else: - testit() + testit() else: testit() diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index 16e6ce9389eda..645a762d55204 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -2896,9 +2896,8 @@ def test_execute_fail(self): sql.execute('INSERT INTO test VALUES("foo", "bar", 1.234)', self.conn) sql.execute('INSERT INTO test VALUES("foo", "baz", 2.567)', self.conn) - # TODO comment this back in once we know the exception message - # with pytest.raises(Exception): - sql.execute('INSERT INTO test VALUES("foo", "bar", 7)', self.conn) + with pytest.raises(Exception, match=""): + sql.execute('INSERT INTO test VALUES("foo", "bar", 7)', self.conn) def test_execute_closed_connection(self, request, datapath): drop_sql = "DROP TABLE IF EXISTS test" @@ -2918,9 +2917,8 @@ def test_execute_closed_connection(self, request, datapath): sql.execute('INSERT INTO test VALUES("foo", "bar", 1.234)', self.conn) self.conn.close() - # TODO comment this back in once we know the exception message - # with pytest.raises(Exception): - tquery("select * from test", con=self.conn) + with pytest.raises(Exception, match=""): + tquery("select * from test", con=self.conn) # Initialize connection again (needed for tearDown) self.setup_method(request, datapath) From 65e3124fdbee793ef9918ba8b9d4f16ce2e1be7e Mon Sep 17 00:00:00 2001 From: moink Date: Sun, 3 Jan 2021 12:55:04 +0100 Subject: [PATCH 4/4] TST: 30999 uncomment pytest skip for TestXMySQL --- pandas/tests/io/test_sql.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index 645a762d55204..6fb120faa6db2 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -2755,9 +2755,9 @@ def clean_up(test_table_to_drop): @pytest.mark.single @pytest.mark.db -# @pytest.mark.skip( -# reason="gh-13611: there is no support for MySQL if SQLAlchemy is not installed" -# ) +@pytest.mark.skip( + reason="gh-13611: there is no support for MySQL if SQLAlchemy is not installed" +) class TestXMySQL(MySQLMixIn): @pytest.fixture(autouse=True, scope="class") def setup_class(cls):