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

zopefoundation / zope.component / 3829079989

pending completion
3829079989

push

github

Jens Vagelpohl
- prepare release 5.1.0

467 of 489 branches covered (95.5%)

Branch coverage included in aggregate %.

4620 of 4625 relevant lines covered (99.89%)

1.0 hits per line

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

87.5
/src/zope/component/tests/__init__.py
1
import unittest
1✔
2

3
def skipIfNoSecurity(testfunc):
1✔
4
    from zope.component._compat import ZOPE_SECURITY_NOT_AVAILABLE_EX
1✔
5

6
    try:
1✔
7
        import zope.security
1✔
8
    except ZOPE_SECURITY_NOT_AVAILABLE_EX: # pragma: no cover
9
        return unittest.skip("zope.security not installed")(testfunc)
10
    return testfunc
1✔
11

12
def fails_if_called(test, msg="This function must not be called.",
1✔
13
                    arguments=True):
14
    """
15
    Return a new function (accepting any arguments)
16
    that will call test.fail(msg) if it is called.
17

18
    :keyword bool arguments: If set to ``False``, then we will
19
        not accept any arguments. This can avoid
20
        masking when we would expect a TypeError to be raised by
21
        calling an instance method against a class.
22
    """
23
    if not arguments:
1✔
24
        return lambda: test.fail(msg)
1!
25
    return lambda *_args, **__kwargs: test.fail(msg)
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