aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2024-03-15 14:47:41 +0100
committerChristian Tismer <tismer@stackless.com>2024-03-15 16:01:16 +0100
commit11126cf65ff08c4f0508780d8ed5e14733b1b73b (patch)
treeffd113981a2e1e115e2143e4c8e3b5ef83ba7d44
parent68357b668744be4437527cdf3818b08cee5770c8 (diff)
shiboken tests/otherbinding: Add a test for star imports, amended
This clarifies when Shiboken is actually loaded. Task-number: PYSIDE-2404 Change-Id: Iaef8d2f6757482c928c3489def70945cbe1c00af Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
-rw-r--r--sources/shiboken6/tests/otherbinding/star_import_test.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/sources/shiboken6/tests/otherbinding/star_import_test.py b/sources/shiboken6/tests/otherbinding/star_import_test.py
index 2833cbd6b..4b5f1d270 100644
--- a/sources/shiboken6/tests/otherbinding/star_import_test.py
+++ b/sources/shiboken6/tests/otherbinding/star_import_test.py
@@ -24,18 +24,20 @@ other_loaded = 1 if sys.modules.get(OTHER_NAME) else 0
from minimal import * # noqa: F403
+shiboken_loaded += 2 if sys.modules.get(SHIBOKEN_NAME) else 0
minimal_loaded += 2 if sys.modules.get(MINIMAL_NAME) else 0
other_loaded += 2 if sys.modules.get(OTHER_NAME) else 0
from other import Number # noqa: F403
from other import * # noqa: F403
+shiboken_loaded += 4 if sys.modules.get(SHIBOKEN_NAME) else 0
minimal_loaded += 4 if sys.modules.get(MINIMAL_NAME) else 0
other_loaded = +4 if sys.modules.get(OTHER_NAME) else 0
import shiboken6.Shiboken # noqa: F401 F403
-shiboken_loaded = 8 if sys.modules.get(SHIBOKEN_NAME) else 0
+shiboken_loaded += 8 if sys.modules.get(SHIBOKEN_NAME) else 0
class ValTest(unittest.TestCase):
@@ -87,9 +89,10 @@ class StarImportTest(unittest.TestCase):
"""
def testStar(self):
- self.assertEqual(shiboken_loaded, 8)
- self.assertEqual(minimal_loaded, 6)
self.assertEqual(other_loaded, 4)
+ self.assertEqual(minimal_loaded, 6)
+ self.assertEqual(shiboken_loaded, 14)
+ # Interesting effect: Did not expect that shiboken is loaded at all.
if __name__ == '__main__':