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

zopefoundation / zope.testbrowser / 16098871825

05 Mar 2025 04:01PM UTC coverage: 91.403%. Remained the same
16098871825

push

github

icemac
Back to development: 7.1

427 of 520 branches covered (82.12%)

Branch coverage included in aggregate %.

1859 of 1981 relevant lines covered (93.84%)

0.94 hits per line

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

100.0
/src/zope/testbrowser/testing.py
1
##############################################################################
2
#
3
# Copyright (c) 2005 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
"""BBB for Zope 3-specific testing code
15
"""
16

17
from wsgiref.simple_server import demo_app as wsgiref_demo_app
1✔
18

19

20
class Browser:
1✔
21
    """zope.testbrowser.testing.Browser is no longer supported.
22

23
    Please use zope.testbrowser.wsgi.Browser() in conjuction with
24
    zope.app.wsgi.testlayer.BrowserLayer(), or some other custom test layer
25
    that inherits from zope.testbrowser.wsgi.Layer.
26

27
    Alternatively pin zope.testbrowser version to < 5.0.0 if you don't care
28
    for Python 3 support and don't have the time to update your tests now.
29
    """
30

31
    def __init__(self, *args, **kw):
1✔
32
        raise NotImplementedError(self.__doc__)
33

34

35
def demo_app(environ, start_response):
1✔
36
    """PEP-3333 compatible demo app, that will never return unicode
37
    """
38
    refout = wsgiref_demo_app(environ, start_response)
1✔
39
    return [s if isinstance(s, bytes) else s.encode('utf-8') for s in refout]
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