mintchaos / typogrify

A set of Django template filters to make caring about typography on the web a bit easier.
http://static.mintchaos.com/projects/typogrify/
Other
168 stars 29 forks source link

2.0.7: test suite is failing #55

Closed kloczek closed 3 years ago

kloczek commented 3 years ago

I'm trying to implement executing typogrify test suite during building package and I cannot finmd details about how to do that. May I ask for some hints/guideline?

+ cd typogrify-2.0.7
+ /usr/bin/python3 setup.py test
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing typogrify.egg-info/PKG-INFO
writing dependency_links to typogrify.egg-info/dependency_links.txt
writing requirements to typogrify.egg-info/requires.txt
writing top-level names to typogrify.egg-info/top_level.txt
reading manifest file 'typogrify.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'typogrify.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    setup(
  File "/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.8/site-packages/setuptools/command/test.py", line 238, in run
    self.run_tests()
  File "/usr/lib/python3.8/site-packages/setuptools/command/test.py", line 256, in run_tests
    test = unittest.main(
  File "/usr/lib64/python3.8/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/usr/lib64/python3.8/unittest/main.py", line 124, in parseArgs
    self._do_discovery(argv[2:])
  File "/usr/lib64/python3.8/unittest/main.py", line 244, in _do_discovery
    self.createTests(from_discovery=True, Loader=Loader)
  File "/usr/lib64/python3.8/unittest/main.py", line 154, in createTests
    self.test = loader.discover(self.start, self.pattern, self.top)
  File "/usr/lib64/python3.8/unittest/loader.py", line 349, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File "/usr/lib64/python3.8/unittest/loader.py", line 405, in _find_tests
    tests, should_recurse = self._find_test_path(
  File "/usr/lib64/python3.8/unittest/loader.py", line 483, in _find_test_path
    tests = self.loadTestsFromModule(package, pattern=pattern)
  File "/usr/lib/python3.8/site-packages/setuptools/command/test.py", line 55, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/usr/lib64/python3.8/unittest/loader.py", line 191, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/usr/lib/python3.8/site-packages/setuptools/command/test.py", line 55, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/usr/lib64/python3.8/unittest/loader.py", line 191, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/usr/lib/python3.8/site-packages/setuptools/command/test.py", line 41, in loadTestsFromModule
    tests.append(TestLoader.loadTestsFromModule(self, module))
  File "/usr/lib64/python3.8/unittest/loader.py", line 123, in loadTestsFromModule
    if isinstance(obj, type) and issubclass(obj, case.TestCase):
  File "/usr/lib/python3.8/site-packages/django/utils/functional.py", line 240, in inner
    self._setup()
  File "/usr/lib/python3.8/site-packages/django/conf/__init__.py", line 63, in _setup
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Requested settings, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
justinmayer commented 3 years ago

Hi Tomasz. 👋

  1. You can always have a look at the CI configuration to see how the tests are run.
  2. The canonical command to run the tests for this project will likely change once I've had time to review and merge https://github.com/mintchaos/typogrify/pull/53.
  3. Thanks for pointing out the need to add documentation for how to run the tests. I'll try to remember to add that once the above PR is merged.
kloczek commented 3 years ago

OK, it works. Thx :) Closing.

justinmayer commented 3 years ago

New canonical command as of a few minutes ago:

pytest -v --doctest-modules typogrify/filters.py typogrify/packages/titlecase/tests.py