$71 GRAYBYTE WORDPRESS FILE MANAGER $91

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

/opt/hc_python/lib/python3.12/site-packages/nose/plugins/

HOME
Current File : /opt/hc_python/lib/python3.12/site-packages/nose/plugins//debug.py
"""
This plugin provides ``--pdb`` and ``--pdb-failures`` options. The ``--pdb``
option will drop the test runner into pdb when it encounters an error. To
drop into pdb on failure, use ``--pdb-failures``.
"""

import pdb
from nose.plugins.base import Plugin

class Pdb(Plugin):
    """
    Provides --pdb and --pdb-failures options that cause the test runner to
    drop into pdb if it encounters an error or failure, respectively.
    """
    enabled_for_errors = False
    enabled_for_failures = False
    score = 5 # run last, among builtins
    
    def options(self, parser, env):
        """Register commandline options.
        """
        parser.add_option(
            "--pdb", action="store_true", dest="debugBoth",
            default=env.get('NOSE_PDB', False),
            help="Drop into debugger on failures or errors")
        parser.add_option(
            "--pdb-failures", action="store_true",
            dest="debugFailures",
            default=env.get('NOSE_PDB_FAILURES', False),
            help="Drop into debugger on failures")
        parser.add_option(
            "--pdb-errors", action="store_true",
            dest="debugErrors",
            default=env.get('NOSE_PDB_ERRORS', False),
            help="Drop into debugger on errors")

    def configure(self, options, conf):
        """Configure which kinds of exceptions trigger plugin.
        """
        self.conf = conf
        self.enabled_for_errors = options.debugErrors or options.debugBoth
        self.enabled_for_failures = options.debugFailures or options.debugBoth
        self.enabled = self.enabled_for_failures or self.enabled_for_errors

    def addError(self, test, err):
        """Enter pdb if configured to debug errors.
        """
        if not self.enabled_for_errors:
            return
        self.debug(err)

    def addFailure(self, test, err):
        """Enter pdb if configured to debug failures.
        """
        if not self.enabled_for_failures:
            return
        self.debug(err)

    def debug(self, err):
        import sys # FIXME why is this import here?
        ec, ev, tb = err
        stdout = sys.stdout
        sys.stdout = sys.__stdout__
        try:
            pdb.post_mortem(tb)
        finally:
            sys.stdout = stdout


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Apr 2025 8.03 AM
root / root
0755
__pycache__
--
4 Apr 2025 8.03 AM
root / root
0755
__init__.py
6.144 KB
4 Apr 2025 8.03 AM
root / root
0644
allmodules.py
1.68 KB
4 Apr 2025 8.03 AM
root / root
0644
attrib.py
9.481 KB
4 Apr 2025 8.03 AM
root / root
0644
base.py
25.447 KB
4 Apr 2025 8.03 AM
root / root
0644
builtin.py
0.997 KB
4 Apr 2025 8.03 AM
root / root
0644
capture.py
3.285 KB
4 Apr 2025 8.03 AM
root / root
0644
collect.py
3.082 KB
4 Apr 2025 8.03 AM
root / root
0644
cover.py
11.403 KB
4 Apr 2025 8.03 AM
root / root
0644
debug.py
2.219 KB
4 Apr 2025 8.03 AM
root / root
0644
deprecated.py
1.515 KB
4 Apr 2025 8.03 AM
root / root
0644
doctests.py
17.068 KB
4 Apr 2025 8.03 AM
root / root
0644
errorclass.py
7.104 KB
4 Apr 2025 8.03 AM
root / root
0644
failuredetail.py
1.597 KB
4 Apr 2025 8.03 AM
root / root
0644
isolate.py
3.668 KB
4 Apr 2025 8.03 AM
root / root
0644
logcapture.py
9.139 KB
4 Apr 2025 8.03 AM
root / root
0644
manager.py
15.212 KB
4 Apr 2025 8.03 AM
root / root
0644
multiprocess.py
34.459 KB
4 Apr 2025 8.03 AM
root / root
0644
plugintest.py
13.216 KB
4 Apr 2025 8.03 AM
root / root
0644
prof.py
5.231 KB
4 Apr 2025 8.03 AM
root / root
0644
skip.py
2.092 KB
4 Apr 2025 8.03 AM
root / root
0644
testid.py
9.685 KB
4 Apr 2025 8.03 AM
root / root
0644
xunit.py
11.372 KB
4 Apr 2025 8.03 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF