import locale import unittest as ut def setuptools_load_tests(): """This function should be set as ``test_suite`` in ``setup.py``. Setuptools doesn't honor ``load_tests`` protocol and would import test from a package many times, if told that the ``test_suite`` is a package, so it needs to be pointed to a function which does the importing. Also, make sure sorting locale is Polish """ locale.setlocale(locale.LC_COLLATE, ('pl_PL', 'UTF-8')) return ut.defaultTestLoader.discover('tests/cases', top_level_dir='tests')