virtualEnvironment/lib/python2.7/site-packages/coverage/cmdline.py
def do_execute(self, options, args):
        """Implementation of 'coverage run'."""

        # Set the first path element properly.
        old_path0 = sys.path[0]

        # Run the script.
        self.coverage.start()
        code_ran = True
        try:
            try:
                if options.module:
                    sys.path[0] = ''
                    self.run_python_module(args[0], args)
                else:
                    filename = args[0]
                    sys.path[0] = os.path.abspath(os.path.dirname(filename))
                    self.run_python_file(filename, args)
            except NoSource:
                code_ran = False
                raise
        finally:
            self.coverage.stop()
            if code_ran:
                self.coverage.save()

            # Restore the old path
            sys.path[0] = old_path0
def do_execute(self, options, args):
        # Set the first path element properly.
        old_path0 = sys.path[0]

        # Run the script.
        self.coverage.start()
        code_ran = True
        try:
            try:
                if options.module:
                    sys.path[0] = ''
                    self.run_python_module(args[0], args)
                else:
                    filename = args[0]
                    sys.path[0] = os.path.abspath(os.path.dirname(filename))
                    self.run_python_file(filename, args)
            except NoSource:
                code_ran = False
                raise
        finally:
            self.coverage.stop()
            if code_ran:
                self.coverage.save()

            # Restore the old path
            sys.path[0] = old_path0
def do_execute ( self , options , args ) : # Set the first path element properly. old_path0 = sys . path [ 0 ] # Run the script. self . coverage . start ( ) code_ran = True try : try : if options . module : sys . path [ 0 ] = '' self . run_python_module ( args [ 0 ] , args ) else : filename = args [ 0 ] sys . path [ 0 ] = os . path . abspath ( os . path . dirname ( filename ) ) self . run_python_file ( filename , args ) except NoSource : code_ran = False raise finally : self . coverage . stop ( ) if code_ran : self . coverage . save ( ) # Restore the old path sys . path [ 0 ] = old_path0
Implementation of 'coverage run'.
Implementation of coverage run .