summaryrefslogtreecommitdiff
path: root/tests/unit/test_qt_machinery.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test_qt_machinery.py')
-rw-r--r--tests/unit/test_qt_machinery.py30
1 files changed, 1 insertions, 29 deletions
diff --git a/tests/unit/test_qt_machinery.py b/tests/unit/test_qt_machinery.py
index b5adc9b24..53a715262 100644
--- a/tests/unit/test_qt_machinery.py
+++ b/tests/unit/test_qt_machinery.py
@@ -24,13 +24,10 @@ import sys
import html
import argparse
import typing
-import pkgutil
-import importlib
-from typing import Any, Optional, List, Dict, Union, Iterator
+from typing import Any, Optional, List, Dict, Union
import pytest
-from qutebrowser import qt
from qutebrowser.qt import machinery
@@ -449,28 +446,3 @@ class TestInit:
actual_vars = {var: getattr(machinery, var) for var in bool_vars}
assert expected_vars == actual_vars
-
-
-def _find_qt_packages() -> Iterator[str]:
- """Find all Qt wrapper modules."""
- for _finder, name, is_pkg in pkgutil.walk_packages(
- path=qt.__path__,
- prefix=qt.__name__ + ".",
- ):
- assert not is_pkg, name
- if name != machinery.__name__:
- yield name
-
-
-@pytest.mark.parametrize("package", _find_qt_packages())
-def test_implicit_init(package: str, monkeypatch: pytest.MonkeyPatch):
- """Make sure importing any Qt submodule does an implicit init."""
- monkeypatch.delitem(sys.modules, package, raising=False)
- assert not machinery._initialized
-
- try:
- importlib.import_module(package)
- except machinery.Unavailable as e:
- pytest.skip(f"{package} not available: {e}")
-
- assert machinery._initialized