File: utils.py

package info (click to toggle)
py-stringmatching 0.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,956 kB
  • sloc: python: 3,979; makefile: 174; sh: 7
file content (8 lines) | stat: -rw-r--r-- 239 bytes parent folder | download
1
2
3
4
5
6
7
8
# Simplified knockoff of nose.tools.raises
def raises(exc_type):
    def deco(f):
        def raises_wrapper(self):
            with self.assertRaises(exc_type):
                return f(self)
        return raises_wrapper
    return deco