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

zopefoundation / grokcore.component / 15269013351

27 May 2025 07:17AM UTC coverage: 96.224% (-0.2%) from 96.406%
15269013351

push

github

web-flow
Configuring for pure-python. (#22)

113 of 136 branches covered (83.09%)

Branch coverage included in aggregate %.

0 of 1 new or added line in 1 file covered. (0.0%)

2 existing lines in 1 file now uncovered.

1416 of 1453 relevant lines covered (97.45%)

0.97 hits per line

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

93.62
/src/grokcore/component/tests/test_grok.py
1
import doctest
1✔
2
import traceback
1✔
3
import unittest
1✔
4

5
from pkg_resources import resource_listdir
1✔
6

7
import zope.component.eventtesting
1✔
8
from zope.testing import cleanup
1✔
9

10

11
def setUpZope(test):
1✔
12
    zope.component.eventtesting.setUp(test)
1✔
13

14

15
def cleanUpZope(test):
1✔
16
    cleanup.cleanUp()
1✔
17

18

19
def suiteFromPackage(name):
1✔
20
    files = resource_listdir(__name__, name)
1✔
21
    suite = unittest.TestSuite()
1✔
22
    for filename in files:
1✔
23
        if not filename.endswith('.py'):
1✔
24
            continue
1✔
25
        if filename.endswith('_fixture.py'):
1✔
26
            continue
1✔
27
        if filename == '__init__.py':
1✔
28
            continue
1✔
29

30
        dottedname = f'grokcore.component.tests.{name}.{filename[:-3]}'
1✔
31
        try:
1✔
32
            test = doctest.DocTestSuite(
1✔
33
                dottedname,
34
                setUp=setUpZope,
35
                tearDown=cleanUpZope,
36
                optionflags=doctest.ELLIPSIS
37
                | doctest.NORMALIZE_WHITESPACE
38
                | doctest.IGNORE_EXCEPTION_DETAIL)
NEW
39
        except ModuleNotFoundError:  # or should this accept anything?
×
UNCOV
40
            traceback.print_exc()
×
UNCOV
41
            raise
×
42
        suite.addTest(test)
1✔
43
    return suite
1✔
44

45

46
def test_suite():
1✔
47
    suite = unittest.TestSuite()
1✔
48
    for name in ['adapter', 'directive', 'grokker', 'utility', 'view',
1✔
49
                 'event', 'inherit', 'order', 'subscriptions', 'zcml']:
50
        suite.addTest(suiteFromPackage(name))
1✔
51

52
    api = doctest.DocFileSuite('api.txt')
1✔
53
    suite.addTest(api)
1✔
54

55
    # this test cannot follow the normal testing pattern, as the
56
    # bug it tests for is only exposed in the context of a doctest
57
    grok_component = doctest.DocFileSuite('grok_component.txt',
1✔
58
                                          setUp=setUpZope,
59
                                          tearDown=cleanUpZope)
60
    suite.addTest(grok_component)
1✔
61
    return suite
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