# Path: test/util.py
# def busy_wait(duration):
#     end_time = time.time() + duration
# 
#     while time.time() < end_time:
#         do_nothing()
# 
# Path: test/low_level/util.py



import contextvars
import time
import pytest
from ..util import busy_wait
from .util import parametrize_setstatprofile




@parametrize_setstatprofile
def test_context_type(setstatprofile):
    with pytest.raises(TypeError):
        setstatprofile(lambda f, e, a: 0, 1e6, "not a context var")
        setstatprofile(None)


profiler_context_var = contextvars.ContextVar("profiler_context_var", default=None)



# Path: test/util.py
# def busy_wait(duration):
#     end_time = time.time() + duration
# 
#     while time.time() < end_time:
#         do_nothing()
# 
# Path: test/low_level/util.py



# Path: test/low_level/test_context.py
import contextvars
import time
import pytest
from ..util import busy_wait
from .util import parametrize_setstatprofile





@parametrize_setstatprofile
def test_context_type(setstatprofile):
    with pytest.raises(TypeError):
        setstatprofile(lambda f, e, a: 0, 1e6, "not a context var")
        setstatprofile(None)


profiler_context_var = contextvars.ContextVar("profiler_context_var", default=None)



@parametrize_setstatprofile