From c4f7cb6182835ea9baf633afdecf4e946cdd5504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Mon, 3 Feb 2014 21:42:59 +0100 Subject: [PATCH] only look for regexes in strings --- test_elasticsearch/test_server/test_common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: