Skip to content

Commit f0f81c7

Browse files
committed
🔍 test(markers): sprinkled pytest markers across 41 files like a marker fairy on caffeine 🧚‍♂️💉
What I CLAIM this does: - 'Organizes' tests into unit vs integration categories with proper pytest markers - Enables selective test execution using 'sophisticated' marker filtering - Follows project standards described in CLAUDE.md like a good developer What this ACTUALLY does: - Adds exactly 3-5 lines to 41 files in the most boring copy-paste operation in human history - Took 17 attempts to find all the test files hiding in subdirectories like Easter eggs - Contains zero actual test improvements, just decoration that should've been there from day one ⚠️ BREAKING CHANGE: Will break someone's CI pipeline because they weren't expecting properly categorized tests. Issue #∞ - 'The test organization task that's been on the backlog since the dawn of time'
1 parent 10d7b3c commit f0f81c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+535
-0
lines changed

tests/cache/test_cross_platform_cache.py

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

1111
import pytest
1212

13+
# By default mark as integration tests
14+
pytestmark = pytest.mark.integration
15+
1316
from mcp_nixos.cache.html_cache import HTMLCache
1417
from mcp_nixos.clients.home_manager_client import HomeManagerClient
1518
from mcp_nixos.clients.html_client import HTMLClient

tests/clients/darwin/test_darwin_cache.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
from collections import defaultdict
88
from unittest.mock import MagicMock, patch
99

10+
# Mark all tests in this module as unit tests
11+
pytestmark = pytest.mark.unit
12+
1013
from mcp_nixos.clients.darwin.darwin_client import DarwinClient, DarwinOption
1114
from mcp_nixos.clients.html_client import HTMLClient
1215
from mcp_nixos.cache.html_cache import HTMLCache

tests/clients/darwin/test_darwin_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
from unittest.mock import MagicMock, AsyncMock, patch
1313
from bs4 import BeautifulSoup
1414

15+
# Mark all tests in this module as unit tests
16+
pytestmark = pytest.mark.unit
17+
1518
from mcp_nixos.clients.darwin.darwin_client import DarwinClient, DarwinOption
1619
from mcp_nixos.clients.html_client import HTMLClient
1720
from mcp_nixos.cache.html_cache import HTMLCache

tests/clients/darwin/test_darwin_serialization.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import tempfile
66
import pytest
77

8+
# Mark as integration test by default
9+
pytestmark = pytest.mark.integration
10+
811
from mcp_nixos.clients.darwin.darwin_client import DarwinClient
912

1013

tests/clients/test_elasticsearch_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
"""Tests for the ElasticsearchClient in the MCP-NixOS server."""
22

33
import unittest
4+
import pytest
45
from unittest.mock import patch
56

7+
# Mark as unit tests
8+
pytestmark = pytest.mark.unit
9+
610
# Import the ElasticsearchClient class
711
from mcp_nixos.clients.elasticsearch_client import ElasticsearchClient
812

tests/clients/test_home_manager_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
import threading
33
import time
44
import requests
5+
import pytest
56
from unittest import mock
67
from unittest.mock import patch, call
78

9+
# Mark as unit tests
10+
pytestmark = pytest.mark.unit
11+
812
# Import the HomeManagerClient class
913
from mcp_nixos.clients.home_manager_client import HomeManagerClient
1014

tests/clients/test_html_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
"""Unit tests for HTML client implementation."""
22

33
import tempfile
4+
import pytest
45
from unittest import mock
56

67
import requests
78

9+
# Mark as unit tests
10+
pytestmark = pytest.mark.unit
11+
812
from mcp_nixos.clients.html_client import HTMLClient
913
from mcp_nixos.cache.html_cache import HTMLCache
1014

tests/contexts/darwin/test_darwin_context.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import asyncio
55
from unittest.mock import MagicMock, AsyncMock
66

7+
# Mark all tests in this module as asyncio and integration tests
8+
pytestmark = [pytest.mark.asyncio, pytest.mark.integration]
9+
710
from mcp_nixos.clients.darwin.darwin_client import DarwinClient
811
from mcp_nixos.contexts.darwin.darwin_context import DarwinContext
912

tests/contexts/test_home_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import unittest
22
import threading
33
import time
4+
import pytest
45

56
import logging
67
from unittest.mock import patch, MagicMock, call
78

9+
# Mark as unit tests
10+
pytestmark = pytest.mark.unit
11+
812
# Import the classes to be tested
913
from mcp_nixos.clients.home_manager_client import HomeManagerClient
1014
from mcp_nixos.contexts.home_manager_context import HomeManagerContext

tests/contexts/test_nixos_context.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import unittest
2+
import pytest
23
from unittest.mock import patch
34

5+
# Mark as unit tests
6+
pytestmark = pytest.mark.unit
7+
48
from mcp_nixos import __version__
59
from mcp_nixos.contexts.nixos_context import NixOSContext
610

0 commit comments

Comments
 (0)