Safe Loader: a second, more abstract and reusable implementation [v0] #996
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the safe(r) test loader mechanism was introduced in the
avocado.core.loader
module, it was written specifically to address Avocado's own needs (that is,avocado.Test
based test classes).Now, we want to:
$ avocado list --unsafe
or similarThe first step is to abstract and isolate the original safe loader code, which is done and this PR in the form of the
avocado.core.safeloader
module. Then, as a PoC, we deliver a contrib script that makes use of this new module and finds unittests on Python source code files.This brings us to an interesting situation, where, although not without flaws or limitations, Avocado can test itself, which was one of the original goals of the project. A sample session / command line would look like this:
Currently, this reveals a number of (simple) bugs in our unittests, mostly related to to file paths, and brings the following results:
For functional tests, it brings the following results: