Publish fixtures in the appropiate file
authorJavier Sancho <jsf@jsancho.org>
Thu, 4 Oct 2018 10:33:23 +0000 (12:33 +0200)
committerJavier Sancho <jsf@jsancho.org>
Thu, 4 Oct 2018 10:33:23 +0000 (12:33 +0200)
tests/fixtures.py
tests/test_api.py
tests/test_html.py

index e845efe146e6540e2108415943e7840896ab6fae..417eb630e723a51cbfa7f8c5567ad9298071e6e2 100644 (file)
@@ -1,9 +1,11 @@
 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')
index 5d0bfdcc212c0d432bdf6d0982d6b99e1bdc7a69..db9e41ca0a20a509895d687c7986271ab7afd4d0 100644 (file)
@@ -2,8 +2,6 @@ from .fixtures import app_client
 import pytest
 from urllib.parse import urlencode
 
-pytest.fixture(scope='module')(app_client)
-
 def test_homepage(app_client):
     _, response = app_client.get('/.json')
     assert response.status == 200
index a1ccaf3e9ff742361db766dc52ba943f7942574f..bbeb3a7fb46c0928f10893a4faaae7e89f3e8a02 100644 (file)
@@ -1,7 +1,4 @@
 from .fixtures import app_client
-import pytest
-
-pytest.fixture(scope='module')(app_client)
 
 def test_homepage(app_client):
     response = app_client.get('/', gather_request=False)