
    	]j                     B    d Z ddlZ ej                  d      d        Zy)a  
Root conftest for the label_studio package.

Ensures CurrentContext is cleared after every test to prevent leakage across tests.
With Postgres, test transactions are rolled back so User rows are removed, but
thread-local CurrentContext can still hold a stale User instance. The next test
then triggers FSM (e.g. on project save), which uses that user as triggered_by_id,
causing IntegrityError because the user row no longer exists.
    NT)autousec               #   @   K   d ddl m}  | j                          yw)zWClear thread-local CurrentContext after each test to prevent FK violations on Postgres.Nr   CurrentContext)core.current_requestr   clearr   s    ?/root/env/lib/python3.12/site-packages/label_studio/conftest.py clear_current_context_after_testr
      s      
3s   )__doc__pytestfixturer
        r	   <module>r      s.      r   