Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 41727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:13:36+00:00 2026-05-10T15:13:36+00:00

No matter what I do sys.exit() is called by unittest, even the most trivial

  • 0

No matter what I do sys.exit() is called by unittest, even the most trivial examples. I can’t tell if my install is messed up or what is going on.

IDLE 1.2.2      ==== No Subprocess ==== >>> import unittest >>>  >>> class Test(unittest.TestCase):         def testA(self):             a = 1             self.assertEqual(a,1)  >>> unittest.main() option -n not recognized Usage: idle.pyw [options] [test] [...]  Options:   -h, --help       Show this message   -v, --verbose    Verbose output   -q, --quiet      Minimal output   Examples:    idle.pyw                               - run default set of tests    idle.pyw MyTestSuite                   - run suite 'MyTestSuite'    idle.pyw MyTestCase.testSomething      - run MyTestCase.testSomething    idle.pyw MyTestCase                    - run all 'test*' test methods                                            in MyTestCase  Traceback (most recent call last):   File '<pyshell#7>', line 1, in <module>     unittest.main()   File 'E:\Python25\lib\unittest.py', line 767, in __init__     self.parseArgs(argv)   File 'E:\Python25\lib\unittest.py', line 796, in parseArgs     self.usageExit(msg)   File 'E:\Python25\lib\unittest.py', line 773, in usageExit     sys.exit(2) SystemExit: 2 >>>  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:13:37+00:00Added an answer on May 10, 2026 at 3:13 pm

    Your example is exiting on my install too. I can make it execute the tests and stay within Python by changing

    unittest.main() 

    to

    unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromTestCase(Test)) 

    More information is available here in the Python Library Reference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No matter what I try, it never matches the sign. I even tried using
No matter what I do, I can't get this while loop to work; unless
Following matter is JBossAS 7.1 Developer Guider: Change ResourceBundle location In previous versions of
No matter what you read about ASP.NET routing or REST I think the best
No matter how you scroll, the div should always be at the bottom of
No matter how I configure the Credentials property I get a 401 exception when
No matter what I try I keep getting an infinite loop with this function:
This may be a matter of taste but when creating ViewModels is it best
Does endianness matter at all with the bitwise operations? Either logical or shifting? I'm
This is probably a matter of personal preference, but when do you use properties

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.