From f0920956122460aed64b9eb024d11385f7b20f6f Mon Sep 17 00:00:00 2001 From: Kevin Kubasik Date: Tue, 2 Jun 2009 14:57:53 +0000 Subject: [PATCH] [soc2009/testing] Removing old reporting library. Port has been tested using coverage.py 3.0b3 git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/test-improvements@10891 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/test/coverage_report/__init__.py | 18 -- django/test/coverage_report/data_storage.py | 57 ----- .../coverage_report/html_module_detail.py | 91 -------- .../coverage_report/html_module_errors.py | 53 ----- .../coverage_report/html_module_exceptions.py | 32 --- .../coverage_report/html_module_excludes.py | 55 ----- django/test/coverage_report/html_report.py | 143 ------------- .../coverage_report/templates/__init__.py | 17 -- .../templates/default_module_detail.py | 193 ----------------- .../templates/default_module_errors.py | 23 --- .../templates/default_module_exceptions.py | 89 -------- .../templates/default_module_excludes.py | 23 --- .../templates/default_module_index.py | 195 ------------------ django/test/test_coverage.py | 1 - 14 files changed, 990 deletions(-) delete mode 100644 django/test/coverage_report/__init__.py delete mode 100644 django/test/coverage_report/data_storage.py delete mode 100644 django/test/coverage_report/html_module_detail.py delete mode 100644 django/test/coverage_report/html_module_errors.py delete mode 100644 django/test/coverage_report/html_module_exceptions.py delete mode 100644 django/test/coverage_report/html_module_excludes.py delete mode 100644 django/test/coverage_report/html_report.py delete mode 100644 django/test/coverage_report/templates/__init__.py delete mode 100644 django/test/coverage_report/templates/default_module_detail.py delete mode 100644 django/test/coverage_report/templates/default_module_errors.py delete mode 100644 django/test/coverage_report/templates/default_module_exceptions.py delete mode 100644 django/test/coverage_report/templates/default_module_excludes.py delete mode 100644 django/test/coverage_report/templates/default_module_index.py diff --git a/django/test/coverage_report/__init__.py b/django/test/coverage_report/__init__.py deleted file mode 100644 index 87e6eb8821..0000000000 --- a/django/test/coverage_report/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -from html_report import * - diff --git a/django/test/coverage_report/data_storage.py b/django/test/coverage_report/data_storage.py deleted file mode 100644 index 30f03fab70..0000000000 --- a/django/test/coverage_report/data_storage.py +++ /dev/null @@ -1,57 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import coverage, time - -try: - set -except: - from sets import Set as set - - -class ModuleVars(object): - modules = dict() - def __new__(cls, module_name, module=None): - if cls.modules.get(module_name, None): - return cls.modules.get(module_name) - else: - obj=super(ModuleVars, cls).__new__(cls) - obj._init(module_name, module) - cls.modules[module_name] = obj - return obj - - def _init(self, module_name, module): - source_file, stmts, excluded, missed, missed_display = coverage.analysis2(module) - executed = list(set(stmts).difference(missed)) - total = list(set(stmts).union(excluded)) - total.sort() - title = module.__name__ - total_count = len(total) - executed_count = len(executed) - excluded_count = len(excluded) - missed_count = len(missed) - try: - percent_covered = float(len(executed))/len(stmts)*100 - except ZeroDivisionError: - percent_covered = 100 - test_timestamp = time.strftime('%a %Y-%m-%d %H:%M %Z') - severity = 'normal' - if percent_covered < 75: severity = 'warning' - if percent_covered < 50: severity = 'critical' - - for k, v in locals().iteritems(): - setattr(self, k, v) - diff --git a/django/test/coverage_report/html_module_detail.py b/django/test/coverage_report/html_module_detail.py deleted file mode 100644 index 7c5372e3c3..0000000000 --- a/django/test/coverage_report/html_module_detail.py +++ /dev/null @@ -1,91 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import cgi, os - -from data_storage import ModuleVars -from templates import default_module_detail as module_detail - -def html_module_detail(filename, module_name, nav=None): - """ - Creates a module detail report based on coverage testing at the specified - filename. If ``nav`` is specified, the nav template will be used as well. - - It uses `templates.default_module_detail` to create the page. The template - contains the following sections which need to be rendered and assembled into - the final HTML. - - TOP: Contains the HTML declaration and head information, as well as the - inline stylesheet. It requires the following variable: - * %(title)s The module name is probably fitting for this. - - CONTENT_HEADER: The header portion of the body. Requires the following variable: - * %(title)s - * %(source_file)s File path to the module - * %(total_count)d - * %(executed_count)d - * %(excluded_count)d - * %(ignored_count)d - * %(percent_covered)0.1f - * %(test_timestamp)s - - CONTENT_BODY: Annotated module source code listing. Requires the following variable: - * ``%(source_lines)s`` The actual source listing which is generated by - looping through each line and concatenanting together rendered - ``SOURCE_LINE`` template (see below). - - BOTTOM: Just a closing ```` - - SOURCE_LINE: Used to assemble the content of ``%(source_lines)s`` for ``CONTENT_BODY``. - Requires the following variables: - * ``%(line_status)s`` (ignored, executed, missed, excluded) used as CSS class - identifier to style the each source line. - * ``%(source_line)s`` - """ - if not nav: - nav = {} - m_vars = ModuleVars(module_name) - - m_vars.source_lines = source_lines = list() - i = 0 - for i, source_line in enumerate( - [cgi.escape(l.rstrip()) for l in file(m_vars.source_file, 'rb').readlines()]): - line_status = 'ignored' - if i+1 in m_vars.executed: line_status = 'executed' - if i+1 in m_vars.excluded: line_status = 'excluded' - if i+1 in m_vars.missed: line_status = 'missed' - source_lines.append(module_detail.SOURCE_LINE %vars()) - m_vars.ignored_count = i+1 - m_vars.total_count - m_vars.source_lines = os.linesep.join(source_lines) - - if 'prev_link' in nav and 'next_link' in nav: - nav_html = module_detail.NAV %nav - elif 'prev_link' in nav: - nav_html = module_detail.NAV_NO_NEXT %nav - elif 'next_link' in nav: - nav_html = module_detail.NAV_NO_PREV %nav - - fo = file(filename, 'wb+') - print >>fo, module_detail.TOP %m_vars.__dict__ - if nav: - print >>fo, nav_html - print >>fo, module_detail.CONTENT_HEADER %m_vars.__dict__ - print >>fo, module_detail.CONTENT_BODY %m_vars.__dict__ - if nav: - print >>fo, nav_html - print >>fo, module_detail.BOTTOM - fo.close() - diff --git a/django/test/coverage_report/html_module_errors.py b/django/test/coverage_report/html_module_errors.py deleted file mode 100644 index 2578e1d097..0000000000 --- a/django/test/coverage_report/html_module_errors.py +++ /dev/null @@ -1,53 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -from html_module_exceptions import html_module_exceptions -from templates import default_module_errors as module_errors - -def html_module_errors(filename, errors): - """ - Creates an index page of packages and modules which had problems being imported - for coverage analysis at the specified filename. - - It uses `templates.default_module_errors` to create the page. The template - contains the following sections which need to be rendered and assembled into - the final HTML. - - TOP: Contains the HTML declaration and head information, as well as the - inline stylesheet. - - CONTENT_HEADER: The header portion of the body. - - CONTENT_BODY: A list of excluded packages and modules. Requires the following - variable: - * ``%(long_desc)s`` A long description of what this page - is about. - * ``%(exception_list)s`` List of package and module names - which is generated by looping through each line and - concatenanting together rendered ``EXCEPTION_LINE`` - template (see below). - - BOTTOM: Just a closing ```` - - EXCEPTION_LINE: Used to assemble the content of ``%(exception_list)s`` for ``CONTENT_BODY``. - Requires the following variable: - * ``%(module_name)s`` - """ - long_desc = """\ - test_coverage.utils.module_tools.find_or_load_module had - problems importing these packages and modules: - """ - html_module_exceptions(filename, errors, module_errors, long_desc) diff --git a/django/test/coverage_report/html_module_exceptions.py b/django/test/coverage_report/html_module_exceptions.py deleted file mode 100644 index 43ad26d5d9..0000000000 --- a/django/test/coverage_report/html_module_exceptions.py +++ /dev/null @@ -1,32 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import os - -def html_module_exceptions(filename, exceptions, template, long_desc): - exception_list = [] - exceptions.sort() - for module_name in exceptions: - exception_list.append(template.EXCEPTION_LINE %vars()) - exception_list = os.linesep.join(exception_list) - - fo = file(filename, 'wb+') - print >>fo, template.TOP - print >>fo, template.CONTENT_HEADER - print >>fo, template.CONTENT_BODY %vars() - print >>fo, template.BOTTOM - fo.close() - diff --git a/django/test/coverage_report/html_module_excludes.py b/django/test/coverage_report/html_module_excludes.py deleted file mode 100644 index 86b8204814..0000000000 --- a/django/test/coverage_report/html_module_excludes.py +++ /dev/null @@ -1,55 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -from html_module_exceptions import html_module_exceptions -from templates import default_module_excludes as module_excludes - -def html_module_excludes(filename, excludes): - """ - Creates an index page of packages and modules which were excluded from the - coverage analysis at the specified filename. - - It uses `templates.default_module_excludes` to create the page. The template - contains the following sections which need to be rendered and assembled into - the final HTML. - - TOP: Contains the HTML declaration and head information, as well as the - inline stylesheet. - - CONTENT_HEADER: The header portion of the body. - - CONTENT_BODY: A list of excluded packages and modules. Requires the following - variable: - * ``%(long_desc)s`` A long description of what this page - is about. - * ``%(exception_list)s`` List of package and module names - which is generated by looping through each line and - concatenanting together rendered ``EXCEPTION_LINE`` - template (see below). - - BOTTOM: Just a closing ```` - - EXCEPTION_LINE: Used to assemble the content of ``%(exclude_list)s`` for ``CONTENT_BODY``. - Requires the following variable: - * ``%(module_name)s`` - """ - long_desc = """\ - These packages and modules were excluded from the coverage analysis in - django.conf.settings.COVERAGE_MODULE_EXCLUDES or they do - not contain any executable statements: - """ - html_module_exceptions(filename, excludes, module_excludes, long_desc) - diff --git a/django/test/coverage_report/html_report.py b/django/test/coverage_report/html_report.py deleted file mode 100644 index 30c40a0a18..0000000000 --- a/django/test/coverage_report/html_report.py +++ /dev/null @@ -1,143 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import os, time -from urllib import pathname2url as p2url - -from data_storage import ModuleVars -from html_module_detail import html_module_detail -from html_module_errors import html_module_errors -from html_module_excludes import html_module_excludes -from templates import default_module_index as module_index - -def html_report(outdir, modules, excludes=None, errors=None): - """ - Creates an ``index.html`` in the specified ``outdir``. Also attempts to create - a ``modules`` subdirectory to create module detail html pages, which are named - `module.__name__` + '.html'. - - It uses `templates.default_module_index` to create the index page. The template - contains the following sections which need to be rendered and assembled into - `index.html`. - - TOP: Contains the HTML declaration and head information, as well as the - inline stylesheet. It doesn't require any variables. - - CONTENT_HEADER: The header portion of the body. Requires the following variable: - * ``%(test_timestamp)s`` - - CONTENT_BODY: A table of contents to the different module detail pages, with some - basic stats. Requires the following variables: - * ``%(module_stats)s`` This is the actual content of the table and is - generated by looping through the modules we want to report on and - concatenanting together rendered ``MODULE_STAT`` template (see below). - * ``%(total_lines)d`` - * ``%(total_executed)d`` - * ``%(total_excluded)d`` - * ``%(overall_covered)0.1f`` - - EXCEPTIONS_LINK: Link to the excludes and errors index page which shows - packages and modules which were not part of the coverage - analysis. Requires the following variable: - * ``%(exceptions_link)s`` Link to the index page. - * ``%(exceptions_desc)s`` Describe the exception. - - ERRORS_LINK: Link to the errors index page which shows packages and modules which - had problems being imported. Requires the following variable: - * ``%(errors_link)s`` Link to the index page. - - BOTTOM: Just a closing ```` - - MODULE_STAT: Used to assemble the content of ``%(module_stats)s`` for ``CONTENT_BODY``. - Requires the following variables: - * ``%(severity)s`` (normal, warning, critical) used as CSS class identifier - to style the coverage percentage. - * ``%(module_link)s`` - * ``%(module_name)s`` - * ``%(total_count)d`` - * ``%(executed_count)d`` - * ``%(excluded_count)d`` - * ``%(percent_covered)0.1f`` - """ - # TODO: More robust directory checking and creation - outdir = os.path.abspath(outdir) - test_timestamp = time.strftime('%a %Y-%m-%d %H:%M %Z') - m_subdirname = 'modules' - m_dir = os.path.join(outdir, m_subdirname) - try: - os.mkdir(m_dir) - except OSError: - pass - - total_lines = 0 - total_executed = 0 - total_excluded = 0 - total_stmts = 0 - module_stats = list() - m_names = modules.keys() - m_names.sort() - for n in m_names: - m_vars = ModuleVars(n, modules[n]) - if not m_vars.total_count: - excludes.append(m_vars.module_name) - del modules[n] - continue - m_vars.module_link = p2url(os.path.join(m_subdirname, m_vars.module_name + '.html')) - module_stats.append(module_index.MODULE_STAT %m_vars.__dict__) - total_lines += m_vars.total_count - total_executed += m_vars.executed_count - total_excluded += m_vars.excluded_count - total_stmts += len(m_vars.stmts) - module_stats = os.linesep.join(module_stats) - overall_covered = float(total_executed)/total_stmts*100 - - m_names = modules.keys() - m_names.sort() - i = 0 - for i, n in enumerate(m_names): - m_vars = ModuleVars(n) - nav = dict(up_link=p2url(os.path.join('..', 'index.html')), - up_label='index') - if i > 0: - m = ModuleVars(m_names[i-1]) - nav['prev_link'] = os.path.basename(m.module_link) - nav['prev_label'] = m.module_name - if i+1 < len(modules): - m = ModuleVars(m_names[i+1]) - nav['next_link'] = os.path.basename(m.module_link) - nav['next_label'] = m.module_name - html_module_detail( - os.path.join(m_dir, m_vars.module_name + '.html'), n, nav) - - fo = file(os.path.join(outdir, 'index.html'), 'wb+') - print >>fo, module_index.TOP - print >>fo, module_index.CONTENT_HEADER %vars() - print >>fo, module_index.CONTENT_BODY %vars() - if excludes: - _file = 'excludes.html' - exceptions_link = _file - exception_desc = "Excluded packages and modules" - print >>fo, module_index.EXCEPTIONS_LINK %vars() - html_module_excludes(os.path.join(outdir, _file), excludes) - if errors: - _file = 'errors.html' - exceptions_link = _file - exception_desc = "Error packages and modules" - print >>fo, module_index.EXCEPTIONS_LINK %vars() - html_module_errors(os.path.join(outdir, _file), errors) - print >>fo, module_index.BOTTOM - fo.close() - diff --git a/django/test/coverage_report/templates/__init__.py b/django/test/coverage_report/templates/__init__.py deleted file mode 100644 index 2d6f79d98f..0000000000 --- a/django/test/coverage_report/templates/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - - diff --git a/django/test/coverage_report/templates/default_module_detail.py b/django/test/coverage_report/templates/default_module_detail.py deleted file mode 100644 index e942bf0454..0000000000 --- a/django/test/coverage_report/templates/default_module_detail.py +++ /dev/null @@ -1,193 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -TOP = """\ - - - - - Test coverage report: %(title)s - - - - -""" - -NAV = """\ - -""" - -NAV_NO_PREV = """\ - -""" - -NAV_NO_NEXT = """\ - -""" - -CONTENT_HEADER = """\ -
-

