Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors encountered while using ./manage.py test #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions xmlrunner/extra/djangotestrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
in a Django project, please read the Django docs website.
"""
from django.conf import settings
from django.test.simple import DjangoTestSuiteRunner
from django.test.runner import DiscoverRunner
from django.test.utils import setup_test_environment, teardown_test_environment
import xmlrunner


class XMLTestRunner(DjangoTestSuiteRunner):
class XMLTestRunner(DiscoverRunner):
def run_tests(self, test_labels, extra_tests=None, **kwargs):
"""
Run the unit tests for all the test labels in the provided list.
Expand Down
18 changes: 9 additions & 9 deletions xmlrunner/xmlrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ def __getattr__(self, attr):
return getattr(self._captured, attr)


#def testcase_name(test_method):
# testcase = type(test_method)
#
# # Ignore module name if it is '__main__'
# module = testcase.__module__ + '.'
# if module == '__main__.':
# module = ''
# result = module + testcase.__name__
# return result
def testcase_name(test_method):
testcase = type(test_method)

# Ignore module name if it is '__main__'
module = testcase.__module__ + '.'
if module == '__main__.':
module = ''
result = module + testcase.__name__
return result


class _TestInfo(object):
Expand Down