File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 2828ENVIRON_ERROR_MSG = """\
2929 To run the system tests, you need to set some environment variables.
3030Please check the CONTRIBUTING guide for instructions.
31-
32- Missing variables: %s
3331"""
3432
3533
@@ -47,15 +45,24 @@ def create_scoped_required():
4745
4846def check_environ ():
4947 missing = []
48+ extra = ''
5049
5150 if PROJECT_ID is None :
5251 missing .append (TESTS_PROJECT )
5352
54- if CREDENTIALS is None or not os . path . isfile ( CREDENTIALS ) :
53+ if CREDENTIALS is None :
5554 missing .append (TEST_CREDENTIALS )
56-
57- if missing :
58- print (ENVIRON_ERROR_MSG % ', ' .join (missing ), file = sys .stderr )
55+ elif not os .path .isfile (CREDENTIALS ):
56+ extra = '\n The %s path %r is not a file.' % (TEST_CREDENTIALS ,
57+ CREDENTIALS )
58+
59+ if missing or extra :
60+ msg = ENVIRON_ERROR_MSG
61+ if missing :
62+ msg += '\n Missing variables: ' + ', ' .join (missing )
63+ if extra :
64+ msg += extra
65+ print (msg , file = sys .stderr )
5966 sys .exit (1 )
6067
6168
You can’t perform that action at this time.
0 commit comments