Commit Graph

7 Commits

Author SHA1 Message Date
Foo c30383a194 Move Python tests.* modules to tests/modules, rename tests/path 2017-04-30 16:02:04 +03:00
ZyX 06211cbe63 Unify imports
Now imports follow the following structure:

1. __future__ line: exactly one line allowed:

        from __future__ import (unicode_literals, division, absolute_import, print_function)

   (powerline.shell is the only exception due to problems with argparse).
2. Standard python library imports in a form `import X`.
3. Standard python library imports in a form `from X import Y`.
4. and 5. 2. and 3. for third-party (non-python and non-powerline imports).
6. 3. for powerline non-test imports.
7. and 8. 2. and 3. for powerline testing module imports.

Each list entry is separated by exactly one newline from another import. If
there is module docstring it goes between `# vim:` comment and `__future__`
import. So the structure containing all items is the following:

    #!/usr/bin/env python
    # vim:fileencoding=utf-8:noet

    '''Powerline super module'''

    import sys

    from argparse import ArgumentParser

    import psutil

    from colormath.color_diff import delta_e_cie2000

    from powerline.lib.unicode import u

    import tests.vim as vim_module

    from tests import TestCase

.
2014-09-01 00:25:24 +04:00
ZyX 5b8b3599be Fix tests on python-2.6 2013-04-06 19:01:59 +04:00
Kim Silkebækken 111eaa27e8 Combine vim modelines and Python encoding declarations
Ref #314
2013-03-11 10:40:09 +01:00
Kim Silkebækken 6748701fcb Add vim modelines to all Python files
Added with `sed -i '2i# vim:fenc=utf-8:noet' `find -name '*.py'`` and
fixed in a couple of files without the UTF-8 encoding on top.

Ref #314
2013-03-11 08:11:25 +01:00
ZyX aa0a8bf76d Make tests support python2.6
Old unittest is not working for unknown reason, using unittest2 instead
2013-03-03 21:03:40 +01:00
ZyX 584755765b Start adding tests
Tests are temporary disabled on all branches except tests (does not really work
though, needs travis.yml in all branches).
2013-03-03 21:03:19 +01:00