Skip to content

Commit 34595aa

Browse files
committed
add tests
1 parent f313bc3 commit 34595aa

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ allow_failure:
1515

1616
install:
1717
- pip install -r requirements.txt
18+
- pip install -r requirements-dev.txt
1819

1920
before_script:
2021
- make prepare

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tornado>=5.0
2+
pytest-tornasync

tests/integration/test_tornado.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import os
2+
import sys
3+
from collections import namedtuple
4+
import pytest
5+
from rethinkdb import RethinkDB
6+
from rethinkdb.errors import ReqlRuntimeError
7+
8+
Helper = namedtuple("Helper", "r connection")
9+
10+
INTEGRATION_TEST_DB = 'integration_test'
11+
12+
13+
@pytest.mark.integration
14+
@pytest.mark.skipif(sys.version_info < (3, 6),
15+
reason="requires python3.6 or higher")
16+
async def test_tornado_connect():
17+
"""
18+
Test the flow for 3.6 and up, async generators are
19+
not supported in 3.5.
20+
"""
21+
22+
r = RethinkDB()
23+
r.set_loop_type("tornado")
24+
25+
connection = await r.connect(os.getenv("REBIRTHDB_HOST"))
26+
dbs = await r.db_list().run(connection)
27+
assert isinstance(dbs, list)
28+
await connection.close()

0 commit comments

Comments
 (0)