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

fix plugin loading #355

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions testify/test_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ def load_plugins():
# Need some unlikely-to-clash unique-ish module name
mod_name = '_testify_plugin__' + mod_name

try:
SourceFileLoader(mod_name, full_file_path).load_module()
try:
module_type = SourceFileLoader(mod_name, full_file_path).load_module()
plugin_modules.append(module_type)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StefanoChiodino Could this be a one-liner like this:
plugin_modules.append(SourceFileLoader(mod_name, full_file_path).load_module())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you try hard enough, you can fit the whole file in a single line 😂

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then you're writing perl ;)

except TypeError:
continue
except ImportError as e:
Expand Down
Loading