$50 GRAYBYTE WORDPRESS FILE MANAGER $56

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.217.100
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/testfixtures/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/testfixtures//components.py
"""
Helpers for working with Zope and its components.
"""
import atexit
import warnings
from typing import Set

from zope.component import getSiteManager
from zope.interface.registry import Components


class TestComponents:
    """
    A helper for providing a sterile registry when testing
    with ``zope.component``.

    Instantiation will install an empty registry that will be returned
    by :func:`zope.component.getSiteManager`.
    """
    __test__: bool = False

    instances: Set['TestComponents'] = set()
    atexit_setup: bool = False

    def __init__(self):
        self.registry: Components = Components('Testing')
        self.old: Components = getSiteManager.sethook(lambda: self.registry)
        self.instances.add(self)
        if not self.__class__.atexit_setup:
            atexit.register(self.atexit)
            self.__class__.atexit_setup = True

    def uninstall(self):
        """
        Remove the sterile registry and replace it with the one that
        was in place before this :class:`TestComponents` was
        instantiated.
        """
        getSiteManager.sethook(self.old)
        self.instances.remove(self)

    @classmethod
    def atexit(cls):
        if cls.instances:
            warnings.warn(
                'TestComponents instances not uninstalled by shutdown!'
                )


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
9 Apr 2026 8.31 AM
root / root
0755
__pycache__
--
11 Feb 2026 9.30 AM
root / root
0755
tests
--
11 Feb 2026 9.30 AM
root / root
0755
__init__.py
1.194 KB
20 Jan 2026 1.01 PM
root / root
0644
comparison.py
39.142 KB
20 Jan 2026 1.01 PM
root / root
0644
compat.py
0.219 KB
20 Jan 2026 1.01 PM
root / root
0644
components.py
1.306 KB
20 Jan 2026 1.01 PM
root / root
0644
datetime.py
24.423 KB
20 Jan 2026 1.01 PM
root / root
0644
django.py
2.885 KB
20 Jan 2026 1.01 PM
root / root
0644
logcapture.py
10.755 KB
20 Jan 2026 1.01 PM
root / root
0644
mock.py
1.205 KB
20 Jan 2026 1.01 PM
root / root
0644
outputcapture.py
4.688 KB
20 Jan 2026 1.01 PM
root / root
0644
popen.py
9.887 KB
20 Jan 2026 1.01 PM
root / root
0644
replace.py
12.149 KB
20 Jan 2026 1.01 PM
root / root
0644
resolve.py
2.054 KB
20 Jan 2026 1.01 PM
root / root
0644
rmtree.py
2.523 KB
20 Jan 2026 1.01 PM
root / root
0644
shouldraise.py
3.578 KB
20 Jan 2026 1.01 PM
root / root
0644
shouldwarn.py
2.213 KB
20 Jan 2026 1.01 PM
root / root
0644
sybil.py
2.279 KB
20 Jan 2026 1.01 PM
root / root
0644
tempdirectory.py
12.887 KB
20 Jan 2026 1.01 PM
root / root
0644
twisted.py
4.8 KB
20 Jan 2026 1.01 PM
root / root
0644
utils.py
2.737 KB
20 Jan 2026 1.01 PM
root / root
0644
version.txt
0.006 KB
20 Jan 2026 1.01 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF