
    &e                     l    d dl mZ d dlmZmZ d dlmZ d dlmZ edee	ef         fd            Z
d ZdS )	    )contextmanager)AnyDict)patch)configconfig_overridesc              #      K   t          |           }t          j        t          d|          5  dV  ddd           dS # 1 swxY w Y   dS )a  A context manager that overrides config options. It can
    also be used as a function decorator.

    Examples:
    >>> with patch_config_options({"server.headless": True}):
    ...     assert(config.get_option("server.headless") is True)
    ...     # Other test code that relies on these options

    >>> @patch_config_options({"server.headless": True})
    ... def test_my_thing():
    ...   assert(config.get_option("server.headless") is True)
    
get_option)newN)build_mock_config_get_optionr   objectr   )r   mock_get_options     9lib/python3.11/site-packages/streamlit/testing/v1/util.pypatch_config_optionsr      s       33CDDO	fl	@	@	@                   s   A  AAc                 .     t           j         fd}|S )Nc                 2    | v r|          S  |           S )N )nameorig_get_optionoverrides_dicts    r   mock_config_get_optionz<build_mock_config_get_option.<locals>.mock_config_get_option,   s)    >!!!$''t$$$    )r   r
   )r   r   r   s   ` @r   r   r   )   s2    'O% % % % % %
 "!r   N)
contextlibr   typingr   r   unittest.mockr   	streamlitr   strr   r   r   r   r   <module>r      s    & % % % % %                     4S>    $" " " " "r   