How to get around “sys.exit()” in python nosetest?

It seems that python nosetest will quit when encountered "sys.exit()", and mocking of this built-in doesn't work. Thanks for suggestions.

Answers


You can try catching the SystemExit exception. It is raised when someone calls sys.exit().


Need Your Help

What's the best way to filter database records by Facebook friends?

php mysql sql facebook facebook-graph-api

We'd like to introduce a feature that lets users view game results by their Facebook friends. We currently store each user's facebook uid when they first register for our game (social sign-on). Our...

Creating Buttons by looping through an array

ios arrays uibutton uilabel

So I asked this question earlier, and got a few responses but things got really messy so I decided to re ask it here.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.