File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -86,17 +86,21 @@ def run_django_coverage(
86
86
tem = get_template (name or self .template_file )
87
87
ctx = Context (context or {})
88
88
self .cov = coverage .Coverage (** options )
89
- plugins = self .cov .config .get_option ("run:plugins" )
90
- plugins .append ("django_coverage_plugin" )
91
- self .cov .config .set_option ("run:plugins" , plugins )
89
+ self .append_config ("run:plugins" , "django_coverage_plugin" )
92
90
if 0 :
93
- self .cov . config [ "run:debug" ]. append ( "trace" )
91
+ self .append_config ( "run:debug" , "trace" )
94
92
self .cov .start ()
95
93
text = tem .render (ctx )
96
94
self .cov .stop ()
97
95
self .cov .save ()
98
96
return text
99
97
98
+ def append_config (self , option , value ):
99
+ """Append to a configuration option."""
100
+ val = self .cov .config .get_option (option )
101
+ val .append (value )
102
+ self .cov .config .set_option (option , val )
103
+
100
104
def get_line_data (self , name = None ):
101
105
"""Get the executed-line data for a template.
102
106
You can’t perform that action at this time.
0 commit comments