Skip to content

Commit 623c636

Browse files
committed
Convert all tests to PyTest
Signed-off-by: Roger Aiudi <[email protected]>
1 parent 779699f commit 623c636

File tree

8 files changed

+454
-414
lines changed

8 files changed

+454
-414
lines changed

aiohappybase/sync/_util.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def _make_sub(pat: str, repl: str = '', flags: int = 0) -> Callable[[str], str]:
2121
return partial(re.compile(pat, flags=flags).sub, repl) # noqa
2222

2323

24-
_remove_async = _make_sub(r'(?<!\w)(async |await |async(?=contextmanager))')
24+
_remove_async = _make_sub(
25+
r'(?<!\w)(async |await |async(?=contextmanager)|@pytest.mark.asyncio)'
26+
)
2527
_convert_async_names = _make_sub(
2628
# Match __aenter__, __aexit__, __anext__, aclose, StopAsyncIteration
2729
r'(?:(__)a(enter|exit|next)(__))|a(close)|(Stop)Async(Iteration)',

doc/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fetch the package from the `Python Package Index <http://pypi.python.org/>`_
3434
.. note::
3535

3636
Generating and installing the HBase Thrift Python modules (using ``thrift
37-
--gen py`` on the ``.thrift`` file) is not necessary, since HappyBase
37+
--gen py`` on the ``.thrift`` file) is not necessary, since AIOHappyBase
3838
bundles pregenerated versions of those modules.
3939

4040

setup.cfg

+6-5
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ exclude = tests,build,dist,venv,.tox,*.egg*,coverage,doc
6363
envlist = py36, py37, py38, py39
6464

6565
[testenv]
66-
deps =
67-
asynctest
68-
coverage
66+
deps = -rtest-requirements.txt
6967
commands =
70-
python -m unittest
71-
AIOHAPPYBASE_COMPAT=0.90 python -m unittest
68+
python -m pytest
69+
AIOHAPPYBASE_COMPAT=0.90 python -m pytest
70+
71+
[tool:pytest]
72+
junit_family = xunit1
7273

7374
[versioneer]
7475
VCS = git

test-requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
-r requirements.txt
22
coverage
3-
asynctest
3+
pytest
4+
pytest-asyncio

tests/conftest.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import secrets
2+
3+
import pytest
4+
5+
6+
@pytest.fixture
7+
def table_name() -> bytes:
8+
return b'test_' + secrets.token_hex(5).encode()

0 commit comments

Comments
 (0)