diff --git a/test_elasticsearch/test_server/test_common.py b/test_elasticsearch/test_server/test_common.py index 2ed85b31..20ad6928 100644 --- a/test_elasticsearch/test_server/test_common.py +++ b/test_elasticsearch/test_server/test_common.py @@ -172,7 +172,8 @@ class YamlTestCase(ElasticTestCase): value = self._lookup(path) expected = self._resolve(expected) - if expected.startswith('/') and expected.endswith('/'): + if isinstance(expected, (type(''), type(u''))) and \ + expected.startswith('/') and expected.endswith('/'): expected = re.compile(expected[1:-1], re.VERBOSE) self.assertTrue(expected.search(value)) else: