• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zopefoundation / z3c.form / 5104192483

pending completion
5104192483

push

github

web-flow
Config with pure python template (#114)

* Bumped version for breaking release.

* Drop support for Python 2.7, 3.5, 3.6.

* Add support for Python 3.11.

1316 of 1408 branches covered (93.47%)

Branch coverage included in aggregate %.

420 of 420 new or added lines in 39 files covered. (100.0%)

3716 of 3838 relevant lines covered (96.82%)

0.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.96
/src/z3c/form/browser/tests.py
1
##############################################################################
2
#
3
# Copyright (c) 2007 Zope Foundation and Contributors.
4
# All Rights Reserved.
5
#
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE.
12
#
13
##############################################################################
14
"""
1✔
15
$Id$
16
"""
17
__docformat__ = "reStructuredText"
1✔
18

19
import doctest
1✔
20
import itertools
1✔
21
import unittest
1✔
22
from doctest import DocFileSuite
1✔
23

24
from z3c.form import testing
1✔
25

26

27
Z3CPT_AVAILABLE = False
1✔
28
try:
1✔
29
    import z3c.pt
1✔
30
    import z3c.ptcompat  # noqa: F401 imported but unused
×
31
except ImportError:
32
    Z3CPT_AVAILABLE = False
33

34

35
def test_suite():
1✔
36
    flags = \
1✔
37
        doctest.NORMALIZE_WHITESPACE | \
38
        doctest.ELLIPSIS | \
39
        doctest.IGNORE_EXCEPTION_DETAIL
40

41
    # This package will setup z3c.pt support for testing by default.
42
    # The Z3CPT_AVAILABLE option allows to run z3c.form test from a
43
    # custom setup which doesn't use z3c.pt. But do we really need this?
44
    # I guess not or is there a reason to support this?
45
    if Z3CPT_AVAILABLE:
1!
46
        setups = (testing.setUpZPT, testing.setUpZ3CPT)
×
47
    else:
48
        setups = (testing.setUpZPT, )
1✔
49

50
    tests = ((
1✔
51
        DocFileSuite('README.rst',
52
                     setUp=setUp, tearDown=testing.tearDown,
53
                     optionflags=flags, checker=testing.outputChecker,
54
                     ),
55
        DocFileSuite('button.rst',
56
                     setUp=setUp, tearDown=testing.tearDown,
57
                     optionflags=flags, checker=testing.outputChecker,
58
                     ),
59
        DocFileSuite('checkbox.rst',
60
                     setUp=setUp, tearDown=testing.tearDown,
61
                     optionflags=flags, checker=testing.outputChecker,
62
                     ),
63
        DocFileSuite('file.rst',
64
                     setUp=setUp, tearDown=testing.tearDown,
65
                     optionflags=flags, checker=testing.outputChecker,
66
                     ),
67
        DocFileSuite('file-testing.rst',
68
                     setUp=setUp, tearDown=testing.tearDown,
69
                     optionflags=flags, checker=testing.outputChecker,
70
                     ),
71
        DocFileSuite('image.rst',
72
                     setUp=setUp, tearDown=testing.tearDown,
73
                     optionflags=flags, checker=testing.outputChecker,
74
                     ),
75
        DocFileSuite('orderedselect.rst',
76
                     setUp=setUp, tearDown=testing.tearDown,
77
                     optionflags=flags, checker=testing.outputChecker,
78
                     ),
79
        DocFileSuite('password.rst',
80
                     setUp=setUp, tearDown=testing.tearDown,
81
                     optionflags=flags, checker=testing.outputChecker,
82
                     ),
83
        DocFileSuite('radio.rst',
84
                     setUp=setUp, tearDown=testing.tearDown,
85
                     optionflags=flags, checker=testing.outputChecker,
86
                     ),
87
        DocFileSuite('select.rst',
88
                     setUp=setUp, tearDown=testing.tearDown,
89
                     optionflags=flags, checker=testing.outputChecker,
90
                     ),
91
        DocFileSuite('select-missing-terms.rst',
92
                     setUp=setUp, tearDown=testing.tearDown,
93
                     optionflags=flags, checker=testing.outputChecker,
94
                     ),
95
        DocFileSuite('select-source.rst',
96
                     setUp=setUp, tearDown=testing.tearDown,
97
                     optionflags=flags, checker=testing.outputChecker,
98
                     ),
99
        DocFileSuite('submit.rst',
100
                     setUp=setUp, tearDown=testing.tearDown,
101
                     optionflags=flags, checker=testing.outputChecker,
102
                     ),
103
        DocFileSuite('text.rst',
104
                     setUp=setUp, tearDown=testing.tearDown,
105
                     optionflags=flags, checker=testing.outputChecker,
106
                     ),
107
        DocFileSuite('textarea.rst',
108
                     setUp=setUp, tearDown=testing.tearDown,
109
                     optionflags=flags, checker=testing.outputChecker,
110
                     ),
111
        DocFileSuite('textlines.rst',
112
                     setUp=setUp, tearDown=testing.tearDown,
113
                     optionflags=flags, checker=testing.outputChecker,
114
                     ),
115
        DocFileSuite('object.rst',
116
                     setUp=setUp, tearDown=testing.tearDown,
117
                     optionflags=flags, checker=testing.outputChecker,
118
                     ),
119
        DocFileSuite('objectmulti.rst',
120
                     setUp=setUp, tearDown=testing.tearDown,
121
                     optionflags=flags, checker=testing.outputChecker,
122
                     ),
123
        DocFileSuite('multi.rst',
124
                     setUp=setUp, tearDown=testing.tearDown,
125
                     optionflags=flags, checker=testing.outputChecker,
126
                     ))
127
             for setUp in setups)
128

129
    integtests = (
1✔
130
        DocFileSuite('object_single_integration.rst',
131
                     setUp=testing.setUpIntegration, tearDown=testing.tearDown,
132
                     optionflags=flags, checker=testing.outputChecker,
133
                     ),
134
        DocFileSuite('object_multi_dict_integration.rst',
135
                     setUp=testing.setUpIntegration, tearDown=testing.tearDown,
136
                     optionflags=flags, checker=testing.outputChecker,
137
                     ),
138
        DocFileSuite('object_multi_list_integration.rst',
139
                     setUp=testing.setUpIntegration, tearDown=testing.tearDown,
140
                     optionflags=flags, checker=testing.outputChecker,
141
                     ),
142
        DocFileSuite('multi_dict_integration.rst',
143
                     setUp=testing.setUpIntegration, tearDown=testing.tearDown,
144
                     optionflags=flags, checker=testing.outputChecker,
145
                     ),
146
        DocFileSuite('multi_list_integration.rst',
147
                     setUp=testing.setUpIntegration, tearDown=testing.tearDown,
148
                     optionflags=flags, checker=testing.outputChecker,
149
                     ),
150
    )
151

152
    return unittest.TestSuite(tuple(itertools.chain(*tests)) + integtests)
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc