public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pkgcore/snakeoil:master commit in: src/snakeoil/osutils/, tests/
@ 2022-12-25 18:27 Arthur Zamarin
  0 siblings, 0 replies; only message in thread
From: Arthur Zamarin @ 2022-12-25 18:27 UTC (permalink / raw
  To: gentoo-commits

commit:     2e4f73760dcbf1fb15bea4c6a89e4a65012ef74d
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 23 21:37:47 2022 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Dec 25 18:26:37 2022 +0000
URL:        https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=2e4f7376

remove osutils.native_readdir.listdir

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/snakeoil/osutils/__init__.py       | 2 +-
 src/snakeoil/osutils/native_readdir.py | 2 --
 tests/test_osutils.py                  | 8 +-------
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/snakeoil/osutils/__init__.py b/src/snakeoil/osutils/__init__.py
index 036a78df..1910859b 100644
--- a/src/snakeoil/osutils/__init__.py
+++ b/src/snakeoil/osutils/__init__.py
@@ -59,7 +59,7 @@ from . import native_readdir as module
 # force utf8 codepaths yet.
 from ..klass import steal_docs
 
-listdir = module.listdir
+listdir = os.listdir
 listdir_dirs = module.listdir_dirs
 listdir_files = module.listdir_files
 readdir = module.readdir

diff --git a/src/snakeoil/osutils/native_readdir.py b/src/snakeoil/osutils/native_readdir.py
index b129a9bf..d7c2fd91 100644
--- a/src/snakeoil/osutils/native_readdir.py
+++ b/src/snakeoil/osutils/native_readdir.py
@@ -18,8 +18,6 @@ from stat import (
 
 from ..mappings import ProtectedDict
 
-listdir = os.listdir
-
 # we can still use the cpy pjoin here, just need to do something about the
 # import cycle.
 pjoin = os.path.join

diff --git a/tests/test_osutils.py b/tests/test_osutils.py
index 264d670d..fac98532 100644
--- a/tests/test_osutils.py
+++ b/tests/test_osutils.py
@@ -18,8 +18,7 @@ from snakeoil.osutils.mount import MNT_DETACH, MS_BIND, mount, umount
 class ReaddirCommon:
     @pytest.fixture
     def subdir(self, tmp_path):
-        subdir = tmp_path / "dir"
-        subdir.mkdir()
+        (subdir := tmp_path / "dir").mkdir()
         (tmp_path / "file").touch()
         os.mkfifo((tmp_path / "fifo"))
         return subdir
@@ -30,10 +29,6 @@ class ReaddirCommon:
 
 
 class TestNativeListDir(ReaddirCommon):
-    def test_listdir(self, tmp_path, subdir):
-        assert set(native_readdir.listdir(tmp_path)) == {"dir", "fifo", "file"}
-        assert native_readdir.listdir(subdir) == []
-
     def test_listdir_dirs(self, tmp_path, subdir):
         assert native_readdir.listdir_dirs(tmp_path) == ["dir"]
         assert native_readdir.listdir_dirs(subdir) == []
@@ -46,7 +41,6 @@ class TestNativeListDir(ReaddirCommon):
         return self._test_missing(
             tmp_path,
             (
-                native_readdir.listdir,
                 native_readdir.listdir_dirs,
                 native_readdir.listdir_files,
             ),


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-25 18:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-25 18:27 [gentoo-commits] proj/pkgcore/snakeoil:master commit in: src/snakeoil/osutils/, tests/ Arthur Zamarin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox