def test_non_string_attributes(self): cube = iris.tests.stock.realistic_4d() attrib_key = "gorf" attrib_val = 23 cube.attributes[attrib_key] = attrib_val summary = cube.summary() # Get the cube summary # Check through the lines of the summary to see that our attribute is there attrib_re = re.compile("%s.*?%s" % (attrib_key, attrib_val)) for line in summary.split("\n"): result = re.match(attrib_re, line.strip()) if result: break else: # No match found for our attribute self.fail('Attribute not found in summary output of cube.')