import os
import sys

from coalib.tests.TestHelper import TestHelper


def show_help():
    print("Usage: {name} [OPTIONS]".format(name=sys.argv[0]))
    print()
    print("--help  : Show this help text")
    print("--cover : Use coverage to get statement and branch coverage of tests")


if __name__ == '__main__':
    use_coverage = False
    for arg in sys.argv[1:]:
        arg = str(arg).strip().lower()
        if arg == "--cover" and not use_coverage:
            use_coverage = True
        else:
            show_help()
            exit()

    test_dir = os.path.abspath("coalib/tests")
    files = TestHelper.get_test_files(test_dir)
    exit(TestHelper.execute_python3_files(files, use_coverage))

import os
import sys

from coalib.tests.TestHelper import TestHelper


def show_help():
    print("Usage: {name} [OPTIONS]".format(name=sys.argv[0]))
    print()
    print("--help  : Show this help text")
    print("--cover : Use coverage to get statement and branch coverage of tests")


if __name__ == '__main__':
    use_coverage = False
    for arg in sys.argv[1:]:
        arg = str(arg).strip().lower()
        if arg == "--cover" and not use_coverage:
            use_coverage = True
        else:
            show_help()
            exit()

    files = TestHelper.get_test_files(os.path.abspath("coalib/tests"))
    exit(TestHelper.execute_python3_files(files, use_coverage))

Test execution: Remove unneeded variable
Test execution: Remove unneeded variable

  import os
  import sys
  
  from coalib.tests.TestHelper import TestHelper
  
  
  def show_help():
      print("Usage: {name} [OPTIONS]".format(name=sys.argv[0]))
      print()
      print("--help  : Show this help text")
      print("--cover : Use coverage to get statement and branch coverage of tests")
  
  
  if __name__ == '__main__':
      use_coverage = False
      for arg in sys.argv[1:]:
          arg = str(arg).strip().lower()
          if arg == "--cover" and not use_coverage:
              use_coverage = True
          else:
              show_help()
              exit()
  
+     files = TestHelper.get_test_files(os.path.abspath("coalib/tests"))
-     test_dir = os.path.abspath("coalib/tests")
-     files = TestHelper.get_test_files(test_dir)
      exit(TestHelper.execute_python3_files(files, use_coverage))
  
Test execution: Remove unneeded variable
## Code Before:
import os
import sys

from coalib.tests.TestHelper import TestHelper


def show_help():
    print("Usage: {name} [OPTIONS]".format(name=sys.argv[0]))
    print()
    print("--help  : Show this help text")
    print("--cover : Use coverage to get statement and branch coverage of tests")


if __name__ == '__main__':
    use_coverage = False
    for arg in sys.argv[1:]:
        arg = str(arg).strip().lower()
        if arg == "--cover" and not use_coverage:
            use_coverage = True
        else:
            show_help()
            exit()

    test_dir = os.path.abspath("coalib/tests")
    files = TestHelper.get_test_files(test_dir)
    exit(TestHelper.execute_python3_files(files, use_coverage))

## Instruction:
Test execution: Remove unneeded variable
## Code After:
import os
import sys

from coalib.tests.TestHelper import TestHelper


def show_help():
    print("Usage: {name} [OPTIONS]".format(name=sys.argv[0]))
    print()
    print("--help  : Show this help text")
    print("--cover : Use coverage to get statement and branch coverage of tests")


if __name__ == '__main__':
    use_coverage = False
    for arg in sys.argv[1:]:
        arg = str(arg).strip().lower()
        if arg == "--cover" and not use_coverage:
            use_coverage = True
        else:
            show_help()
            exit()

    files = TestHelper.get_test_files(os.path.abspath("coalib/tests"))
    exit(TestHelper.execute_python3_files(files, use_coverage))
