
import sys
import os

# import argparse


class Infect(object):
    class Codes:
        symlink = {
            'success': 0,
            'target_not_found': 1,
            'destination_already_linked': 2,
            'destination_exists': 3,
        }

    def __init__(self):
        pass

    def install(self):
        pass

    def upload(self):
        pass

    def symlink(self, target, dest):
        """
        Symlink a file and its destination

        Will return a return code from `Infect.Codes.symlink`.

        """

        if not os.path.isfile(target):
            return self.Codes.symlink['target_not_found']

        if os.path.islink(dest):
            return self.Codes.symlink['destination_already_linked']

        if os.path.isfile(dest) or os.path.isdir(dest):
            return self.Codes.symlink['destination_exists']

        os.symlink(target, dest)

        return self.Codes.symlink['success']

    def uninstall(self):
        pass


def main():
    print('Running infect main()')
    return 0


if __name__ == "__main__":
    sys.exit(main())


import sys
import os

# import argparse


class Infect(object):
    class Codes:
        symlink = {
            'success': 0,
            'target_not_found': 1,
            'destination_already_linked': 2,
            'destination_exists': 3,
        }

    def __init__(self):
        pass

    def install(self):  # pragma: nocover
        pass

    def upload(self):  # pragma: nocover
        pass

    def symlink(self, target, dest):
        """
        Symlink a file and its destination

        Will return a return code from `Infect.Codes.symlink`.

        """

        if not os.path.isfile(target):
            return self.Codes.symlink['target_not_found']

        if os.path.islink(dest):
            return self.Codes.symlink['destination_already_linked']

        if os.path.isfile(dest) or os.path.isdir(dest):
            return self.Codes.symlink['destination_exists']

        os.symlink(target, dest)

        return self.Codes.symlink['success']

    def uninstall(self):  # pragma: nocover
        pass


def main():  # pragma: nocover
    print('Running infect main()')
    return 0


if __name__ == "__main__":  # pragma: nocover
    sys.exit(main())

Add pragma: nocover to non-implemented methods
Add pragma: nocover to non-implemented methods

  
  import sys
  import os
  
  # import argparse
  
  
  class Infect(object):
      class Codes:
          symlink = {
              'success': 0,
              'target_not_found': 1,
              'destination_already_linked': 2,
              'destination_exists': 3,
          }
  
      def __init__(self):
          pass
  
-     def install(self):
+     def install(self):  # pragma: nocover
          pass
  
-     def upload(self):
+     def upload(self):  # pragma: nocover
          pass
  
      def symlink(self, target, dest):
          """
          Symlink a file and its destination
  
          Will return a return code from `Infect.Codes.symlink`.
  
          """
  
          if not os.path.isfile(target):
              return self.Codes.symlink['target_not_found']
  
          if os.path.islink(dest):
              return self.Codes.symlink['destination_already_linked']
  
          if os.path.isfile(dest) or os.path.isdir(dest):
              return self.Codes.symlink['destination_exists']
  
          os.symlink(target, dest)
  
          return self.Codes.symlink['success']
  
-     def uninstall(self):
+     def uninstall(self):  # pragma: nocover
          pass
  
  
- def main():
+ def main():  # pragma: nocover
      print('Running infect main()')
      return 0
  
  
- if __name__ == "__main__":
+ if __name__ == "__main__":  # pragma: nocover
      sys.exit(main())
  
Add pragma: nocover to non-implemented methods
## Code Before:

import sys
import os

# import argparse


class Infect(object):
    class Codes:
        symlink = {
            'success': 0,
            'target_not_found': 1,
            'destination_already_linked': 2,
            'destination_exists': 3,
        }

    def __init__(self):
        pass

    def install(self):
        pass

    def upload(self):
        pass

    def symlink(self, target, dest):
        """
        Symlink a file and its destination

        Will return a return code from `Infect.Codes.symlink`.

        """

        if not os.path.isfile(target):
            return self.Codes.symlink['target_not_found']

        if os.path.islink(dest):
            return self.Codes.symlink['destination_already_linked']

        if os.path.isfile(dest) or os.path.isdir(dest):
            return self.Codes.symlink['destination_exists']

        os.symlink(target, dest)

        return self.Codes.symlink['success']

    def uninstall(self):
        pass


def main():
    print('Running infect main()')
    return 0


if __name__ == "__main__":
    sys.exit(main())

## Instruction:
Add pragma: nocover to non-implemented methods
## Code After:

import sys
import os

# import argparse


class Infect(object):
    class Codes:
        symlink = {
            'success': 0,
            'target_not_found': 1,
            'destination_already_linked': 2,
            'destination_exists': 3,
        }

    def __init__(self):
        pass

    def install(self):  # pragma: nocover
        pass

    def upload(self):  # pragma: nocover
        pass

    def symlink(self, target, dest):
        """
        Symlink a file and its destination

        Will return a return code from `Infect.Codes.symlink`.

        """

        if not os.path.isfile(target):
            return self.Codes.symlink['target_not_found']

        if os.path.islink(dest):
            return self.Codes.symlink['destination_already_linked']

        if os.path.isfile(dest) or os.path.isdir(dest):
            return self.Codes.symlink['destination_exists']

        os.symlink(target, dest)

        return self.Codes.symlink['success']

    def uninstall(self):  # pragma: nocover
        pass


def main():  # pragma: nocover
    print('Running infect main()')
    return 0


if __name__ == "__main__":  # pragma: nocover
    sys.exit(main())
