summaryrefslogtreecommitdiff
path: root/tests/plugin/test_inline.py
blob: 170743a1784efbc7f3a170121a76a807439f136a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pytest

from tox.pytest import ToxProjectCreator


@pytest.mark.plugin_test()
def test_inline_tox_py(tox_project: ToxProjectCreator) -> None:
    ini = """
    from tox.plugin import impl
    @impl
    def tox_add_option(parser):
        parser.add_argument("--magic", action="store_true")
    """
    project = tox_project({"toxfile.py": ini})
    result = project.run("-h")
    result.assert_success()
    assert "--magic" in result.out