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

zopefoundation / zope.component / 4696882551

pending completion
4696882551

push

github

Michael Howitz
Preparing release 6.0

460 of 475 branches covered (96.84%)

Branch coverage included in aggregate %.

4646 of 4646 relevant lines covered (100.0%)

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

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

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

13

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

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