- %(title)s: - %(total_count)d total statements, - %(percent_covered)0.1f%% covered -

-

Generated: %(test_timestamp)s

-

Source file: %(source_file)s

-

- Stats: - %(executed_count)d executed, - %(missed_count)d missed, - %(excluded_count)d excluded, - %(ignored_count)d ignored -

-
-""" - -CONTENT_BODY = """\ -
-
    - %(source_lines)s -
-
-""" - -SOURCE_LINE = '
  • %(source_line)s
  • ' - -BOTTOM = """\ - - -""" diff --git a/django/test/coverage_report/templates/default_module_errors.py b/django/test/coverage_report/templates/default_module_errors.py deleted file mode 100644 index 2c8c4a6ed9..0000000000 --- a/django/test/coverage_report/templates/default_module_errors.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -from default_module_exceptions import * - -title = "error packages and modules" - -TOP = TOP %vars() -CONTENT_HEADER = CONTENT_HEADER %vars() - diff --git a/django/test/coverage_report/templates/default_module_exceptions.py b/django/test/coverage_report/templates/default_module_exceptions.py deleted file mode 100644 index ff4eab8a1e..0000000000 --- a/django/test/coverage_report/templates/default_module_exceptions.py +++ /dev/null @@ -1,89 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import time - -test_timestamp = time.strftime('%a %Y-%m-%d %H:%M %Z') - -TOP = """\ - - - - - Test coverage report: %(title)s - - - - -""" - -CONTENT_HEADER = """\ -
    -

    Test Coverage Report: %(title)s

    """ -CONTENT_HEADER += "

    Generated: %(test_timestamp)s

    " %vars() -CONTENT_HEADER += "
    " - -CONTENT_BODY = """\ -
    -

    %(long_desc)s

    - - Back to index. -
    -""" - -EXCEPTION_LINE = "
  • %(module_name)s
  • " - -BOTTOM = """\ - - -""" diff --git a/django/test/coverage_report/templates/default_module_excludes.py b/django/test/coverage_report/templates/default_module_excludes.py deleted file mode 100644 index 66e951c65d..0000000000 --- a/django/test/coverage_report/templates/default_module_excludes.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -from default_module_exceptions import * - -title = "excluded packages and modules" - -TOP = TOP %vars() -CONTENT_HEADER = CONTENT_HEADER %vars() - diff --git a/django/test/coverage_report/templates/default_module_index.py b/django/test/coverage_report/templates/default_module_index.py deleted file mode 100644 index 1e76d57f56..0000000000 --- a/django/test/coverage_report/templates/default_module_index.py +++ /dev/null @@ -1,195 +0,0 @@ -""" -Copyright 2009 55 Minutes (http://www.55minutes.com) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -TOP = """\ - - - - - Test coverage report - - - - -""" - -CONTENT_HEADER = """\ -
    -

    Test Coverage Report

    -

    Generated: %(test_timestamp)s

    -
    -""" - -CONTENT_BODY = """\ -
    - - - - - - - - - - - - - - - - - - - - - - - - - %(module_stats)s - -
     Statements
    Moduletotalexecutedexcluded%% covered
    Total%(total_lines)d%(total_executed)d%(total_excluded)d%(overall_covered)0.1f%%
    -
    -""" - -MODULE_STAT = """\ - - %(module_name)s - %(total_count)d - %(executed_count)d - %(excluded_count)d - %(percent_covered)0.1f%% - -""" - -EXCEPTIONS_LINK = """\ -
    - - %(exception_desc)s - -
    -""" - -BOTTOM = """\ - - -""" diff --git a/django/test/test_coverage.py b/django/test/test_coverage.py index 6570336bfc..f173bff480 100644 --- a/django/test/test_coverage.py +++ b/django/test/test_coverage.py @@ -6,7 +6,6 @@ from django.db.models import get_app, get_apps from django.test.simple import DefaultTestRunner as base_run_tests from django.utils.module_tools import get_all_modules -#from django.test.coverage_report import html_report from django.utils.translation import ugettext as _ def _get_app_package(app_model_module):