Changeset 4336


Ignore:
Timestamp:
Mar 29, 2007, 11:35:19 AM (18 years ago)
Author:
ole
Message:

Fix a bug in test_caching.py so that it will work with test_all.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/caching/test_caching.py

    r4333 r4336  
    394394          self.value = value     
    395395
     396      # Make sure that class has been redefined to another address
     397      #print
     398      #print 'Initial_addr  ', initial_addr
     399      #print 'Redefined addr', `Dummy_memorytest`
     400      msg = 'Redefined class ended up at same memory location as '
     401      msg += 'original class making this test irrelevant. Try to run '
     402      msg += 'it again and see if this error goes away.'
     403      msg += 'If it persists contact Ole.Nielsen@ga.gov.au'
     404      assert initial_addr != `Dummy_memorytest`, msg   
     405
     406     
    396407      retrieve_cache(Dummy_memorytest, verbose=verbose)     
    397408         
    398409
     410# Define class Dummy_memorytest before any tests are run
     411# to make sure it has a different memory address
     412# to the one defined in test 'test_objects_are_created_memory'
     413class Dummy_memorytest:
     414  def __init__(self, value, another):
     415    self.value = value     
     416
     417# Cache created for use with 'test_objects_are_created_memory'
     418initial_addr = `Dummy_memorytest`
     419clear_and_create_cache(Dummy_memorytest, verbose=False)
     420 
     421     
     422
    399423
    400424
     
    405429#-------------------------------------------------------------
    406430if __name__ == "__main__":
    407 
    408     # Cache created for test_objects_are_created_memory to make sure it has a different memory address
    409     clear_and_create_cache(Dummy_memorytest, verbose=False)
    410  
    411431    suite = unittest.makeSuite(Test_Caching,'test')
    412432    runner = unittest.TextTestRunner()
Note: See TracChangeset for help on using the changeset viewer.