Skip to content
Merged
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
6 changes: 4 additions & 2 deletions tests/test_testgres_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2422,13 +2422,14 @@ def helper__call_and_check_pgbench_table_checksums(
class tag_rmdirs_protector:
_os_ops: OsOperations
_cwd: str
_old_rmdirs: any
_old_rmdirs: typing.Optional[typing.Callable]
_cwd: str

def __init__(self, os_ops: OsOperations):
self._os_ops = os_ops
self._cwd = os.path.abspath(os_ops.cwd())
self._old_rmdirs = os_ops.rmdirs
return

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

def __exit__(self, exc_type, exc_val, exc_tb):
assert self._os_ops.rmdirs == self.proxy__rmdirs
assert isinstance(self._old_rmdirs, typing.Callable)
self._os_ops.rmdirs = self._old_rmdirs
return False

Expand Down Expand Up @@ -2465,7 +2467,7 @@ def test_node_app__make_empty__base_dir_is_None(self, node_svc: PostgresNodeServ
assert node_app.os_ops is os_ops

with pytest.raises(expected_exception=BaseException) as x:
node_app.make_empty(base_dir=None)
node_app.make_empty(base_dir=None) # type: ignore

if type(x.value) is AssertionError:
pass
Expand Down