Add note about PYTEST_ADDOPTS
This commit is contained in:
parent
6a9bf2852a
commit
4cda7093f6
|
@ -636,7 +636,15 @@ class Config:
|
||||||
|
|
||||||
@attr.s(frozen=True)
|
@attr.s(frozen=True)
|
||||||
class InvocationParams:
|
class InvocationParams:
|
||||||
"""Holds parameters passed during ``pytest.main()``"""
|
"""Holds parameters passed during ``pytest.main()``
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Currently the environment variable PYTEST_ADDOPTS is also handled by
|
||||||
|
pytest implicitly, not being part of the invocation.
|
||||||
|
|
||||||
|
Plugins accessing ``InvocationParams`` must be aware of that.
|
||||||
|
"""
|
||||||
|
|
||||||
args = attr.ib()
|
args = attr.ib()
|
||||||
plugins = attr.ib()
|
plugins = attr.ib()
|
||||||
|
|
|
@ -1199,7 +1199,7 @@ def test_config_does_not_load_blocked_plugin_from_args(testdir):
|
||||||
assert result.ret == ExitCode.USAGE_ERROR
|
assert result.ret == ExitCode.USAGE_ERROR
|
||||||
|
|
||||||
|
|
||||||
def test_invocation_arguments(testdir):
|
def test_invocation_args(testdir):
|
||||||
"""Ensure that Config.invocation_* arguments are correctly defined"""
|
"""Ensure that Config.invocation_* arguments are correctly defined"""
|
||||||
|
|
||||||
class DummyPlugin:
|
class DummyPlugin:
|
||||||
|
@ -1214,7 +1214,7 @@ def test_invocation_arguments(testdir):
|
||||||
config = call.item.config
|
config = call.item.config
|
||||||
|
|
||||||
assert config.invocation_params.args == [p, "-v"]
|
assert config.invocation_params.args == [p, "-v"]
|
||||||
assert config.invocation_params.dir == Path(testdir.tmpdir)
|
assert config.invocation_params.dir == Path(str(testdir.tmpdir))
|
||||||
|
|
||||||
plugins = config.invocation_params.plugins
|
plugins = config.invocation_params.plugins
|
||||||
assert len(plugins) == 2
|
assert len(plugins) == 2
|
||||||
|
|
Loading…
Reference in New Issue