Skip to content

Commit bd8ddb5

Browse files
test_node_app__make_empty__base_dir_is_None is updated (typing) (#355)
1 parent 722ef1b commit bd8ddb5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/test_testgres_common.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,13 +2422,14 @@ def helper__call_and_check_pgbench_table_checksums(
24222422
class tag_rmdirs_protector:
24232423
_os_ops: OsOperations
24242424
_cwd: str
2425-
_old_rmdirs: any
2425+
_old_rmdirs: typing.Optional[typing.Callable]
24262426
_cwd: str
24272427

24282428
def __init__(self, os_ops: OsOperations):
24292429
self._os_ops = os_ops
24302430
self._cwd = os.path.abspath(os_ops.cwd())
24312431
self._old_rmdirs = os_ops.rmdirs
2432+
return
24322433

24332434
def __enter__(self):
24342435
assert self._os_ops.rmdirs == self._old_rmdirs
@@ -2437,6 +2438,7 @@ def __enter__(self):
24372438

24382439
def __exit__(self, exc_type, exc_val, exc_tb):
24392440
assert self._os_ops.rmdirs == self.proxy__rmdirs
2441+
assert isinstance(self._old_rmdirs, typing.Callable)
24402442
self._os_ops.rmdirs = self._old_rmdirs
24412443
return False
24422444

@@ -2465,7 +2467,7 @@ def test_node_app__make_empty__base_dir_is_None(self, node_svc: PostgresNodeServ
24652467
assert node_app.os_ops is os_ops
24662468

24672469
with pytest.raises(expected_exception=BaseException) as x:
2468-
node_app.make_empty(base_dir=None)
2470+
node_app.make_empty(base_dir=None) # type: ignore
24692471

24702472
if type(x.value) is AssertionError:
24712473
pass

0 commit comments

Comments
 (0)