Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Simplify integration tests #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions tests/integration/test_cursor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from rebirthdb.errors import ReqlCursorEmpty
from tests.helpers import IntegrationTestCaseBase, INTEGRATION_TEST_DB
from tests.helpers import IntegrationTestCaseBase


@pytest.mark.integration
Expand All @@ -18,10 +18,6 @@ def setup_method(self):
{'id': 5, 'name': 'Testing Cursor/Next 5'},
]

def teardown_method(self):
self.r.table_drop(self.table_name).run(self.conn)
super(TestCursor, self).teardown_method()

def test_get_next_document(self):
self.r.table(self.table_name).insert(self.documents).run(self.conn)
documents = list()
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@


@pytest.mark.integration
class TestCursorFor(IntegrationTestCaseBase):
class TestDatabase(IntegrationTestCaseBase):
def setup_method(self):
super(TestCursorFor, self).setup_method()
super(TestDatabase, self).setup_method()
self.test_db_name = 'test_database'

def test_db_create(self):
Expand Down
6 changes: 0 additions & 6 deletions tests/integration/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def setup_method(self):

def test_table_create(self):
result = self.r.table_create(self.test_table_name).run(self.conn)
self.r.table_drop(self.test_table_name).run(self.conn)

assert result['tables_created'] == 1
assert len(result['config_changes']) == 1
Expand All @@ -28,7 +27,6 @@ def test_table_different_primary_key(self):
expected_primary_key = 'bazinga'

result = self.r.table_create(self.test_table_name, primary_key=expected_primary_key).run(self.conn)
self.r.table_drop(self.test_table_name).run(self.conn)

assert result['tables_created'] == 1
assert len(result['config_changes']) == 1
Expand All @@ -38,7 +36,6 @@ def test_table_multiple_shards(self):
expected_shards = 2

result = self.r.table_create(self.test_table_name, shards=expected_shards).run(self.conn)
self.r.table_drop(self.test_table_name).run(self.conn)

assert result['tables_created'] == 1
assert len(result['config_changes']) == 1
Expand All @@ -48,7 +45,6 @@ def test_table_create_with_replicas(self):
expected_replicas = 1

result = self.r.table_create(self.test_table_name, replicas=expected_replicas).run(self.conn)
self.r.table_drop(self.test_table_name).run(self.conn)

assert result['tables_created'] == 1
assert len(result['config_changes']) == 1
Expand All @@ -67,8 +63,6 @@ def test_table_create_twice(self):
with pytest.raises(ReqlRuntimeError):
self.r.table_create(self.test_table_name).run(self.conn)

self.r.table_drop(self.test_table_name).run(self.conn)

def test_table_drop(self):
self.r.table_create(self.test_table_name).run(self.conn)

Expand Down