File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change 1010@pytest .fixture
1111def dotenv_file (tempdir : Path ) -> Generator [Path ]:
1212 path = tempdir / "dotenv"
13- path .write_text (
14- "AWS_ACCESS_KEY_ID=example_access_key\n "
15- "AWS_SECRET_ACCESS_KEY=example_secret_key\n "
16- "AWS_S3_ENDPOINT_URL=http://example.com\n "
17- )
13+ path .write_text ("POSTGRES_USER=test\n POSTGRES_PASSWORD=pass\n " )
1814 yield path
1915 path .unlink (missing_ok = True )
2016
2117
22- def test_environ (dotenv_file : Path , monkeypatch : pytest . MonkeyPatch ):
18+ def test_environ (dotenv_file : Path ):
2319 environ = Environ (
2420 POSTGRES_USER = "user" ,
2521 _env_file = dotenv_file , # type: ignore
2622 )
2723 assert environ .POSTGRES_USER == "user"
28- assert isinstance (environ .AWS_ACCESS_KEY_ID , SecretStr )
29- assert isinstance (environ .AWS_SECRET_ACCESS_KEY , SecretStr )
30- assert (
31- environ .AWS_SECRET_ACCESS_KEY .get_secret_value ()
32- == "example_secret_key"
33- )
34- assert environ .AWS_S3_ENDPOINT_URL == "http://example.com"
35- assert environ .AWS_ACCESS_KEY_ID .get_secret_value () == "example_access_key"
24+ assert isinstance (environ .POSTGRES_PASSWORD , SecretStr )
25+ assert environ .POSTGRES_PASSWORD .get_secret_value () == "pass"
3626
3727 assert environ .model_dump () == {}
You can’t perform that action at this time.
0 commit comments