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

zopefoundation / grokcore.component / 16098871523

18 Jun 2025 06:24AM UTC coverage: 96.224%. Remained the same
16098871523

push

github

icemac
Back to development: 5.1

113 of 136 branches covered (83.09%)

Branch coverage included in aggregate %.

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

81.82
/src/grokcore/component/tests/event/errorconditions.py
1
"""
2
@grok.subscribe can only be used on module level:
3

4
  >>> function_context()
5
  Traceback (most recent call last):
6
    ...
7
  GrokImportError: @grok.subscribe can only be used on module level.
8

9
  >>> class_context()
10
  Traceback (most recent call last):
11
    ...
12
  GrokImportError: @grok.subscribe can only be used on module level.
13

14

15
@grok.subscribe can not be called without arguments:
16

17
  >>> import grokcore.component.tests.event.errorconditions_fixture
18
  Traceback (most recent call last):
19
    ...
20
  GrokImportError: @grok.subscribe requires at least one argument.
21

22
"""
23
from zope.interface.interfaces import IObjectEvent
1✔
24

25
import grokcore.component as grok
1✔
26

27

28
def function_context():
1✔
29
    @grok.subscribe(grok.Context, IObjectEvent)
1✔
30
    def subscriber():
1✔
31
        pass
×
32

33

34
def class_context():
1✔
35
    class Wrapper:
1✔
36
        @grok.subscribe(grok.Context, IObjectEvent)
1✔
37
        def subscriber(self):
1✔
38
            pass
×
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