Skip to content

Commit 1742803

Browse files
committed
Add [async] deps to dev-requirements.txt
1 parent ee597ce commit 1742803

File tree

9 files changed

+18
-23
lines changed

9 files changed

+18
-23
lines changed

dev-requirements.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
requests>=2, <3
22
pytest
33
pytest-cov
4-
pytest-asyncio
54
coverage
65
mock
76
nosexcover
@@ -16,4 +15,8 @@ pandas
1615
pyyaml<5.3
1716

1817
black; python_version>="3.6"
19-
unasync
18+
19+
# Async dependencies
20+
unasync; python_version>="3.6"
21+
aiohttp; python_version>="3.6"
22+
pytest-asyncio; python_version>="3.6"

elasticsearch/client/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def stats(self, node_id=None, params=None, headers=None):
137137
"GET",
138138
"/_cluster/stats"
139139
if node_id in SKIP_IN_PATH
140-
else _make_path("_cluster/stats/nodes", node_id),
140+
else _make_path("_cluster", "stats", "nodes", node_id),
141141
params=params,
142142
headers=headers,
143143
)

elasticsearch/helpers/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _get_client():
4848
return get_test_client()
4949

5050
@classmethod
51-
def setup_class(cls):
51+
def setUpClass(cls):
5252
super(ElasticsearchTestCase, cls).setUpClass()
5353
cls.client = cls._get_client()
5454

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
]
2020
tests_require = [
2121
"requests>=2.0.0, <3.0.0",
22-
"nose",
2322
"coverage",
2423
"mock",
2524
"pyyaml",
26-
"nosexcover",
25+
"pytest",
26+
"pytest-cov",
2727
]
2828
async_requires = ["aiohttp>3.5.4,<4", "yarl"]
2929

@@ -62,7 +62,6 @@
6262
],
6363
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4",
6464
install_requires=install_requires,
65-
test_suite="test_elasticsearch.run_tests.run_all",
6665
tests_require=tests_require,
6766
extras_require={
6867
"develop": tests_require + docs_require + generate_require,

test_elasticsearch/test_async/test_connection.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,11 @@
33
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
44
# See the LICENSE file in the project root for more information
55

6-
import re
76
import ssl
87
from mock import Mock, patch
98
import warnings
109
from platform import python_version
1110

12-
from elasticsearch.exceptions import (
13-
TransportError,
14-
ConflictError,
15-
RequestError,
16-
NotFoundError,
17-
)
1811
from elasticsearch import AIOHttpConnection
1912
from elasticsearch import __versionstr__
2013
from ..test_cases import TestCase, SkipTest

test_elasticsearch/test_async/test_server/test_helpers.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
from elasticsearch import helpers, TransportError
99
from elasticsearch.helpers import ScanError
1010

11-
pytestmark = pytest.mark.asyncio
12-
13-
if not hasattr(helpers, "async_bulk"):
14-
pytest.skip("requires async helpers")
11+
pytestmark = [
12+
pytest.mark.asyncio,
13+
pytest.mark.skipif(
14+
not hasattr(helpers, "async_bulk"), reason="requires async helpers"
15+
),
16+
]
1517

1618

1719
class FailingBulkClient(object):

test_elasticsearch/test_server/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ def get_client(**kwargs):
3535
return new_client
3636

3737

38-
def setup():
39-
get_client()
40-
41-
4238
class ElasticsearchTestCase(BaseTestCase):
4339
@staticmethod
4440
def _get_client(**kwargs):

test_elasticsearch/test_server/test_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def run_skip(self, skip):
266266
min_version, max_version = version.split("-")
267267
min_version = _get_version(min_version) or (0,)
268268
max_version = _get_version(max_version) or (999,)
269-
if min_version <= self.es_version <= max_version:
269+
if min_version <= self.es_version() <= max_version:
270270
raise SkipTest(reason)
271271

272272
def run_catch(self, catch, exception):

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
envlist = pypy,py27,py34,py35,py36,py37,py38,lint,docs
33
[testenv]
44
whitelist_externals = git
5+
deps =
6+
-r dev-requirements.txt
57
commands =
68
python setup.py test
79

0 commit comments

Comments
 (0)