#17054: Django test suite does not run if gettext not installed
-----------------------------------+--------------------
Reporter: jsdalton | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version: SVN
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------
This commit:
https://github.com/django/django/commit/5cc3dad1181745dc46af7b3494c0db7f8800fbd4#diff-25
Converts the import of commands.tests in regression_tests/i18n from a *
import to an explicit list.
The problem is that those tests are conditionally imported in
commands.tests based on whether the user has certain commands installed on
their command line (xgettext and msgfmt to be exact). If those commands
are not installed, the tests aren't loaded and the import in the main
i18n.tests file fails. The result is that it's not possible to run the
test suite:
{{{
$ ./runtests.py --settings=test_sqlite i18n
Traceback (most recent call last):
File "./runtests.py", line 286, in <module>
failures = django_tests(int(options.verbosity), options.interactive,
options.failfast, args)
File "./runtests.py", line 153, in django_tests
failures = test_runner.run_tests(test_labels, extra_tests=extra_tests)
File
"/Users/jsdalton/webs/testproject/src/django/django/test/simple.py", line
353, in run_tests
suite = self.build_suite(test_labels, extra_tests)
File
"/Users/jsdalton/webs/testproject/src/django/django/test/simple.py", line
243, in build_suite
suite.addTest(build_suite(app))
File
"/Users/jsdalton/webs/testproject/src/django/django/test/simple.py", line
72, in build_suite
test_module = get_tests(app_module)
File
"/Users/jsdalton/webs/testproject/src/django/django/test/simple.py", line
33, in get_tests
test_module = import_module('.'.join(prefix + [TEST_MODULE]))
File
"/Users/jsdalton/webs/testproject/src/django/django/utils/importlib.py",
line 35, in import_module
__import__(name)
File
"/Users/jsdalton/webs/testproject/src/django/tests/regressiontests/i18n/tests.py",
line 25, in <module>
from .commands.tests import NoWrapExtractorTests,
IgnoredExtractorTests, MessageCompilationTests, PoFileTests,
BasicExtractorTests, JavascriptExtractorTests,
CopyPluralFormsExtractorTests, SymlinkExtractorTests, ExtractorTests
ImportError: cannot import name NoWrapExtractorTests
}}}
Easy fix is convert this line back to a * import. Better fix is....???
I'll think about it.
--
Ticket URL: <https://code.djangoproject.com/ticket/17054>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.