Skip to content

Commit 5072b7b

Browse files
authored
Merge pull request #347 from blueyed/fix-tests
Fix tests on Travis
2 parents 4d9947b + 40f2d7d commit 5072b7b

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ env:
66
- NOSE_VERBOSE=2
77
- NOSE_WITH_COVERAGE=true
88
- NOSE_COVER_PACKAGE=neovim
9+
- PYTEST_ADDOPTS=-vv
910
matrix:
1011
- CI_TARGET=tests
1112
matrix:

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
[flake8]
22
ignore = D211,E731,D401
3+
4+
[tool:pytest]
5+
testpaths = test
6+
timeout = 10

test/test_client_rpc.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
import time
23

34

45
def test_call_and_reply(vim):
@@ -41,6 +42,11 @@ def request_cb(name, args):
4142
# this would have dead-locked if not async
4243
vim.funcs.rpcrequest(vim.channel_id, "test-event", async_=True)
4344
vim.run_loop(request_cb, None, None)
45+
46+
# TODO(blueyed): This sleep is required on Travis, where it hangs with
47+
# "Entering event loop" otherwise (asyncio's EpollSelector._epoll.poll).
48+
time.sleep(0.1)
49+
4450
assert vim.vars['result'] == 17
4551

4652

tox.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ envlist =
44
py36-docs
55

66
[testenv]
7-
deps=
7+
deps =
88
pytest
99
pytest-xdist
10+
pytest-timeout
1011
pyuv: pyuv
11-
commands=python -m pytest -s
12+
passenv = PYTEST_ADDOPTS
13+
commands = python -m pytest {posargs}
1214

1315
[testenv:checkqa]
1416
deps =

0 commit comments

Comments
 (0)