We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ffcacc9 commit f2f70deCopy full SHA for f2f70de
1 file changed
tests/test_main.py
@@ -0,0 +1,21 @@
1
+from __future__ import annotations
2
+
3
+import runpy
4
5
+from typing import TYPE_CHECKING
6
7
+import pytest
8
9
10
+if TYPE_CHECKING:
11
+ from pytest_mock import MockerFixture
12
13
14
+def test_module_entrypoint_exits_with_application_status(mocker: MockerFixture) -> None:
15
+ main_mock = mocker.patch("poetry.console.application.main", side_effect=lambda: 17)
16
17
+ with pytest.raises(SystemExit) as e:
18
+ runpy.run_module("poetry", run_name="__main__")
19
20
+ assert e.value.code == 17
21
+ assert main_mock.call_count == 1
0 commit comments