@@ -21,8 +21,10 @@ def test_load_eps_by_group_with_python312():
2121 mock_ep2 .name = "test-ep2"
2222 mock_eps = [mock_ep1 , mock_ep2 ]
2323
24- with patch ('mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS' , True ):
25- with patch ('mxdev.entry_points.entry_points' , return_value = mock_eps ) as mock_entry_points :
24+ with patch ("mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS" , True ):
25+ with patch (
26+ "mxdev.entry_points.entry_points" , return_value = mock_eps
27+ ) as mock_entry_points :
2628 result = load_eps_by_group ("test-group" )
2729
2830 # Should call entry_points with group parameter
@@ -43,13 +45,12 @@ def test_load_eps_by_group_with_old_python():
4345 mock_ep2 = MagicMock ()
4446 mock_ep2 .name = "test-ep2"
4547
46- mock_eps_dict = {
47- "test-group" : [mock_ep1 , mock_ep2 ],
48- "other-group" : []
49- }
48+ mock_eps_dict = {"test-group" : [mock_ep1 , mock_ep2 ], "other-group" : []}
5049
51- with patch ('mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS' , False ):
52- with patch ('mxdev.entry_points.entry_points' , return_value = mock_eps_dict ) as mock_entry_points :
50+ with patch ("mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS" , False ):
51+ with patch (
52+ "mxdev.entry_points.entry_points" , return_value = mock_eps_dict
53+ ) as mock_entry_points :
5354 result = load_eps_by_group ("test-group" )
5455
5556 # Should call entry_points without parameters
@@ -64,12 +65,10 @@ def test_load_eps_by_group_group_not_found():
6465 """Test load_eps_by_group when group doesn't exist (old Python API)."""
6566 from mxdev .entry_points import load_eps_by_group
6667
67- mock_eps_dict = {
68- "other-group" : []
69- }
68+ mock_eps_dict = {"other-group" : []}
7069
71- with patch (' mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS' , False ):
72- with patch (' mxdev.entry_points.entry_points' , return_value = mock_eps_dict ):
70+ with patch (" mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS" , False ):
71+ with patch (" mxdev.entry_points.entry_points" , return_value = mock_eps_dict ):
7372 result = load_eps_by_group ("nonexistent-group" )
7473
7574 # Should return empty list when group not found
@@ -87,8 +86,8 @@ def test_load_eps_by_group_deduplicates():
8786 mock_ep .__hash__ = lambda self : hash ("test-ep" )
8887 mock_eps = [mock_ep , mock_ep ] # Duplicate
8988
90- with patch (' mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS' , True ):
91- with patch (' mxdev.entry_points.entry_points' , return_value = mock_eps ):
89+ with patch (" mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS" , True ):
90+ with patch (" mxdev.entry_points.entry_points" , return_value = mock_eps ):
9291 result = load_eps_by_group ("test-group" )
9392
9493 # Should deduplicate - only one entry
@@ -100,8 +99,8 @@ def test_load_eps_by_group_empty_group():
10099 """Test load_eps_by_group with empty group results."""
101100 from mxdev .entry_points import load_eps_by_group
102101
103- with patch (' mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS' , True ):
104- with patch (' mxdev.entry_points.entry_points' , return_value = []):
102+ with patch (" mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS" , True ):
103+ with patch (" mxdev.entry_points.entry_points" , return_value = []):
105104 result = load_eps_by_group ("empty-group" )
106105
107106 # Should return empty list
@@ -112,12 +111,10 @@ def test_load_eps_by_group_old_python_empty_group():
112111 """Test load_eps_by_group with empty group on old Python API."""
113112 from mxdev .entry_points import load_eps_by_group
114113
115- mock_eps_dict = {
116- "test-group" : []
117- }
114+ mock_eps_dict = {"test-group" : []}
118115
119- with patch (' mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS' , False ):
120- with patch (' mxdev.entry_points.entry_points' , return_value = mock_eps_dict ):
116+ with patch (" mxdev.entry_points.HAS_IMPORTLIB_ENTRYPOINTS" , False ):
117+ with patch (" mxdev.entry_points.entry_points" , return_value = mock_eps_dict ):
121118 result = load_eps_by_group ("test-group" )
122119
123120 # Should return empty list
0 commit comments