[Python-checkins] python/dist/src/Lib/test test_support.py,1.49,1.50
montanaro@users.sourceforge.net
montanaro@users.sourceforge.net
2003年4月24日 12:07:05 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv12358
Modified Files:
test_support.py
Log Message:
if the test is run directly (__name__ == "__main__") don't actually require
particular resources
Index: test_support.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** test_support.py 5 Mar 2003 15:13:40 -0000 1.49
--- test_support.py 24 Apr 2003 19:06:57 -0000 1.50
***************
*** 63,66 ****
--- 63,70 ----
def requires(resource, msg=None):
+ # see if the caller's module is __main__ - if so, treat as if
+ # the resource was set
+ if sys._getframe().f_back.f_globals.get("__name__") == "__main__":
+ return
if not is_resource_enabled(resource):
if msg is None: