def test_insert(empty_warehouse): """ Inserts a fact with MAX_ITERATIONS ^ 2 rows. """ enable_logging() Warehouse.use(empty_warehouse) Store.build() stores = _get_instances('store') Store.insert(*stores) Product.build() products = _get_instances('product') Product.insert(*products) Sales.build() sales = _get_instances('sales') start_time = datetime.datetime.now() print 'Starting bulk insert of fact at ', start_time try: Sales.insert(*sales) except OperationalError: pytest.fail('The connection broke.') end_time = datetime.datetime.now() print 'Ending bulk insert of fact at ', end_time delta = end_time - start_time print 'Time taken = ', delta