(tmp_path)
| 339 | |
| 340 | |
| 341 | def 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 | |
| 359 | def test_dotenv_values_file(dotenv_file): |
nothing calls this directly
no outgoing calls
no test coverage detected