Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Commit 30b0615

Browse files
committed
test: add tests for multiple --dep flags and deprecation warning
- test_cli_dep_multiple: test multiple --dep flags (--dep numpy --dep pydantic) - test_cli_dep_and_deps_combined: test combining --dep and --deps - test_cli_deps_deprecation_warning: verify deprecation warning is emitted
1 parent afd0d05 commit 30b0615

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/test_cli.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations as _annotations
22

3+
import warnings
4+
35
import pytest
46

57
from mcp_run_python._cli import cli_logic
@@ -20,5 +22,25 @@ def test_cli_dep_repeatable():
2022
assert cli_logic(['--dep', 'numpy', 'example']) == 0
2123

2224

25+
def test_cli_dep_multiple():
26+
"""Test multiple --dep flags"""
27+
assert cli_logic(['--dep', 'numpy', '--dep', 'pydantic', 'example']) == 0
28+
29+
30+
def test_cli_dep_and_deps_combined():
31+
"""Test combining --dep and --deps (backwards compat)"""
32+
assert cli_logic(['--dep', 'numpy', '--deps', 'pydantic', 'example']) == 0
33+
34+
35+
def test_cli_deps_deprecation_warning():
36+
"""Test that --deps emits a deprecation warning"""
37+
with warnings.catch_warnings(record=True) as w:
38+
warnings.simplefilter('always')
39+
cli_logic(['--deps', 'numpy', 'example'])
40+
deprecation_warnings = [x for x in w if issubclass(x.category, DeprecationWarning)]
41+
assert len(deprecation_warnings) >= 1
42+
assert any('--deps is deprecated' in str(x.message) for x in deprecation_warnings)
43+
44+
2345
def test_cli_example_fail():
2446
assert cli_logic(['example']) == 1

0 commit comments

Comments
 (0)