diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2022-12-31 23:06:57 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2022-12-31 23:06:57 +0200 |
commit | 0a9a567ec6672e2ad541dfbf5ad6f6484bcbcf77 (patch) | |
tree | 409bb788649df9b33a2f661636d1f3cc9720669f /tests | |
parent | process.spawn: add type annotations (diff) | |
download | snakeoil-0a9a567ec6672e2ad541dfbf5ad6f6484bcbcf77.tar.gz snakeoil-0a9a567ec6672e2ad541dfbf5ad6f6484bcbcf77.tar.bz2 snakeoil-0a9a567ec6672e2ad541dfbf5ad6f6484bcbcf77.zip |
fileutils: small cleanup and modernization
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_fileutils.py | 7 | ||||
-rw-r--r-- | tests/test_osutils.py | 4 |
2 files changed, 1 insertions, 10 deletions
diff --git a/tests/test_fileutils.py b/tests/test_fileutils.py index 356eb74d..de8a1f7d 100644 --- a/tests/test_fileutils.py +++ b/tests/test_fileutils.py @@ -122,13 +122,6 @@ class TestAtomicWriteFile: af.close() -def cpy_setup_class(scope, func_name): - if getattr(fileutils, "native_%s" % func_name) is getattr(fileutils, func_name): - scope["skip"] = "extensions disabled" - else: - scope["func"] = staticmethod(getattr(fileutils, func_name)) - - class Test_readfile: func = staticmethod(fileutils.readfile) diff --git a/tests/test_osutils.py b/tests/test_osutils.py index fac98532..a60bb15f 100644 --- a/tests/test_osutils.py +++ b/tests/test_osutils.py @@ -10,7 +10,6 @@ from unittest import mock import pytest from snakeoil import osutils from snakeoil.contexts import Namespace -from snakeoil.fileutils import touch from snakeoil.osutils import native_readdir, supported_systems, sizeof_fmt from snakeoil.osutils.mount import MNT_DETACH, MS_BIND, mount, umount @@ -114,8 +113,7 @@ class TestEnsureDirs: def test_path_is_a_file(self, tmp_path): # fail if passed a path to an existing file - path = tmp_path / "file" - touch(path) + (path := tmp_path / "file").touch() assert path.is_file() assert not osutils.ensure_dirs(path, mode=0o700) |