I am currently writing a unit test for my Python2 script. I am having trouble writing a test case that catches both the sys.exit and the print statement to validate the exception. Any help would be appreciated.
except ParseError, e:
if len(self.args.password) == 0:
print('Some Message')
print 'Login response error'
sys.exit(1)