def test_withoutAnything(self):
        """
        Remove all secure sources and assert it raises a failure. Then try the
        fallback parameter.
        """
        self.factory._osUrandom = self.errorFactory
        self.assertRaises(randbytes.SecureRandomNotAvailable,
                          self.factory.secureRandom, 18)
        def wrapper():
            return self.factory.secureRandom(18, fallback=True)
        s = self.assertWarns(
            RuntimeWarning,
            "urandom unavailable - "
            "proceeding with non-cryptographically secure random source",
            __file__,
            wrapper)
        self.assertEqual(len(s), 18)

        Remove all secure sources and assert it raises a failure. Then try the
        fallback parameter.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_randbytes.py