def test_toTuple(self):
        """
        _Process.toTuple is deprecated.

        When getting the deprecated processes property, the actual
        data (kept in the class _Process) is converted to a tuple --
        which produces a DeprecationWarning per process so converted.
        """
        self.pm.addProcess("foo", ["foo"])
        myprocesses = self.pm.processes
        self.assertEquals(len(myprocesses), 1)
        warnings = self.flushWarnings()
        foundToTuple = False
        for warning in warnings:
            self.assertIs(warning['category'], DeprecationWarning)
            if 'toTuple' in warning['message']:
                foundToTuple = True
        self.assertTrue(foundToTuple,
                        "no tuple deprecation found:{}".format(repr(warnings)))

        _Process.toTuple is deprecated.

        When getting the deprecated processes property, the actual
        data (kept in the class _Process) is converted to a tuple --
        which produces a DeprecationWarning per process so converted.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/runner/test/test_procmon.py