From dfbf4ffe0fe19f09d27ea4a68bf2af8a2b63ac70 Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Thu, 9 May 2019 13:50:17 +0200 Subject: [PATCH] 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> --- alternator-test/conftest.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/alternator-test/conftest.py b/alternator-test/conftest.py index e1b5edc7c9..640c2fb547 100644 --- a/alternator-test/conftest.py +++ b/alternator-test/conftest.py @@ -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]