MCPcopy Create free account
hub / github.com/theskumar/python-dotenv / test_load_dotenv_in_current_dir

Function test_load_dotenv_in_current_dir

tests/test_main.py:341–356  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

339
340
341def test_load_dotenv_in_current_dir(tmp_path):
342 dotenv_path = tmp_path / '.env'
343 dotenv_path.write_bytes(b'a=b')
344 code_path = tmp_path / 'code.py'
345 code_path.write_text(textwrap.dedent("""
346 import dotenv
347 import os
348
349 dotenv.load_dotenv(verbose=True)
350 print(os.environ['a'])
351 """))
352 os.chdir(str(tmp_path))
353
354 result = sh.Command(sys.executable)(code_path)
355
356 assert result == 'b\n'
357
358
359def test_dotenv_values_file(dotenv_file):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected