File: test_optional.py

package info (click to toggle)
python-astor 0.8.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 372 kB
  • sloc: python: 2,357; makefile: 4
file content (40 lines) | stat: -rw-r--r-- 947 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
Part of the astor library for Python AST manipulation

License: 3-clause BSD

Copyright (c) 2014 Berker Peksag
Copyright (c) 2015, 2017 Patrick Maupin

Use this by putting a link to astunparse's common.py test file.

"""

try:
    import unittest2 as unittest
except ImportError:
    import unittest

try:
    from test_code_gen import Comparisons
except ImportError:
    from .test_code_gen import Comparisons

try:
    from astunparse_common import AstunparseCommonTestCase
except ImportError:
    AstunparseCommonTestCase = None

if AstunparseCommonTestCase is not None:

    class UnparseTestCase(AstunparseCommonTestCase, unittest.TestCase,
                          Comparisons):
    
        def check_roundtrip(self, code1, mode=None):
            self.assertAstRoundtrips(code1)

        def test_files(self):
            """ Don't bother -- we do this manually and more thoroughly """

if __name__ == '__main__':
    unittest.main()