@@ -45,19 +45,6 @@ def test_init_with_bargaining_task(self, sample_bargaining_task_data: Dict[str,
4545
4646 assert env .domain == "bargaining"
4747
48- def test_init_raises_without_marble (self , sample_research_task_data : Dict [str , Any ]):
49- """Constructor should raise ImportError when MARBLE is not available."""
50- marble_modules = {k : v for k , v in sys .modules .items () if "marble" in k }
51- for module_name in marble_modules :
52- sys .modules .pop (module_name , None )
53-
54- try :
55- with patch .dict ("sys.modules" , {"marble.environments.base_env" : None }):
56- with pytest .raises (ImportError , match = "MARBLE is not available" ):
57- MultiAgentBenchEnvironment (task_data = sample_research_task_data )
58- finally :
59- sys .modules .update (marble_modules )
60-
6148 def test_setup_state_extracts_domain (self , sample_research_task_data : Dict [str , Any ]):
6249 """setup_state should extract domain from task data."""
6350 env = MultiAgentBenchEnvironment (task_data = sample_research_task_data )
@@ -102,8 +89,31 @@ def test_gather_config_includes_domain(self, sample_research_task_data: Dict[str
10289 assert config ["domain" ] == "research"
10390 assert "tool_descriptions" in config
10491
92+
93+ class TestMultiAgentBenchEnvironmentRealMarble :
94+ """Tests that need the real _create_marble_environment (no mock)."""
95+
96+ @pytest .fixture (autouse = True )
97+ def _mock_marble_environment (self ):
98+ """Override: let these tests use real marble imports."""
99+ yield
100+
101+ def test_init_raises_without_marble (self , sample_research_task_data : Dict [str , Any ]):
102+ """Constructor should raise ImportError when MARBLE is not available."""
103+ marble_modules = {k : v for k , v in sys .modules .items () if "marble" in k }
104+ for module_name in marble_modules :
105+ sys .modules .pop (module_name , None )
106+
107+ try :
108+ with patch .dict ("sys.modules" , {"marble.environments.base_env" : None }):
109+ with pytest .raises (ImportError , match = "MARBLE is not available" ):
110+ MultiAgentBenchEnvironment (task_data = sample_research_task_data )
111+ finally :
112+ sys .modules .update (marble_modules )
113+
114+ @pytest .mark .live
105115 def test_marble_env_type_in_state (self , sample_research_task_data : Dict [str , Any ]):
106- """setup_state should include MARBLE env type."""
116+ """setup_state should include MARBLE env type (needs real marble) ."""
107117 env = MultiAgentBenchEnvironment (task_data = sample_research_task_data )
108118
109119 assert env .state ["marble_env_type" ] == "ResearchEnvironment"
0 commit comments