def test_alwaysBytes(self):
        """
        The output of L{BytesEnviron} should always be a L{dict} with L{bytes}
        values and L{bytes} keys.
        """
        result = bytesEnviron()
        types = set()

        for key, val in iteritems(result):
            types.add(type(key))
            types.add(type(val))

        self.assertEqual(list(types), [bytes])

        The output of L{BytesEnviron} should always be a L{dict} with L{bytes}
        values and L{bytes} keys.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_compat.py