File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ # -*- coding: future-fstrings -*-
2
+ import pkgutil
3
+ from functools import partial
4
+ from importlib import import_module
5
+
6
+ from sphinx .testing .fixtures import make_app , test_params
7
+ from sphinx .testing .path import path as STP
8
+
9
+ import scanpydoc
10
+
11
+
12
+ def test_all_get_installed (monkeypatch , make_app , tmp_path ):
13
+ setups_seen = set ()
14
+ setups_called = {}
15
+ for finder , mod_name , _ in pkgutil .walk_packages (
16
+ scanpydoc .__path__ , f"{ scanpydoc .__name__ } ."
17
+ ):
18
+ mod = import_module (mod_name )
19
+ setups_seen .add (mod_name )
20
+ monkeypatch .setattr (mod , "setup" , partial (setups_called .__setitem__ , mod_name ))
21
+
22
+ (tmp_path / "conf.py" ).write_text ("" )
23
+ app = make_app (srcdir = STP (tmp_path ))
24
+ scanpydoc .setup (app )
25
+
26
+ assert setups_called .keys () == setups_seen
27
+ for mod_name , app2 in setups_called .items ():
28
+ assert app is app2
You can’t perform that action at this time.
0 commit comments