| 339 | |
| 340 | |
| 341 | def _check_basic_tracing(): |
| 342 | import pydevd_tracing |
| 343 | |
| 344 | # Note: run this test in a separate process so that it doesn't mess with any current tracing |
| 345 | # in our current process. |
| 346 | called = [0] |
| 347 | |
| 348 | def tracing_func(frame, event, args): |
| 349 | called[0] = called[0] + 1 |
| 350 | return tracing_func |
| 351 | |
| 352 | assert pydevd_tracing.set_trace_to_threads(tracing_func) == 0 |
| 353 | |
| 354 | def foo(): |
| 355 | pass |
| 356 | |
| 357 | foo() |
| 358 | assert called[0] > 2 |
| 359 | |
| 360 | |
| 361 | @pytest.mark.skipif(not IS_CPYTHON, reason="Functionality to trace other threads requires CPython.") |