Commit 69c7869f authored by Jérémy Bobbio (Lunar)'s avatar Jérémy Bobbio (Lunar)
Browse files

Fix tests for Python 3

The httplib module has been renamed to http.client in Python 3.
So let's try to import HTTPConnection from both.
parent 32a67daf6edf
import unittest
import httplib
try:
from http.client import HTTPConnection
except ImportError:
from httplib import HTTPConnection
from elasticsearch_dsl.connections import connections
......@@ -34,7 +38,7 @@ class RealESTestMixin(object):
@classmethod
def setUpClass(cls):
try:
httplib.HTTPConnection('localhost:9200').request('GET', '/')
HTTPConnection('localhost:9200').request('GET', '/')
except: # noqa
raise unittest.SkipTest(
'No ElasticSearch on localhost, skipping test')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment