forked from hans/Nominatim
disable improved BDD test naming for pytest < 8
Needs the improved test collector introduced in pytest 8.0.
This commit is contained in:
@@ -377,8 +377,9 @@ def check_place_missing_lines(db_conn, table, osm_type, osm_id, osm_class):
|
||||
assert cur.execute(sql, params).fetchone()[0] == 0
|
||||
|
||||
|
||||
def pytest_pycollect_makemodule(module_path, parent):
|
||||
return BddTestCollector.from_parent(parent, path=module_path)
|
||||
if pytest.version_tuple >= (8, 0, 0):
|
||||
def pytest_pycollect_makemodule(module_path, parent):
|
||||
return BddTestCollector.from_parent(parent, path=module_path)
|
||||
|
||||
|
||||
class BddTestCollector(pytest.Module):
|
||||
|
||||
@@ -150,4 +150,8 @@ def parse_api_json_response(api_response, fmt, num):
|
||||
return result
|
||||
|
||||
|
||||
PYTEST_BDD_SCENARIOS = ['features/api']
|
||||
if pytest.version_tuple >= (8, 0, 0):
|
||||
PYTEST_BDD_SCENARIOS = ['features/api']
|
||||
else:
|
||||
from pytest_bdd import scenarios
|
||||
scenarios('features/api')
|
||||
|
||||
@@ -276,4 +276,8 @@ def then_check_interpolation_table_negative(db_conn, oid):
|
||||
assert cur.fetchone()[0] == 0
|
||||
|
||||
|
||||
PYTEST_BDD_SCENARIOS = ['features/db']
|
||||
if pytest.version_tuple >= (8, 0, 0):
|
||||
PYTEST_BDD_SCENARIOS = ['features/db']
|
||||
else:
|
||||
from pytest_bdd import scenarios
|
||||
scenarios('features/db')
|
||||
|
||||
@@ -106,4 +106,8 @@ def check_place_content(db_conn, datatable, node_grid, table, exact):
|
||||
check_table_content(db_conn, table, datatable, grid=node_grid, exact=bool(exact))
|
||||
|
||||
|
||||
PYTEST_BDD_SCENARIOS = ['features/osm2pgsql']
|
||||
if pytest.version_tuple >= (8, 0, 0):
|
||||
PYTEST_BDD_SCENARIOS = ['features/osm2pgsql']
|
||||
else:
|
||||
from pytest_bdd import scenarios
|
||||
scenarios('features/osm2pgsql')
|
||||
|
||||
Reference in New Issue
Block a user