-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test to check that dylink's module cache works under repyportabi…
…lity. See #28 for details.
- Loading branch information
1 parent
91b0ee9
commit 61fd57e
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Verify that we can catch an excpetion defined in an imported library | ||
and raised in another. | ||
""" | ||
#pragma out Successfully caught Lib1Error(). | ||
|
||
from repyportability import * | ||
add_dy_support(locals()) | ||
|
||
lib1 = dy_import_module("portability_testlib1.r2py") # defines the exception | ||
lib2 = dy_import_module("portability_testlib2.r2py") # raises it | ||
|
||
try: | ||
lib2.raise_lib1error() | ||
except lib1.Lib1Error: | ||
log("Successfully caught Lib1Error().\n") | ||
except Exception, e: | ||
log("Error: Expected Lib1Error() with id " + str(id(lib1.Lib1Error)) + | ||
" but caught '" + repr(e) + "' with id " + str(id(e)) + " \n") | ||
|