def test_filter_traces_domain(self):
    (snapshot, snapshot2) = create_snapshots()
    filter1 = tracemalloc.Filter(False, 'a.py', domain=1)
    filter2 = tracemalloc.Filter(True, 'a.py', domain=1)
    original_traces = list(snapshot.traces._traces)
    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))), (2, 66, (('b.py', 1),)), (3, 7, (('<unknown>', 0),))])
    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))), (2, 66, (('b.py', 1),)), (3, 7, (('<unknown>', 0),))])
def test_filter_traces_domain(self):
    (snapshot, snapshot2) = create_snapshots()
    filter1 = tracemalloc.Filter(False, 'a.py', domain=1)
    filter2 = tracemalloc.Filter(True, 'a.py', domain=1)
    original_traces = list(snapshot.traces._traces)
    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))), (2, 66, (('b.py', 1),)), (3, 7, (('<unknown>', 0),))])
    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))), (2, 66, (('b.py', 1),)), (3, 7, (('<unknown>', 0),))])