mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove always-false branches
This commit is contained in:
parent
65ae948eca
commit
cfa324a7ed
@ -64,10 +64,7 @@ def app_params(request: Any, test_params: Dict, shared_result: SharedResult,
|
|||||||
|
|
||||||
# ##### process pytest.mark.sphinx
|
# ##### process pytest.mark.sphinx
|
||||||
|
|
||||||
if hasattr(request.node, 'iter_markers'): # pytest-3.6.0 or newer
|
markers = request.node.iter_markers("sphinx")
|
||||||
markers = request.node.iter_markers("sphinx")
|
|
||||||
else:
|
|
||||||
markers = request.node.get_marker("sphinx")
|
|
||||||
pargs = {}
|
pargs = {}
|
||||||
kwargs: Dict[str, Any] = {}
|
kwargs: Dict[str, Any] = {}
|
||||||
|
|
||||||
@ -113,10 +110,7 @@ def test_params(request: Any) -> Dict:
|
|||||||
have same 'shared_result' value.
|
have same 'shared_result' value.
|
||||||
**NOTE**: You can not specify both shared_result and srcdir.
|
**NOTE**: You can not specify both shared_result and srcdir.
|
||||||
"""
|
"""
|
||||||
if hasattr(request.node, 'get_closest_marker'): # pytest-3.6.0 or newer
|
env = request.node.get_closest_marker('test_params')
|
||||||
env = request.node.get_closest_marker('test_params')
|
|
||||||
else:
|
|
||||||
env = request.node.get_marker('test_params')
|
|
||||||
kwargs = env.kwargs if env else {}
|
kwargs = env.kwargs if env else {}
|
||||||
result = {
|
result = {
|
||||||
'shared_result': None,
|
'shared_result': None,
|
||||||
|
@ -22,10 +22,7 @@ def apidoc(rootdir, tempdir, apidoc_params):
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def apidoc_params(request):
|
def apidoc_params(request):
|
||||||
if hasattr(request.node, 'iter_markers'): # pytest-3.6.0 or newer
|
markers = request.node.iter_markers("apidoc")
|
||||||
markers = request.node.iter_markers("apidoc")
|
|
||||||
else:
|
|
||||||
markers = request.node.get_marker("apidoc")
|
|
||||||
pargs = {}
|
pargs = {}
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
|
|
||||||
|
@ -18,10 +18,7 @@ def setup_command(request, tempdir, rootdir):
|
|||||||
Run `setup.py build_sphinx` with args and kwargs,
|
Run `setup.py build_sphinx` with args and kwargs,
|
||||||
pass it to the test and clean up properly.
|
pass it to the test and clean up properly.
|
||||||
"""
|
"""
|
||||||
if hasattr(request.node, 'get_closest_marker'): # pytest-3.6.0 or newer
|
marker = request.node.get_closest_marker('setup_command')
|
||||||
marker = request.node.get_closest_marker('setup_command')
|
|
||||||
else:
|
|
||||||
marker = request.node.get_marker('setup_command')
|
|
||||||
args = marker.args if marker else []
|
args = marker.args if marker else []
|
||||||
|
|
||||||
pkgrootdir = tempdir / 'test-setup'
|
pkgrootdir = tempdir / 'test-setup'
|
||||||
|
Loading…
Reference in New Issue
Block a user