Check for the project ID env var before warning about missing project ID (#227)

* Check for project_id envvar before warning

Resolves GoogleCloudPlatform/google-auth-library-python#221

* Add missed env check and fix line length

* Remove redundant missing-project log statements

* Add _default.default() test without project_id

* Fix line length
diff --git a/tests/test__default.py b/tests/test__default.py
index 2df8a44..68c4fb0 100644
--- a/tests/test__default.py
+++ b/tests/test__default.py
@@ -302,6 +302,28 @@
 
 
 @mock.patch(
+    'logging.Logger.warning',
+    autospec=True)
+@mock.patch(
+    'google.auth._default._get_explicit_environ_credentials',
+    return_value=(mock.sentinel.credentials, None), autospec=True)
+@mock.patch(
+    'google.auth._default._get_gcloud_sdk_credentials',
+    return_value=(mock.sentinel.credentials, None), autospec=True)
+@mock.patch(
+    'google.auth._default._get_gae_credentials',
+    return_value=(mock.sentinel.credentials, None), autospec=True)
+@mock.patch(
+    'google.auth._default._get_gce_credentials',
+    return_value=(mock.sentinel.credentials, None), autospec=True)
+def test_default_without_project_id(
+        unused_gce, unused_gae, unused_sdk, unused_explicit, logger_warning):
+    assert _default.default() == (
+        mock.sentinel.credentials, None)
+    logger_warning.assert_called_with(mock.ANY, mock.ANY, mock.ANY)
+
+
+@mock.patch(
     'google.auth._default._get_explicit_environ_credentials',
     return_value=(None, None), autospec=True)
 @mock.patch(
@@ -324,7 +346,7 @@
     autospec=True)
 @mock.patch(
     'google.auth.credentials.with_scopes_if_required', autospec=True)
-def test_default_scoped(with_scopes, get):
+def test_default_scoped(with_scopes, unused_get):
     scopes = ['one', 'two']
 
     credentials, project_id = _default.default(scopes=scopes)