File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 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):
4646
4747@td .skip_if_no_mpl
4848def 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+
4955 mod = types .ModuleType ("my_backend" )
5056 mod .plot = lambda * args , ** kwargs : 1
5157
5258 backends = pkg_resources .get_entry_map ("pandas" )
5359 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
5761 )
5862 backends ["pandas_plotting_backends" ]["my_backend" ] = my_entrypoint
5963 # 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