Skip to content

Commit f3efa2f

Browse files
committed
CLI-15: Add executor markers to subprocess tests
- Mark subprocess executor tests with @pytest.mark.executor - Add @pytest.mark.slow to long-running integration tests - Ensure proper test categorization
1 parent b61fae1 commit f3efa2f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/integration/test_subprocess_executor.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from cli_patterns.execution.subprocess_executor import SubprocessExecutor
1414
from cli_patterns.ui.design.registry import theme_registry
1515

16+
pytestmark = pytest.mark.executor
17+
1618

1719
class TestSubprocessExecutorIntegration:
1820
"""Integration tests for SubprocessExecutor with real commands."""
@@ -98,6 +100,7 @@ async def test_exit_codes(self, executor):
98100
assert result.exit_code == 42
99101

100102
@pytest.mark.asyncio
103+
@pytest.mark.slow
101104
async def test_timeout(self, executor):
102105
"""Test command timeout."""
103106
# Use Python sleep to ensure cross-platform compatibility
@@ -135,6 +138,7 @@ async def test_environment_variables(self, executor):
135138
assert "test_value" in result.stdout
136139

137140
@pytest.mark.asyncio
141+
@pytest.mark.slow
138142
async def test_large_output(self, executor):
139143
"""Test command with large output."""
140144
# Generate 1000 lines of output
@@ -149,6 +153,7 @@ async def test_large_output(self, executor):
149153
assert lines[-1] == "Line 999"
150154

151155
@pytest.mark.asyncio
156+
@pytest.mark.slow
152157
async def test_concurrent_execution(self, executor):
153158
"""Test running multiple commands concurrently."""
154159
tasks = [
@@ -165,6 +170,7 @@ async def test_concurrent_execution(self, executor):
165170
assert "Command 3" in results[2].stdout
166171

167172
@pytest.mark.asyncio
173+
@pytest.mark.slow
168174
async def test_streaming_output(self):
169175
"""Test output streaming in real-time."""
170176
console = Console(force_terminal=True, width=80, no_color=True)

tests/unit/execution/test_subprocess_executor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
from cli_patterns.execution.subprocess_executor import CommandResult, SubprocessExecutor
1212

13+
pytestmark = pytest.mark.executor
14+
1315

1416
class TestCommandResult:
1517
"""Test CommandResult class."""
@@ -138,6 +140,7 @@ async def test_permission_denied(self, executor, console):
138140
assert console.print.called
139141

140142
@pytest.mark.asyncio
143+
@pytest.mark.slow
141144
async def test_timeout(self, executor, console):
142145
"""Test command timeout."""
143146
with patch("asyncio.create_subprocess_shell") as mock_create:

0 commit comments

Comments
 (0)