
    ӂe                     B    d dl Z d dlmZ  G d de j                        Zy)    N)contextc                   ,     e Zd ZdZd fdZddZ xZS )ClearRequestContexta  Clears any cached RequestContext

    This resets RequestContext at the beginning and end of tests that
    use this fixture to ensure that we have a clean slate for running
    tests, and that we leave a clean slate for other tests that might
    run later in the same process.
    c                     t         t        |           | j                          | j	                  | j                         y )N)superr   setUp_remove_cached_context
addCleanup)self	__class__s    6/usr/lib/python3/dist-packages/oslo_context/fixture.pyr   zClearRequestContext.setUp   s1    !4.0 	##%334    c                 D    	 t         j                  ` y# t        $ r Y yw xY w)z5Remove the thread-local context stored in the module.N)r   _request_storeAttributeError)r   s    r   r	   z*ClearRequestContext._remove_cached_context#   s%    	&&. 		s    	)returnN)__name__
__module____qualname____doc__r   r	   __classcell__)r   s   @r   r   r      s    5r   r   )fixturesoslo_contextr   Fixturer    r   r   <module>r      s      (** r   