X-Git-Url: https://git.jsancho.org/?p=datasette-pytables.git;a=blobdiff_plain;f=tests%2Ffixtures.py;h=6093bda0ea7321d8dc7cf2e24df8dd71a919271b;hp=d5fdb051a6eac10be3d15cda3122b1df0ef87c63;hb=f1a049b7a43d2c4e77d4493f50e1a9c345d84a16;hpb=06bdd1ac2d8836a2ab8e14074f2435a4c3a595b5 diff --git a/tests/fixtures.py b/tests/fixtures.py index d5fdb05..6093bda 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -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') @@ -11,7 +17,7 @@ def app_client(max_returned_rows=None): [filepath], config={ 'default_page_size': 50, - 'max_returned_rows': max_returned_rows or 100, + 'max_returned_rows': max_returned_rows or 1000, } ) client = ds.app().test_client @@ -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