@@ -288,6 +288,7 @@ def test_run_with_command_flags(dotenv_path):
288288 assert result .returncode == 0
289289 assert result .stdout .strip () == "--version"
290290
291+
291292def test_run_with_dotenv_and_command_flags (cli , dotenv_path ):
292293 """
293294 Check that dotenv flags supersede command flags.
@@ -305,15 +306,21 @@ def test_run_with_dotenv_and_command_flags(cli, dotenv_path):
305306@pytest .mark .parametrize (
306307 "files,file_contents,expected" ,
307308 (
308- (['.env' ], ['a=1' ], {"a" : "1" }),
309- (['.env' , '.env.secondary' ], ['a=1' , 'b=2' ], {"a" : "1" , "b" : "2" }),
310- (['.env' , '.env.secondary' , '.env.extra' ], ['a=1' , 'a=3\n b=2' , 'a=5\n c=3' ], {"a" : "5" , "b" : "2" , "c" : "3" }),
309+ ([".env" ], ["a=1" ], {"a" : "1" }),
310+ ([".env" , ".env.secondary" ], ["a=1" , "b=2" ], {"a" : "1" , "b" : "2" }),
311+ (
312+ [".env" , ".env.secondary" , ".env.extra" ],
313+ ["a=1" , "a=3\n b=2" , "a=5\n c=3" ],
314+ {"a" : "5" , "b" : "2" , "c" : "3" },
315+ ),
311316 ),
312317)
313- def test_run_with_multiple_env_files (tmp_path , files : Sequence [str ], file_contents : Sequence [str ], expected : dict ):
318+ def test_run_with_multiple_env_files (
319+ tmp_path , files : Sequence [str ], file_contents : Sequence [str ], expected : dict
320+ ):
314321 """
315322 Test loading variables from two separate env files using file arguments.
316-
323+
317324 This demonstrates the pattern shown in the README where multiple env files
318325 are loaded (e.g., .env.shared and .env.secret) and all variables from both
319326 files are accessible.
@@ -327,4 +334,3 @@ def test_run_with_multiple_env_files(tmp_path, files: Sequence[str], file_conten
327334 for key , value in expected .items ():
328335 result = invoke_sub ([* file_args , "run" , "printenv" , key ])
329336 assert result .stdout .strip () == value
330-
0 commit comments