alternator-test: add 2 tables fixture

For some tests, more than 1 table is needed, so another fixture
that provided two additional test tables is added.
Message-Id: <75ae9de5cc1bca19594db1f0bc03260f83459380.1557402320.git.sarna@scylladb.com>
This commit is contained in:
Piotr Sarna
2019-05-09 13:50:17 +02:00
committed by Nadav Har'El
parent b6dde25bcc
commit dfbf4ffe0f

View File

@@ -88,3 +88,16 @@ def test_table(dynamodb):
# we create a test_table fixture, we'll choose a different table name
# anyway.
table.delete()
@pytest.fixture(scope="session")
def test_2_tables(dynamodb):
tables = [create_test_table(dynamodb,
KeySchema=[ { 'AttributeName': 'p', 'KeyType': 'HASH' },
{ 'AttributeName': 'c', 'KeyType': 'RANGE' }
],
AttributeDefinitions=[
{ 'AttributeName': 'p', 'AttributeType': 'S' },
{ 'AttributeName': 'c', 'AttributeType': 'S' },
]) for _ in range(2)]
yield tables
[table.delete() for table in tables]