Upgrade pytest to 3.6.0

https://github.com/pytest-dev/pytest/issues/1875 made it impossible to declare
a function as a fixture multiple times, which we were doing across different
modules. The fix was to move our @pytest.fixture calls into decorators in the
tests/fixtures.py module.
This commit is contained in:
Simon Willison 2018-05-31 06:40:30 -07:00
commit 969771770f
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
5 changed files with 15 additions and 17 deletions

View file

@ -1,6 +1,7 @@
from datasette.app import Datasette
import itertools
import os
import pytest
import random
import sqlite3
import sys
@ -9,6 +10,7 @@ import tempfile
import time
@pytest.fixture(scope='session')
def app_client(sql_time_limit_ms=None, max_returned_rows=None, config=None):
with tempfile.TemporaryDirectory() as tmpdir:
filepath = os.path.join(tmpdir, 'test_tables.db')
@ -39,11 +41,13 @@ def app_client(sql_time_limit_ms=None, max_returned_rows=None, config=None):
yield client
@pytest.fixture(scope='session')
def app_client_shorter_time_limit():
yield from app_client(20)
def app_client_returend_rows_matches_page_size():
@pytest.fixture(scope='session')
def app_client_returned_rows_matches_page_size():
yield from app_client(max_returned_rows=50)