We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86714e7 commit 3471e17Copy full SHA for 3471e17
Makefile
@@ -18,7 +18,7 @@ doc:
18
cd docs && make html
19
20
test:
21
- $(PYTHON) -m unittest discover -s test
+ $(PYTHON) -m unittest discover -s tests
22
23
format:
24
$(FORMATTER) spotify
tests/test_import.py
@@ -0,0 +1,23 @@
1
+import sys
2
+import importlib
3
+import unittest
4
+from types import ModuleType
5
+
6
7
+class TestImporting(unittest.TestCase):
8
+ def _import(self, name: str) -> ModuleType:
9
+ module = importlib.import_module(name)
10
11
+ try:
12
+ sys.modules.pop(name)
13
+ finally:
14
+ del module
15
16
+ def test_import(self):
17
+ self._import('spotify')
+ def test_import_sync(self):
+ self._import('spotify.sync')
+if __name__ == '__main__':
+ unittest.main()
0 commit comments