Assert that works in release mode. Accepts callable msg to allow deferring evaluation until failure. The Python built-in ``assert`` does not work when executing code in optimized mode (the ``-O`` flag) - no byte-code is generated for it. For documentation on usage, refer to th
(val, msg='')
| 112 | == "1.79769313486231580793728971405301e+308") |
| 113 | |
| 114 | def assert_(val, msg=''): |
| 115 | """ |
| 116 | Assert that works in release mode. |
| 117 | Accepts callable msg to allow deferring evaluation until failure. |
| 118 | |
| 119 | The Python built-in ``assert`` does not work when executing code in |
| 120 | optimized mode (the ``-O`` flag) - no byte-code is generated for it. |
| 121 | |
| 122 | For documentation on usage, refer to the Python documentation. |
| 123 | |
| 124 | """ |
| 125 | __tracebackhide__ = True # Hide traceback for py.test |
| 126 | if not val: |
| 127 | try: |
| 128 | smsg = msg() |
| 129 | except TypeError: |
| 130 | smsg = msg |
| 131 | raise AssertionError(smsg) |
| 132 | |
| 133 | |
| 134 | if os.name == 'nt': |
no outgoing calls
searching dependent graphs…