File: base.py

package info (click to toggle)
pympler 1.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,196 kB
  • sloc: python: 9,816; javascript: 2,775; makefile: 17
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