Coverage for tests\test_readin_env.py: 100%
13 statements
« prev ^ index » next coverage.py v7.3.1, created at 2023-09-18 15:57 -0400
« prev ^ index » next coverage.py v7.3.1, created at 2023-09-18 15:57 -0400
1import os
2import tempfile
4import receptiviti
7class TestEnv:
8 def test_explicit_works(self):
9 receptiviti.readin_env()
10 assert os.getenv("RECEPTIVITI_TEST") is None
11 with tempfile.NamedTemporaryFile("w", delete=False) as file:
12 file.write("RECEPTIVITI_TEST='123'\n")
13 path = file.name
14 receptiviti.readin_env(path)
15 os.unlink(path)
16 assert os.getenv("RECEPTIVITI_TEST") == "123"