plugin: add support for named plugin matchers#5103
Conversation
|
Just a thought on this: should/does there need to be a test for this in |
|
True, I forgot about that. But thinking about it, it would result in lots of duplicates if we'd add It would probably make more sense changing the I wanted to update the URL matcher tests at some point anyway, because error messages are currently not particularly nice due to how the parametrization is done. I also had the idea of making the URL matcher tests more "automagical" with automatic imports of the plugin classes (derived from the test module name, since the |
This adds support for optionally named plugin matchers, e.g.:
Both
Plugin.matchersandPlugin.matchescan now be referenced by matcher index, like before, as well as matcher name, if it was set. Invalid values will raise anIndexErrorandKeyErrorrespectively.This is useful if multiple matchers are defined, so match results don't have to be referenced by matcher index, which depends on the (reverse) order of the pluginmatcher decorators.