Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ homepage = "https://github.com/ansible/ansible-dev-tools"
repository = "https://github.com/ansible/ansible-dev-tools"

[project.scripts]
adt = "ansible_dev_tools.cli:main"
adt = "ansible_dev_tools.__main__:main"

[project.optional-dependencies]
container = ["ansible-pylibssh==1.3.0; platform_system == 'Linux'"]
Expand Down Expand Up @@ -401,6 +401,9 @@ addopts = [
"-ra"
]
cache_dir = "./.cache/.pytest"
filterwarnings = [
"error",
]
junit_family = "xunit2" # see https://docs.codecov.com/docs/test-analytics
log_cli = true
log_cli_level = "WARNING"
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_dev_tools/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
from .cli import main


if __name__ == "__main__":
if __name__ == "__main__": # pragma: no cover
main()
4 changes: 0 additions & 4 deletions src/ansible_dev_tools/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,3 @@ def main() -> None:
cli = Cli()
cli.parse_args()
cli.run()


if __name__ == "__main__":
main()
2 changes: 0 additions & 2 deletions src/ansible_dev_tools/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
import pytest
import requests

import ansible_dev_tools # noqa: F401

from ansible_dev_tools.subcommands.server import Server


Expand Down
11 changes: 0 additions & 11 deletions src/ansible_dev_tools/tests/unit/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,3 @@ def test_main() -> None:
runpy.run_module("ansible_dev_tools.__main__", run_name="__main__")
expected_error_code = 2
assert exc.value.code == expected_error_code


def test_cli_main() -> None:
"""Test the main entry point.

Gives an error message due to missing subcommand.
"""
with pytest.raises(SystemExit) as exc:
runpy.run_module("ansible_dev_tools.cli", run_name="__main__")
expected_error_code = 2
assert exc.value.code == expected_error_code
Loading