Skip to content

Commit

Permalink
Merge pull request #76 from aio-libs/move-tests
Browse files Browse the repository at this point in the history
Move tests and update deployment settings
  • Loading branch information
jettify authored Dec 10, 2018
2 parents d39c53c + 20a0f77 commit 0af0af2
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 44 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ after_success:

deploy:
provider: pypi
user: andrew.svetlov
user: aio-libs-bot
password:
secure: "Pl5Ra/KR0OqE27w8leDsIMzS/K65IEQCtwvuNTrXr6KHZT4hgAwtMS+Up22Ow8J5858nLHzJ0OQKIWPJ8dirZkc8E3fNkFFImK4y4aGkzuDVhQG5Y+Mmj+7UglIEu1/3i/MPmfCftUTuLsUyleYaq/MdGF6zvDoM+H0+DSYgxMA="
distributions: "sdist bdist_wheel"
secure: "xrYq78Jpw3rfHNc+LDS3IXi0cDZukAgaDuJ+xbkRLwijeSTR8LA9ZFU0OYK2X/+YBrtegBKB15ZkEkjfN702MNaR3wqHGxs+EWVcZc6Yy/lipGTjfGJEiDcIF+wKzFR5wqSL8Hrj66cDnY7dK07jfHc5KswTUizmiYLqGnAJGI+zQVnHCIv6W6iC06LY9eLcBXi514toMN9ku+anNBtzQ14gjW4N0ccCGKaeeAzPsvrMcnpjUh1xOhFG/aTBFpEPLbJ7ZUS87kPabf9/WsLS0tEW8ggSgAZT9GTljbe4I8/Vg14EJCQ4KSpcQ8z9gsf1AAB8XEYIN0jx2ub/c6gYwlazoOln6EE+WbNTHqEx0SiCkHrL7gIOoXEWYG/xPGraYQIi1xD6Yl6nmi0bixUQOgsYGKYb131ycyMJjsHGTdRHnqnja0ev9VIWr5zBu1IKtE/46QRMFYpg5PPAVX211wVsvZwH8plueIA1WRfzwZQoAiZDhQ4Wusql6jFVleeqKy4UldYy3SFoFL0qzlwvm/cx7dkP97NoW8Xtoizz0CJt/BeFGViCaRYbi3Z45rjSaeVWhfcwnIaRdd3FgadxWhJXEohgnoafwCteNz3NGU0lbxBfuOfYEOFgcwdYMzF0KjsGwbfekdAa/ZcLxnuvmJXFXPo/YrWusVw4nBR/9pU="
distributions: sdist bdist_wheel
on:
tags: true
all_branches: true
Expand Down
2 changes: 1 addition & 1 deletion aiorwlock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys

from collections import deque
from asyncio import Task, Future
from asyncio import Task, Future # noqa
from typing import Any, List, Tuple, Optional, Callable # noqa

try:
Expand Down
39 changes: 0 additions & 39 deletions tests/pep492/test_492.py

This file was deleted.

39 changes: 38 additions & 1 deletion tests/test_rwlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ async def test_repr(loop):
assert 'WriterLock: [unlocked]' in rwlock.__repr__()


def test_release_unlocked(loop):
@pytest.mark.run_loop
async def test_release_unlocked(loop):
rwlock = RWLock(loop=loop)
with pytest.raises(RuntimeError):
rwlock.reader_lock.release()
Expand Down Expand Up @@ -480,3 +481,39 @@ def test_current_task(loop):

with pytest.raises(RuntimeError):
current_task()


@pytest.mark.run_loop
async def test_read_context_manager(loop, fast_track):
rwlock = RWLock(loop=loop, fast=fast_track)
reader = rwlock.reader_lock
assert not reader.locked
async with reader:
assert reader.locked


@pytest.mark.run_loop
async def test_write_context_manager(loop, fast_track):
rwlock = RWLock(loop=loop, fast=fast_track)
writer = rwlock.writer_lock
assert not writer.locked
async with writer:
assert writer.locked


@pytest.mark.run_loop
async def test_await_read_lock(loop, fast_track):
rwlock = RWLock(loop=loop, fast=fast_track)
reader = rwlock.reader_lock
assert not reader.locked
async with reader:
assert reader.locked


@pytest.mark.run_loop
async def test_await_write_lock(loop, fast_track):
rwlock = RWLock(loop=loop, fast=fast_track)
writer = rwlock.writer_lock
assert not writer.locked
async with writer:
assert writer.locked

0 comments on commit 0af0af2

Please sign in to comment.