Changeset 1932
- Timestamp:
- Oct 16, 2005, 8:30:33 AM (19 years ago)
- Location:
- inundation/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/test_util.py
r1927 r1932 1025 1025 1026 1026 1027 def test_point_on_line_obsolete(self): 1028 """Test that obsolete call issues appropriate warning""" 1029 1030 #Turn warning into an exception 1031 import warnings 1032 warnings.filterwarnings('error') 1033 1034 try: 1035 assert point_on_line( 0, 0.5, 0,1, 0,0 ) 1036 except DeprecationWarning: 1037 pass 1038 else: 1039 msg = 'point_on_line should have issued a DeprecationWarning' 1040 raise Exception(msg) 1041 1042 warnings.resetwarnings() 1043 1044 1027 1045 #------------------------------------------------------------- 1028 1046 if __name__ == "__main__": -
inundation/pyvolution/util.py
r1927 r1932 5 5 """ 6 6 7 #Soon to be obsoleted here 8 9 10 #FIXME: Obsolete this shortcut 7 8 #FIXME: Deprecate this shortcut 11 9 from utilities.numerical_tools import ensure_numeric 12 10 13 14 11 import utilities.polygon 12 from warnings import warn 15 13 16 14 def point_on_line(*args, **kwargs): 17 15 """Temporary Interface to new location""" 18 16 19 print 'point_on_line has moved from util.py. ', 20 print 'Please use "from utilities.polygon import point_on_line"' 17 msg = 'point_on_line has moved from util.py. ' 18 msg += 'Please use "from utilities.polygon import point_on_line"' 19 warn(msg, DeprecationWarning) 21 20 22 21 return utilities.polygon.point_on_line(*args, **kwargs)
Note: See TracChangeset
for help on using the changeset viewer.