]> git.jsancho.org Git - datasette-pytables.git/blobdiff - tests/fixtures.py
Use the datasette-connectors module for monkey patching datasette
[datasette-pytables.git] / tests / fixtures.py
index bbca1186aefebe2c86704801d373a5b5d2aada96..6093bda0ea7321d8dc7cf2e24df8dd71a919271b 100644 (file)
@@ -1,8 +1,14 @@
+from datasette_connectors import monkey; monkey.patch_datasette()
+from datasette_connectors import connectors; connectors.load()
+
 from datasette.app import Datasette
+import numpy as np
 import os
+import pytest
 from tables import *
 import tempfile
 
+@pytest.fixture(scope='session')
 def app_client(max_returned_rows=None):
     with tempfile.TemporaryDirectory() as tmpdir:
         filepath = os.path.join(tmpdir, 'test_tables.h5')
@@ -37,6 +43,8 @@ def populate_file(filepath):
 
     array2 = h5file.create_array(group1, 'array2', [x for x in range(10000)])
 
+    multiarray = h5file.create_array(group2, 'multi', np.arange(1000).reshape(10, 50, 2))
+
     for table in (table1, table2):
         row = table.row