
import os
import tempfile
from distutils.sysconfig import get_python_lib

from coalib.tests.TestHelper import TestHelper


if __name__ == '__main__':
    parser = TestHelper.create_argparser(description="Runs coalas tests.")
    parser.add_argument("-b",
                        "--ignore-bear-tests",
                        help="ignore bear tests",
                        action="store_true")
    parser.add_argument("-m",
                        "--ignore-main-tests",
                        help="ignore main program tests",
                        action="store_true")

    testhelper = TestHelper(parser)

    if not testhelper.args.ignore_main_tests:
        testhelper.add_test_files(os.path.abspath(os.path.join("coalib",
                                                               "tests")))
    if not testhelper.args.ignore_bear_tests:
        testhelper.add_test_files(os.path.abspath(os.path.join("bears",
                                                               "tests")))

    ignore_list = [
        os.path.join(tempfile.gettempdir(), "**"),
        os.path.join(get_python_lib(), "**"),
        os.path.join("coalib", "tests", "**"),
        os.path.join("bears", "tests", "**")
    ]

    exit(testhelper.execute_python3_files(ignore_list))


import os
import tempfile
from distutils.sysconfig import get_python_lib

from coalib.tests.TestHelper import TestHelper


if __name__ == '__main__':
    parser = TestHelper.create_argparser(description="Runs coalas tests.")
    parser.add_argument("-b",
                        "--ignore-bear-tests",
                        help="ignore bear tests",
                        action="store_true")
    parser.add_argument("-m",
                        "--ignore-main-tests",
                        help="ignore main program tests",
                        action="store_true")

    testhelper = TestHelper(parser)

    if not testhelper.args.ignore_main_tests:
        testhelper.add_test_files(os.path.abspath(os.path.join("coalib",
                                                               "tests")))
    if not testhelper.args.ignore_bear_tests:
        testhelper.add_test_files(os.path.abspath(os.path.join("bears",
                                                               "tests")))

    ignore_list = [
        os.path.join(tempfile.gettempdir(), "**"),
        os.path.join(os.path.dirname(get_python_lib()), "**"),
        os.path.join("coalib", "tests", "**"),
        os.path.join("bears", "tests", "**")
    ]

    exit(testhelper.execute_python3_files(ignore_list))

Update run_test.py to fix coverage
tests: Update run_test.py to fix coverage

  
  import os
  import tempfile
  from distutils.sysconfig import get_python_lib
  
  from coalib.tests.TestHelper import TestHelper
  
  
  if __name__ == '__main__':
      parser = TestHelper.create_argparser(description="Runs coalas tests.")
      parser.add_argument("-b",
                          "--ignore-bear-tests",
                          help="ignore bear tests",
                          action="store_true")
      parser.add_argument("-m",
                          "--ignore-main-tests",
                          help="ignore main program tests",
                          action="store_true")
  
      testhelper = TestHelper(parser)
  
      if not testhelper.args.ignore_main_tests:
          testhelper.add_test_files(os.path.abspath(os.path.join("coalib",
                                                                 "tests")))
      if not testhelper.args.ignore_bear_tests:
          testhelper.add_test_files(os.path.abspath(os.path.join("bears",
                                                                 "tests")))
  
      ignore_list = [
          os.path.join(tempfile.gettempdir(), "**"),
-         os.path.join(get_python_lib(), "**"),
+         os.path.join(os.path.dirname(get_python_lib()), "**"),
          os.path.join("coalib", "tests", "**"),
          os.path.join("bears", "tests", "**")
      ]
  
      exit(testhelper.execute_python3_files(ignore_list))
  
Update run_test.py to fix coverage
## Code Before:

import os
import tempfile
from distutils.sysconfig import get_python_lib

from coalib.tests.TestHelper import TestHelper


if __name__ == '__main__':
    parser = TestHelper.create_argparser(description="Runs coalas tests.")
    parser.add_argument("-b",
                        "--ignore-bear-tests",
                        help="ignore bear tests",
                        action="store_true")
    parser.add_argument("-m",
                        "--ignore-main-tests",
                        help="ignore main program tests",
                        action="store_true")

    testhelper = TestHelper(parser)

    if not testhelper.args.ignore_main_tests:
        testhelper.add_test_files(os.path.abspath(os.path.join("coalib",
                                                               "tests")))
    if not testhelper.args.ignore_bear_tests:
        testhelper.add_test_files(os.path.abspath(os.path.join("bears",
                                                               "tests")))

    ignore_list = [
        os.path.join(tempfile.gettempdir(), "**"),
        os.path.join(get_python_lib(), "**"),
        os.path.join("coalib", "tests", "**"),
        os.path.join("bears", "tests", "**")
    ]

    exit(testhelper.execute_python3_files(ignore_list))

## Instruction:
Update run_test.py to fix coverage
## Code After:

import os
import tempfile
from distutils.sysconfig import get_python_lib

from coalib.tests.TestHelper import TestHelper


if __name__ == '__main__':
    parser = TestHelper.create_argparser(description="Runs coalas tests.")
    parser.add_argument("-b",
                        "--ignore-bear-tests",
                        help="ignore bear tests",
                        action="store_true")
    parser.add_argument("-m",
                        "--ignore-main-tests",
                        help="ignore main program tests",
                        action="store_true")

    testhelper = TestHelper(parser)

    if not testhelper.args.ignore_main_tests:
        testhelper.add_test_files(os.path.abspath(os.path.join("coalib",
                                                               "tests")))
    if not testhelper.args.ignore_bear_tests:
        testhelper.add_test_files(os.path.abspath(os.path.join("bears",
                                                               "tests")))

    ignore_list = [
        os.path.join(tempfile.gettempdir(), "**"),
        os.path.join(os.path.dirname(get_python_lib()), "**"),
        os.path.join("coalib", "tests", "**"),
        os.path.join("bears", "tests", "**")
    ]

    exit(testhelper.execute_python3_files(ignore_list))
