def test_mustBeStr(self):
        """
        C{URLPath.fromString} must take a L{str} or L{unicode} argument.
        """
        with self.assertRaises(ValueError):
            urlpath.URLPath.fromString(None)

        if _PY3:
            with self.assertRaises(ValueError):
                urlpath.URLPath.fromString(b"someurl")

        C{URLPath.fromString} must take a L{str} or L{unicode} argument.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_urlpath.py