File: base.py

package info (click to toggle)
pympler 0.9%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,172 kB
  • sloc: python: 9,943; javascript: 2,775; makefile: 21
file content (20 lines) | stat: -rw-r--r-- 405 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""
Base functionality for Pympler tests.
"""

import sys


def disable(func):
    """
    Decorator to deactivate a test method.
    The test is still run if the test module is invoked directly.
    """

    def _exclude(self, *args, **kwargs):
        if 'runtest.py' in sys.argv[0]:
            sys.stderr.write("(disabled) ")
        else:
            func(self, *args, **kwargs)

    return _exclude