Opened 9 years ago
Last modified 8 years ago
#12233 closed enhancement
Make formatter.suite available to plugins — at Version 8
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.2 |
Component: | wiki system | Version: | |
Severity: | normal | Keywords: | tests |
Cc: | Branch: | ||
Release Notes: |
Added function |
||
API Changes: | |||
Internal Changes: |
Description
formatter.suite is useful for writing macro test cases, as seen in macros.py. However, from trac.wiki.tests import formatter
fails in a plugin when the Trac is not installed in develop
(editable
) mode.
Change History (9)
comment:2 by , 8 years ago
Component: | general → wiki system |
---|---|
Keywords: | tests added |
Milestone: | next-major-releases → 1.2 |
The only way I see to solve this is to either add trac.wiki.tests.formatter
directly to the distributed package, or move the code in that file. I considered moving to trac.test
, but maybe it would make sense to move to trac.wiki.test
: log:rjollos.git:t12233_formatter_test_suite.
comment:3 by , 8 years ago
Why HelloWorldMacro
is moved to trac.wiki.test
package? I think WikiTestCase
, subclasses of the WikiTestCase
and wikisyntax_test_suite()
only should be moved.
comment:4 by , 8 years ago
WikiTestCase
uses HelloWorldMacro
to create an environment: trunk/trac/wiki/tests/formatter.py@14791:161-164#L143.
comment:5 by , 8 years ago
I think we should allow to specify components to enable for WikiTestCase
and wikisyntax_test_suite
. Otherwise, it wouldn't be useful to test for plugins.
comment:6 by , 8 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:7 by , 8 years ago
I found we can use Environment.enable_component
to enable components in the setup function that is passed to trac.wiki.test.wikisyntax_test_suite
. This hadn't worked for me in the past, but the problem was that I specified a component rule rather than a module name (e.g. tractags.*
rather than tractags
).
Proposed changes in log:rjollos.git:t12233_formatter_test_suite.2. See th:#12788 for a patch that uses trac.wiki.test.wikisyntax_test_suite
in the TagsPlugin codebase.
comment:8 by , 8 years ago
Release Notes: | modified (diff) |
---|
by , 8 years ago
Attachment: | t12233-add-env-kwargs.diff added |
---|
Edit: Created #12487 for proposed changes.