diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2022-09-26 13:09:59 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2022-09-26 13:09:59 +0300 |
commit | 5edd0d6ea258aab0cb8d4c72896c8822eea7b518 (patch) | |
tree | fcd835a01293088518401f937512ccde9a7f771d /src/snakeoil | |
parent | descriptors: remove unused `classproperty` (diff) | |
download | snakeoil-5edd0d6ea258aab0cb8d4c72896c8822eea7b518.tar.gz snakeoil-5edd0d6ea258aab0cb8d4c72896c8822eea7b518.tar.bz2 snakeoil-5edd0d6ea258aab0cb8d4c72896c8822eea7b518.zip |
move `DemandLoadTargets` to tests
Used only in tests, which test `mixins.PythonNamespaceWalker`, meaning
I can't just remove it.
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'src/snakeoil')
-rw-r--r-- | src/snakeoil/test/demandload.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/snakeoil/test/demandload.py b/src/snakeoil/test/demandload.py deleted file mode 100644 index 9ce8f5de..00000000 --- a/src/snakeoil/test/demandload.py +++ /dev/null @@ -1,30 +0,0 @@ -from . import mixins - - -class DemandLoadTargets(mixins.PythonNamespaceWalker): - - target_namespace = 'snakeoil' - ignore_all_import_failures = False - - def setup_method(self, method): - self._failures = [] - - def teardown_method(self, method): - msg = "\n".join(sorted(f"{target}: error {e}" for target, e in self._failures)) - assert not self._failures, "bad demandload targets:\n" + msg - - def test_demandload_targets(self): - for x in self.walk_namespace( - self.target_namespace, - ignore_failed_imports=self.ignore_all_import_failures): - self.check_space(x) - - def check_space(self, mod): - for attr in dir(mod): - try: - obj = getattr(mod, attr) - # force __getattribute__ to fire - getattr(obj, "__class__", None) - except ImportError as ie: - # hit one. - self._failures.append((f"{mod.__name__}: target {attr}", ie)) |