New unit test that iterates through all available directives and checks that all directive_class variables are valid.
Details
- Reviewers
kparal jskladan - Maniphest Tasks
- T268: unit test: make sure all directives have `directive_class` variable
- Commits
- rLTRNbad02425649e: test for directive class modules
$ py.test
Diff Detail
- Repository
- rLTRN libtaskotron
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Josef, could you give us an advice here, whether it is cleaner to list all .py files in a given directory, or use a different approach like this?
http://stackoverflow.com/questions/1707709/list-all-the-modules-that-are-part-of-a-python-package/1707786#1707786
Any preference to using __import__ or imp?
Preliminary review.
Could you please rename testing/test_directive_class_vars.py into something like testing/test_directives.py? In future we might want to add additional generic directives tests and it would be silly create separate modules for each such test. Let's name this test module in a generic way.
testing/test_directive_class_vars.py | ||
---|---|---|
12–13 ↗ | (On Diff #558) | Please document either under the class or under the method the intended behavior that you are testing. This is something that's not immediately clear from the method name. Something like:
|
17 ↗ | (On Diff #558) | Please use [:-len('.py')] instead of [:-3]. It's much clearer what you're stripping and why. |