MCPcopy Create free account
hub / github.com/ipython/ipython / as_unittest

Function as_unittest

IPython/testing/decorators.py:57–65  ·  view source on GitHub ↗

Decorator to make a simple function into a normal test via unittest.

(func)

Source from the content-addressed store, hash-verified

55
56# Simple example of the basic idea
57def as_unittest(func):
58 """Decorator to make a simple function into a normal test via unittest."""
59 class Tester(unittest.TestCase):
60 def test(self):
61 func()
62
63 Tester.__name__ = func.__name__
64
65 return Tester
66
67# Utility functions
68

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected