Skip to content

Commit a7760e3

Browse files
neirbowjTomAugspurger
authored andcommitted
TST: Skip test_database_uri_string if pg8000 importable (#16528)
1 parent 7b106e4 commit a7760e3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/io/test_sql.py

+7
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,13 @@ def test_database_uri_string(self):
948948

949949
# using driver that will not be installed on Travis to trigger error
950950
# in sqlalchemy.create_engine -> test passing of this error to user
951+
try:
952+
# the rest of this test depends on pg8000's being absent
953+
import pg8000 # noqa
954+
pytest.skip("pg8000 is installed")
955+
except ImportError:
956+
pass
957+
951958
db_uri = "postgresql+pg8000://user:pass@host/dbname"
952959
with tm.assert_raises_regex(ImportError, "pg8000"):
953960
sql.read_sql("select * from table", db_uri)

0 commit comments

Comments
 (0)