Remove always-false branches

This commit is contained in:
Adam Turner 2022-04-17 18:34:52 +01:00
parent 65ae948eca
commit cfa324a7ed
3 changed files with 4 additions and 16 deletions

View File

@ -64,10 +64,7 @@ def app_params(request: Any, test_params: Dict, shared_result: SharedResult,
# ##### process pytest.mark.sphinx
if hasattr(request.node, 'iter_markers'): # pytest-3.6.0 or newer
markers = request.node.iter_markers("sphinx")
else:
markers = request.node.get_marker("sphinx")
markers = request.node.iter_markers("sphinx")
pargs = {}
kwargs: Dict[str, Any] = {}
@ -113,10 +110,7 @@ def test_params(request: Any) -> Dict:
have same 'shared_result' value.
**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')
else:
env = request.node.get_marker('test_params')
env = request.node.get_closest_marker('test_params')
kwargs = env.kwargs if env else {}
result = {
'shared_result': None,

View File

@ -22,10 +22,7 @@ def apidoc(rootdir, tempdir, apidoc_params):
@pytest.fixture
def apidoc_params(request):
if hasattr(request.node, 'iter_markers'): # pytest-3.6.0 or newer
markers = request.node.iter_markers("apidoc")
else:
markers = request.node.get_marker("apidoc")
markers = request.node.iter_markers("apidoc")
pargs = {}
kwargs = {}

View File

@ -18,10 +18,7 @@ def setup_command(request, tempdir, rootdir):
Run `setup.py build_sphinx` with args and kwargs,
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')
else:
marker = request.node.get_marker('setup_command')
marker = request.node.get_closest_marker('setup_command')
args = marker.args if marker else []
pkgrootdir = tempdir / 'test-setup'