Skip to content

Commit

Permalink
Revert "Add the ability to use env variable pointing to a .env file (#…
Browse files Browse the repository at this point in the history
…242)" (#326)

This reverts commit e04667c.
  • Loading branch information
sergeyklay authored Sep 7, 2021
1 parent 770e968 commit e231891
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
1 change: 0 additions & 1 deletion environ/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,6 @@ def read_env(cls, env_file=None, **overrides):
os.path.dirname(frame.f_back.f_code.co_filename),
'.env'
)
env_file = os.environ.get('ENV_FILE') or env_file
if not os.path.exists(env_file):
logger.info(
"%s doesn't exist - if you're not configuring your "
Expand Down
15 changes: 0 additions & 15 deletions tests/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,18 +351,3 @@ class MyEnv(Env):

def test_singleton_environ(self):
assert self.CONFIG is self.env.ENVIRON


class FileEnvByEnvVarTests(TestEnv):

def setup_method(self, method):
super(FileEnvByEnvVarTests, self).setUp()
with open('./tmp/test_env.txt') as env_file:
env_file.writeline('VAR=TEST')
Env.ENVIRON = {}
os.environ['ENV_FILE'] = './tmp/test_env.txt'
self.env = Env()

def test_read_env(self):
assert_type_and_value(str, 'TEST', self.env('VAR'))

0 comments on commit e231891

Please sign in to comment.