@@ -241,7 +241,7 @@ def test_parse_spec_error(self, version_text):
241241 environments .pixi .parse_spec ("package" , version_text )
242242
243243 @pytest .mark .parametrize (
244- ["data" , "expected_specs" , "expected_warnings" ],
244+ ["data" , "path" , " expected_specs" , "expected_warnings" ],
245245 (
246246 pytest .param (
247247 textwrap .dedent (
@@ -257,6 +257,7 @@ def test_parse_spec_error(self, version_text):
257257 env1 = { features = ["feature1"] }
258258 """ .rstrip ()
259259 ),
260+ "pixi.toml" ,
260261 [
261262 Spec ("a" , Version ("1.0" )),
262263 Spec ("b" , Version ("2.2" )),
@@ -279,6 +280,7 @@ def test_parse_spec_error(self, version_text):
279280 env1 = { features = ["feature1"], no-default-feature = true }
280281 """ .rstrip ()
281282 ),
283+ "pixi.toml" ,
282284 [Spec ("c" , Version ("3.1" ))],
283285 [("c" , [])],
284286 id = "no-default-feature" ,
@@ -293,21 +295,37 @@ def test_parse_spec_error(self, version_text):
293295 env1 = { features = [] }
294296 """ .rstrip ()
295297 ),
298+ "pixi.toml" ,
296299 [Spec ("a" , Version ("1.0" ))],
297300 [("a" , [])],
298301 id = "missing-features" ,
299302 ),
303+ pytest .param (
304+ textwrap .dedent (
305+ """\
306+ [tool.pixi.feature.feature1.dependencies]
307+ c = "3.1.*"
308+
309+ [tool.pixi.environments]
310+ env1 = { features = ["feature1"], no-default-feature = true }
311+ """ .rstrip ()
312+ ),
313+ "pyproject.toml" ,
314+ [Spec ("c" , Version ("3.1" ))],
315+ [("c" , [])],
316+ id = "pyproject" ,
317+ ),
300318 ),
301319 )
302320 def test_parse_pixi_environment (
303- self , monkeypatch , data , expected_specs , expected_warnings
321+ self , monkeypatch , path , data , expected_specs , expected_warnings
304322 ):
305323 monkeypatch .setattr (
306324 pathlib .Path , "open" , lambda _ , mode : io .BytesIO (data .encode ())
307325 )
308326
309327 name = "env1"
310- manifest_path = pathlib .Path ("pixi.toml" )
328+ manifest_path = pathlib .Path (path )
311329
312330 actual_specs , actual_warnings = environments .pixi .parse_pixi_environment (
313331 name , manifest_path
0 commit comments