File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -46,14 +46,18 @@ def test_backend_is_correct(monkeypatch):
46
46
47
47
@td .skip_if_no_mpl
48
48
def test_register_entrypoint ():
49
+
50
+ dist = pkg_resources .get_distribution ("pandas" )
51
+ if dist .module_path not in pandas .__file__ :
52
+ # We are running from a non-installed pandas, and this test is invalid
53
+ pytest .skip ("Testing a non-installed pandas" )
54
+
49
55
mod = types .ModuleType ("my_backend" )
50
56
mod .plot = lambda * args , ** kwargs : 1
51
57
52
58
backends = pkg_resources .get_entry_map ("pandas" )
53
59
my_entrypoint = pkg_resources .EntryPoint (
54
- "pandas_plotting_backend" ,
55
- mod .__name__ ,
56
- dist = pkg_resources .get_distribution ("pandas" ),
60
+ "pandas_plotting_backend" , mod .__name__ , dist = dist
57
61
)
58
62
backends ["pandas_plotting_backends" ]["my_backend" ] = my_entrypoint
59
63
# TODO: the docs recommend importlib.util.module_from_spec. But this works for now.
You can’t perform that action at this time.
0 commit comments