MCPcopy Create free account
hub / github.com/numpy/numpy / test_debug_print

Function test_debug_print

numpy/core/tests/test_nditer.py:3270–3348  ·  view source on GitHub ↗

Matches the expected output of a debug print with the actual output. Note that the iterator dump should not be considered stable API, this test is mainly to ensure the print does not crash. Currently uses a subprocess to avoid dealing with the C level `printf`s.

(capfd)

Source from the content-addressed store, hash-verified

3268
3269
3270def test_debug_print(capfd):
3271 """
3272 Matches the expected output of a debug print with the actual output.
3273 Note that the iterator dump should not be considered stable API,
3274 this test is mainly to ensure the print does not crash.
3275
3276 Currently uses a subprocess to avoid dealing with the C level `printf`s.
3277 """
3278 # the expected output with all addresses and sizes stripped (they vary
3279 # and/or are platform dependent).
3280 expected = """
3281 ------ BEGIN ITERATOR DUMP ------
3282 | Iterator Address:
3283 | ItFlags: BUFFER REDUCE REUSE_REDUCE_LOOPS
3284 | NDim: 2
3285 | NOp: 2
3286 | IterSize: 50
3287 | IterStart: 0
3288 | IterEnd: 50
3289 | IterIndex: 0
3290 | Iterator SizeOf:
3291 | BufferData SizeOf:
3292 | AxisData SizeOf:
3293 |
3294 | Perm: 0 1
3295 | DTypes:
3296 | DTypes: dtype('float64') dtype('int32')
3297 | InitDataPtrs:
3298 | BaseOffsets: 0 0
3299 | Operands:
3300 | Operand DTypes: dtype('int64') dtype('float64')
3301 | OpItFlags:
3302 | Flags[0]: READ CAST ALIGNED
3303 | Flags[1]: READ WRITE CAST ALIGNED REDUCE
3304 |
3305 | BufferData:
3306 | BufferSize: 50
3307 | Size: 5
3308 | BufIterEnd: 5
3309 | REDUCE Pos: 0
3310 | REDUCE OuterSize: 10
3311 | REDUCE OuterDim: 1
3312 | Strides: 8 4
3313 | Ptrs:
3314 | REDUCE Outer Strides: 40 0
3315 | REDUCE Outer Ptrs:
3316 | ReadTransferFn:
3317 | ReadTransferData:
3318 | WriteTransferFn:
3319 | WriteTransferData:
3320 | Buffers:
3321 |
3322 | AxisData[0]:
3323 | Shape: 5
3324 | Index: 0
3325 | Strides: 16 8
3326 | Ptrs:
3327 | AxisData[1]:

Callers

nothing calls this directly

Calls 4

splitlinesMethod · 0.80
stripMethod · 0.80
reshapeMethod · 0.80
startswithMethod · 0.80

Tested by

no test coverage detected