Fix #2937: Ensure the consistency in load_dotenv's return type
This commit is contained in:
parent
d9fa28ba68
commit
db8cb31f2b
3 changed files with 19 additions and 3 deletions
|
|
@ -513,7 +513,7 @@ def test_load_dotenv(monkeypatch):
|
|||
|
||||
monkeypatch.setenv("EGGS", "3")
|
||||
monkeypatch.chdir(os.path.join(test_path, "cliapp", "inner1"))
|
||||
load_dotenv()
|
||||
assert load_dotenv()
|
||||
assert os.getcwd() == test_path
|
||||
# .flaskenv doesn't overwrite .env
|
||||
assert os.environ["FOO"] == "env"
|
||||
|
|
@ -524,6 +524,9 @@ def test_load_dotenv(monkeypatch):
|
|||
# set manually, files don't overwrite
|
||||
assert os.environ["EGGS"] == "3"
|
||||
|
||||
# Non existent file should not load
|
||||
assert not load_dotenv('non-existent-file')
|
||||
|
||||
|
||||
@need_dotenv
|
||||
def test_dotenv_path(monkeypatch):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue