Repository: theskumar/python-dotenv

Issue:
load_dotenv() returns True even if .env file is not found
This behaviour is not ideal since if the configuration file is not found in the filesystem it may be better to return False.
In this way the user can write something like:
```python
if load_dotenv():
    #do stuff
else
    print("No file .env found")
```

# Steps to reproduce
```
In [1]: import dotenv

In [2]: dotenv.load_dotenv()
Out[2]: True

In [3]: dotenv.find_dotenv()
Out[3]: ''
```

Discussion:

Patch:
diff --git a/src/dotenv/main.py b/src/dotenv/main.py
index e7ad430..7841066 100644
--- a/src/dotenv/main.py
+++ b/src/dotenv/main.py
@@ -87,6 +87,9 @@ class DotEnv():
         """
         Load the current dotenv as system environment variable.
         """
+        if not self.dict():
+            return False
+
         for k, v in self.dict().items():
             if k in os.environ and not self.override:
                 continue
@@ -324,6 +327,8 @@ def load_dotenv(
         override: Whether to override the system environment variables with the variables
             from the `.env` file.
         encoding: Encoding to be used to read the file.
+    Returns:
+        Bool: True if atleast one environment variable is set elese False
 
     If both `dotenv_path` and `stream` are `None`, `find_dotenv()` is used to find the
     .env file.


Test patch:
diff --git a/tests/test_main.py b/tests/test_main.py
index ca14b1a..82c73ba 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -259,8 +259,9 @@ def test_load_dotenv_no_file_verbose():
     logger = logging.getLogger("dotenv.main")
 
     with mock.patch.object(logger, "info") as mock_info:
-        dotenv.load_dotenv('.does_not_exist', verbose=True)
+        result = dotenv.load_dotenv('.does_not_exist', verbose=True)
 
+    assert result is False
     mock_info.assert_called_once_with("Python-dotenv could not find configuration file %s.", ".does_not_exist")