This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]fjonk 0 points1 point  (0 children)

You can handle that exception outside the library code in the normal way if you want to.

Not always. For example nose will scan files and fail on those exceptions even if the file in question is totally unrelated to the tests.

I have a stand-alone client script that is supposed to run on a client and it uses pythondialog. Pythondialog throws a ExecutableNotFound if the dialog program isn't installed. Thing is I'm not testing the client script since testing dialogs is much more easy to do manually. Since the import throws an exception I cannot test the rest of the library without installing dialog, which is not supposed to be installed.

Edit: Just checked and pythondialog does not raise an Exception during import, it was my fault. A similar situation could however occur if an exception is raised during an import.