diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index b8563bd3b..fa4a0ce47 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -233,13 +233,15 @@ def get_plugin_manager(): return get_config().pluginmanager -def _prepareconfig(args=None, plugins=None): +def _prepareconfig( + args: Optional[Union[py.path.local, List[str]]] = None, plugins=None +): if args is None: args = sys.argv[1:] elif isinstance(args, py.path.local): args = [str(args)] - elif not isinstance(args, (tuple, list)): - msg = "`args` parameter expected to be a list or tuple of strings, got: {!r} (type: {})" + elif not isinstance(args, list): + msg = "`args` parameter expected to be a list of strings, got: {!r} (type: {})" raise TypeError(msg.format(args, type(args))) config = get_config(args, plugins) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index c7c16d60d..cafc87f2e 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -606,7 +606,7 @@ class TestInvocationVariants: def test_invoke_with_invalid_type(self): with pytest.raises( - TypeError, match="expected to be a list or tuple of strings, got: '-h'" + TypeError, match="expected to be a list of strings, got: '-h'" ): pytest.main("-h")