From ae60a5edf344b954184a391b63d1034f96381573 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Sat, 18 Jul 2026 13:35:34 +0300 Subject: [PATCH] fix: TestOsOpsCommon::test_isfile_false__not_exist is fixed Unique directory within tempdir is used. --- tests/test_os_ops_common.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/test_os_ops_common.py b/tests/test_os_ops_common.py index 8daa0b81..67c88566 100644 --- a/tests/test_os_ops_common.py +++ b/tests/test_os_ops_common.py @@ -1352,8 +1352,15 @@ def test_isfile_false__not_exist( tmpdir = os_ops.get_tempdir() - filename = os_ops.build_path( + filedir = os_ops.build_path( tmpdir, + "test_isfile_false__not_exist-" + uuid.uuid4().bytes.hex(), + ) + + os_ops.makedir(filedir) + + filename = os_ops.build_path( + filedir, name_with_surprize.value, ) @@ -1369,7 +1376,11 @@ def test_isfile_false__not_exist( pass else: # We will check a real work with another host + assert not os.path.exists(filedir) assert not os.path.exists(filename) + + os.mkdir(filedir) + with open(filename, "a"): os.utime(filename, None) assert os.path.exists(filename) @@ -1384,7 +1395,11 @@ def test_isfile_false__not_exist( assert os.path.exists(filename) os.remove(filename) assert not os.path.exists(filename) + os.rmdir(filedir) + assert not os.path.exists(filedir) logging.info("Local detecter is deleted [{}]".format(filename)) + + os_ops.rmdir(filedir) return def test_isfile_false__directory(