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

zopefoundation / z3c.form / 16248976312

02 Jul 2025 05:53AM UTC coverage: 95.275%. Remained the same
16248976312

push

github

icemac
Back to development: 6.1

717 of 800 branches covered (89.63%)

Branch coverage included in aggregate %.

3699 of 3835 relevant lines covered (96.45%)

0.96 hits per line

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

85.71
/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
import doctest
1✔
15
import itertools
1✔
16
import unittest
1✔
17
from doctest import DocFileSuite
1✔
18

19
from z3c.form import testing
1✔
20

21

22
Z3CPT_AVAILABLE = False
1✔
23
try:
1✔
24
    import z3c.pt
1✔
25
    import z3c.ptcompat  # noqa: F401 imported but unused
×
26
except ModuleNotFoundError:
1✔
27
    Z3CPT_AVAILABLE = False
1✔
28

29

30
def test_suite():
1✔
31
    flags = \
1✔
32
        doctest.NORMALIZE_WHITESPACE | \
33
        doctest.ELLIPSIS | \
34
        doctest.IGNORE_EXCEPTION_DETAIL
35

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

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

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

147
    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