-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Plugin support for dynamic context #783
Conversation
Codecov Report
@@ Coverage Diff @@
## master #783 +/- ##
==========================================
- Coverage 89.98% 89.91% -0.07%
==========================================
Files 78 78
Lines 10830 10937 +107
Branches 1118 1128 +10
==========================================
+ Hits 9745 9834 +89
- Misses 959 977 +18
Partials 126 126
Continue to review full report at Codecov.
|
@sjustas Thanks for doing this. I've been meaning to make time to look at it, but I have a conference coming up. It may take me a few more weeks, sorry. |
@nedbat, no worries, I'll be looking forward to your feedback. |
@sjustas This is very comprehensive, thanks. I appreciate the work you put into the tests, which are significant. Do you have a use case for chaining the context switchers? It would be easier to just have one in effect at a time, but maybe you had a need to have more than one? |
This could be useful for supporting multiple different TestSuite implementations. Python is pretty flexible there, even bundled Another example could be RMLRenderingTestCase. It would probably handle contexts in similar way to So I thought it would be nice if developers could implement context plugins that work correctly with each library, and users of these libraries (say unittest + doctest + z3c.rml) could just list all the plugins in configuration. I think another good way to approach this is to have an option for test runners themselves to set correct contexts for each test case they run, hence the PR #782 🙂 |
Thanks! I'll be doing some clean up after the merge. |
This PR allows writing simple dynamic context plugins.
I kept the
dynamic_context = test_function
setting for backwards compatibility.