def test_filter_traces_domain_filter(self):
    (snapshot, snapshot2) = create_snapshots()
    filter1 = tracemalloc.DomainFilter(False, domain=3)
    filter2 = tracemalloc.DomainFilter(True, domain=3)
    snapshot3 = snapshot.filter_traces((filter1,))
    self.assertEqual(snapshot3.traces._traces, [(0, 10, (('a.py', 2), ('b.py', 4))), (0, 10, (('a.py', 2), ('b.py', 4))), (0, 10, (('a.py', 2), ('b.py', 4))), (1, 2, (('a.py', 5), ('b.py', 4))), (2, 66, (('b.py', 1),))])
    snapshot3 = snapshot.filter_traces((filter2,))
    self.assertEqual(snapshot3.traces._traces, [(3, 7, (('<unknown>', 0),))])
def test_filter_traces_domain_filter(self):
    (snapshot, snapshot2) = create_snapshots()
    filter1 = tracemalloc.DomainFilter(False, domain=3)
    filter2 = tracemalloc.DomainFilter(True, domain=3)
    snapshot3 = snapshot.filter_traces((filter1,))
    self.assertEqual(snapshot3.traces._traces, [(0, 10, (('a.py', 2), ('b.py', 4))), (0, 10, (('a.py', 2), ('b.py', 4))), (0, 10, (('a.py', 2), ('b.py', 4))), (1, 2, (('a.py', 5), ('b.py', 4))), (2, 66, (('b.py', 1),))])
    snapshot3 = snapshot.filter_traces((filter2,))
    self.assertEqual(snapshot3.traces._traces, [(3, 7, (('<unknown>', 0),))])