Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
dist: trusty
language: python
python:
- "3.5"
script: make test
after_success: coveralls
python: 3.5
env:
- TOX_ENV=py35
- TOX_ENV=flake8
install:
- pip install tox
script:
- tox -e $TOX_ENV
after_success:
# Report coverage results to coveralls.io
- pip install coveralls
- coveralls

matrix:
include:
- python: 3.6
env: TOX_ENV=py36
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,5 @@ published::
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(print_operations())
finally:
loop.close()

finally:
loop.close()
15 changes: 3 additions & 12 deletions smwogger/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,12 @@ def close(self):
self.running = False

async def __aenter__(self):
self.session.__aenter__()
await self.session.__aenter__()
return self

async def __aexit__(self, exc_type, exc_val, exc_tb):
self.session.__aexit__(exc_type, exc_val, exc_tb)
self.session.close()
self.running = False

def __enter__(self):
self.session.__enter__()
return self

def __exit__(self, exc_type, exc_val, exc_tb):
self.session.__exit__(exc_type, exc_val, exc_tb)
self.session.close()
await self.session.__aexit__(exc_type, exc_val, exc_tb)
await self.session.close()
self.running = False

def __getattr__(self, name):
Expand Down
11 changes: 0 additions & 11 deletions smwogger/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@


class TestAPI(unittest.TestCase):

@async_test
async def test_names_regular_enter_exit(self, loop):
with API(SPEC, verbose=True, loop=loop) as api:
with coserver():
await api.getHeartbeat()

for attr in ('getHeartbeat', 'addUserToCohort',
'returnCohortSettings'):
self.assertTrue(hasattr(api, attr))

@async_test
async def test_names(self, loop):
async with API(SPEC, verbose=True, loop=loop) as api:
Expand Down
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
[tox]
downloadcache = {toxworkdir}/cache/
envlist = py35,flake8
envlist = py35,py36,flake8

[testenv]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps = -rrequirements-test.txt
coveralls

commands =
pytest -s --cov-config .coveragerc --cov smwogger smwogger/tests
- coveralls

[testenv:flake8]
commands = flake8 smwogger
Expand Down