diff --git a/test/functional/conftest.py b/test/functional/conftest.py index 0e8f78aa..bce73895 100644 --- a/test/functional/conftest.py +++ b/test/functional/conftest.py @@ -61,7 +61,8 @@ def _run_command(args: List[str], check: bool = False): Returns: subprocess.CompletedProcess instance """ - cmd = [sys.executable, "-m", "nodescraper.cli.cli"] + args + # -W: avoid runpy RuntimeWarning when nodescraper.cli was imported before -m nodescraper.cli.cli + cmd = [sys.executable, "-W", "ignore::RuntimeWarning", "-m", "nodescraper.cli.cli"] + args return subprocess.run( cmd, capture_output=True, diff --git a/test/functional/test_cli_describe.py b/test/functional/test_cli_describe.py index 42df5596..502bbe85 100644 --- a/test/functional/test_cli_describe.py +++ b/test/functional/test_cli_describe.py @@ -30,7 +30,7 @@ def test_describe_command_list_plugins(run_cli_command): """Test that describe command can list all plugins.""" - result = run_cli_command(["describe", "plugin"]) + result = run_cli_command(["--log-path", "None", "describe", "plugin"]) assert result.returncode == 0 assert len(result.stdout) > 0 @@ -40,7 +40,7 @@ def test_describe_command_list_plugins(run_cli_command): def test_describe_command_single_plugin(run_cli_command): """Test that describe command can describe a single plugin.""" - result = run_cli_command(["describe", "plugin", "BiosPlugin"]) + result = run_cli_command(["--log-path", "None", "describe", "plugin", "BiosPlugin"]) assert result.returncode == 0 assert len(result.stdout) > 0 @@ -50,7 +50,7 @@ def test_describe_command_single_plugin(run_cli_command): def test_describe_invalid_plugin(run_cli_command): """Test that describe command handles invalid plugin gracefully.""" - result = run_cli_command(["describe", "plugin", "NonExistentPlugin"]) + result = run_cli_command(["--log-path", "None", "describe", "plugin", "NonExistentPlugin"]) assert result.returncode != 0 output = (result.stdout + result.stderr).lower()