Skip to content

Commit bd2ed19

Browse files
tests: drop pytest_namespace
Pytest dropped support for pytest_namespace() in favor of pytest_configure() as per pytest-dev/pytest#4421. We also fixed some import sortings and the setup.py to make sure that the builds pass and have the same structure as other modules.
1 parent 9becac0 commit bd2ed19

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import re
2727
import sys
2828

29-
3029
_html_theme = "sphinx_rtd_theme"
3130
_html_theme_path = []
3231
try:

invenio_query_parser/parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from . import ast
1919
from ._compat import string_types
2020

21-
2221
# pylint: disable=C0321,R0903
2322

2423

setup.py

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,26 @@
3636
'pytest>=2.8.0',
3737
]
3838

39+
extras_require = {
40+
'docs': [
41+
'sphinx_rtd_theme>=0.1.9',
42+
],
43+
'elasticsearch': [
44+
'elasticsearch-dsl>=2.0.0',
45+
],
46+
'tests': tests_require,
47+
}
48+
49+
extras_require['all'] = []
50+
for reqs in extras_require.values():
51+
extras_require['all'].extend(reqs)
52+
53+
install_requires = [
54+
'pypeg2>=2.15.2',
55+
'ordereddict>=1.1',
56+
'six>=1.10.0',
57+
]
58+
3959
setup(
4060
name='invenio-query-parser',
4161
version=version,
@@ -48,20 +68,8 @@
4868
long_description=__doc__,
4969
packages=find_packages(exclude=['tests', 'docs']),
5070
include_package_data=True,
51-
install_requires=[
52-
'pypeg2>=2.15.2',
53-
'ordereddict>=1.1',
54-
'six>=1.10.0',
55-
],
56-
extras_require={
57-
'docs': [
58-
'sphinx_rtd_theme>=0.1.9',
59-
],
60-
'elasticsearch': [
61-
'elasticsearch-dsl>=2.0.0',
62-
],
63-
'tests': tests_require,
64-
},
71+
install_requires=install_requires,
72+
extras_require=extras_require,
6573
tests_require=tests_require,
6674
classifiers=[
6775
'Programming Language :: Python :: 2',

tests/conftest.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,5 @@ def fun(cls):
2323
return fun
2424

2525

26-
def pytest_namespace():
27-
return dict((
28-
("generate_tests", generate_tests),
29-
))
26+
def pytest_configure():
27+
pytest.generate_tests = generate_tests

0 commit comments

Comments
 (0)