diff --git a/facebook_business/test/integration_test_runner.py b/facebook_business/test/integration_test_runner.py index acad734c..1681c3cd 100755 --- a/facebook_business/test/integration_test_runner.py +++ b/facebook_business/test/integration_test_runner.py @@ -28,6 +28,7 @@ How to run: python -m facebook_business.test.integration_test_runner ''' + import os, subprocess DIRECTORY = os.path.dirname(os.path.abspath(__file__)) @@ -40,15 +41,15 @@ RUNNER = "runner" CONSTANT = "constant" -integration_tests = [] -for filename in os.listdir(DIRECTORY): - if filename.endswith(".py") \ - and filename.startswith("integration_") \ - and UTILS not in filename \ - and RUNNER not in filename \ - and CONSTANT not in filename: - integration_tests.append(filename.split(".")[0]) - +integration_tests = [ + filename.split(".")[0] + for filename in os.listdir(DIRECTORY) + if filename.endswith(".py") + and filename.startswith("integration_") + and UTILS not in filename + and RUNNER not in filename + and CONSTANT not in filename +] failed = False for test in integration_tests: diff --git a/facebook_business/test/other_docs.py b/facebook_business/test/other_docs.py index 86f50a4b..caddb7af 100644 --- a/facebook_business/test/other_docs.py +++ b/facebook_business/test/other_docs.py @@ -25,6 +25,7 @@ python -m facebook_business.test.other_docs ''' + import os import sys import json @@ -43,10 +44,8 @@ class InsightsDocsTestCase(DocsTestCase): pass if __name__ == '__main__': - handle = open(DocsDataStore.get('filename'), 'w') - handle.write('') - handle.close() - + with open(DocsDataStore.get('filename'), 'w') as handle: + handle.write('') try: config_file = open('./config.json') except IOError: