def test_stracker_diff(self):
        stracker = tracker.SummaryTracker()
        # for now, no object should be listed
        diff = stracker.diff()
        self.assert_(self._contains_indicator(diff) == None)
        # now an indicator object should be included in the diff
        o = self._get_indicator()
        diff = stracker.diff()
        self.assert_(self._contains_indicator(diff) == 1)
        # now it should be gone again, compared to the
        # previously stored summary
        o = self._get_indicator()
        sn1 = stracker.create_summary()
        o = None
        diff = stracker.diff(summary1=sn1)
        self.assert_(self._contains_indicator(diff) == -1)
        # comparing two homemade summaries should work, too
        o = None
        sn1 = stracker.create_summary()
        o = self._get_indicator()
        sn2 = stracker.create_summary()
        diff = stracker.diff(summary1=sn1, summary2=sn2)
        self.assert_(self._contains_indicator(diff) == 1)
        # providing summary2 without summary1 should raise an exception
        self.assertRaises(ValueError, stracker.diff, summary2=sn2)


#    def test_stracker_for_leaks_in_tracker(self):
#        """Test if any operations of the tracker leak memory."""
#
#        # test create_summary
#        tmp_tracker = tracker.SummaryTracker()
#        # XXX: TODO
#        self.assert_(muppy.get_usage(tmp_tracker.create_summary) == None)
#        self.assert_(muppy.get_usage(tmp_tracker.store_summary, 1) == None)
#        # test print_diff
#        self.assert_(muppy.get_usage(tmp_tracker.print_diff, [], []) == None)
Test that the diff is computed correctly.
dataset/ETHPy150Open pympler/pympler/test/muppy/test_tracker.py/TrackerTest.test_stracker_diff