Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test for "static" mechanism in plugins #517

Closed
simonw opened this issue Jun 23, 2019 · 1 comment
Closed

Add unit test for "static" mechanism in plugins #517

simonw opened this issue Jun 23, 2019 · 1 comment
Labels

Comments

@simonw
Copy link
Owner

simonw commented Jun 23, 2019

Split out from #272 - this is actually quite tricky. Here's the relevant code:

for plugin in pm.get_plugins():
static_path = None
templates_path = None
try:
if pkg_resources.resource_isdir(plugin.__name__, "static"):
static_path = pkg_resources.resource_filename(plugin.__name__, "static")
if pkg_resources.resource_isdir(plugin.__name__, "templates"):
templates_path = pkg_resources.resource_filename(
plugin.__name__, "templates"
)
except (KeyError, ImportError):
# Caused by --plugins_dir= plugins - KeyError/ImportError thrown in Py3.5
pass

@simonw
Copy link
Owner Author

simonw commented Jun 23, 2019

See also #226 - "Unit tests for installable plugins"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant