Skip to content

Commit 61c2970

Browse files
authored
bump pytest-test-utils; use wait_until (#20)
1 parent cb97b8c commit 61c2970

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ install_requires=
3737
dev =
3838
pytest==6.2.5
3939
pytest-sugar==0.9.4
40-
pytest-test-utils==0.0.5
40+
pytest-test-utils==0.0.6
4141
pytest-cov==3.0.0
4242
pytest-mock==3.6.1
4343
pytest-asyncio==0.16.0

tests/test_dulwich.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
USER,
1313
Server,
1414
)
15-
from funcy import retry
1615
from pytest_mock import MockerFixture
16+
from pytest_test_utils.waiters import wait_until
1717

1818
from scmrepo.git.backend.dulwich.asyncssh_vendor import AsyncSSHVendor
1919

@@ -106,13 +106,7 @@ def test_run_command_data_transfer(server: Server, ssh_port: int):
106106
channel.send_stderr(b"stderr\n")
107107
channel.close()
108108

109-
def check_can_read():
110-
assert con.can_read()
111-
return True
112-
113-
# pylint: disable=no-value-for-parameter
114-
can_read = retry(10, timeout=0.1)(check_can_read)
115-
assert can_read()
109+
assert wait_until(con.can_read, timeout=1, pause=0.1)
116110
assert con.read(4096) == b"stdout\n"
117111
assert con.read_stderr(4096) == b"stderr\n"
118112

tests/test_noscm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ class Unimplemented(Exception):
2222
scm = NoSCM(tmp_dir, _raise_not_implemented_as=Unimplemented)
2323
assert scm._exc is Unimplemented # pylint: disable=protected-access
2424

25-
assert Git.reset == matcher.instance_of(Callable) # type: ignore[arg-type]
25+
assert Git.reset == matcher.instance_of(Callable)
2626
with pytest.raises(Unimplemented):
2727
assert scm.reset()

0 commit comments

Comments
 (0)