|
24 | 24 | import json |
25 | 25 | import os |
26 | 26 | import socket |
| 27 | +import sys |
27 | 28 | import unittest |
28 | 29 | import doctest |
29 | 30 | from pprint import pprint |
|
40 | 41 | crate_host, crate_path, crate_port, \ |
41 | 42 | crate_transport_port, docs_path, localhost |
42 | 43 | from crate.client import connect |
| 44 | +from .sqlalchemy import SA_VERSION, SA_1_4 |
43 | 45 |
|
44 | 46 | from .test_cursor import CursorTest |
45 | 47 | from .test_connection import ConnectionTest |
@@ -382,13 +384,23 @@ def test_suite(): |
382 | 384 | s.layer = ensure_cratedb_layer() |
383 | 385 | suite.addTest(s) |
384 | 386 |
|
385 | | - s = doctest.DocFileSuite( |
| 387 | + sqlalchemy_integration_tests = [ |
386 | 388 | 'docs/by-example/sqlalchemy/getting-started.rst', |
387 | 389 | 'docs/by-example/sqlalchemy/crud.rst', |
388 | 390 | 'docs/by-example/sqlalchemy/working-with-types.rst', |
389 | 391 | 'docs/by-example/sqlalchemy/advanced-querying.rst', |
390 | 392 | 'docs/by-example/sqlalchemy/inspection-reflection.rst', |
391 | | - 'docs/by-example/sqlalchemy/dataframe.rst', |
| 393 | + ] |
| 394 | + |
| 395 | + # Don't run DataFrame integration tests on SQLAlchemy 1.3 and Python 3.7. |
| 396 | + skip_dataframe = SA_VERSION < SA_1_4 or sys.version_info < (3, 8) |
| 397 | + if not skip_dataframe: |
| 398 | + sqlalchemy_integration_tests += [ |
| 399 | + 'docs/by-example/sqlalchemy/dataframe.rst', |
| 400 | + ] |
| 401 | + |
| 402 | + s = doctest.DocFileSuite( |
| 403 | + *sqlalchemy_integration_tests, |
392 | 404 | module_relative=False, |
393 | 405 | setUp=setUpCrateLayerSqlAlchemy, |
394 | 406 | tearDown=tearDownDropEntitiesSqlAlchemy, |
|
0 commit comments