o
    i	                     @   s   d dl mZ d dlZd dlZd dlmZ d dlmZ dd Zdd Z	d	d
 Z
ejdd Zejdd Zejdd Zejdd Zejdd Zejdd ZdS )    )PathN)build_wordpiece_encoder_v1)registryc                 C   s,   z| j dddd W d S  ty   Y d S w )Nz--slow
store_truezinclude slow tests)actionhelp)	addoption
ValueError)parser r   ]/home/ubuntu/.local/lib/python3.10/site-packages/spacy_curated_transformers/tests/conftest.pypytest_addoption   s
   r   c                 C   s   |  dd d S )Nmarkerszslow: include slow tests)addinivalue_line)configr   r   r   pytest_configure   s   r   c                    s>    fdd}dD ]}| j v r||std| d qd S )Nc                    s    j d|  dS )Nz--F)r   	getoption)optitemr   r   getopt   s   z$pytest_runtest_setup.<locals>.getopt)slowzneed --z option to run)keywordspytestskip)r   r   r   r   r   r   pytest_runtest_setup   s   
r   c                 C   s   t | jjS )N)r   fspathparent)requestr   r   r   test_dir)   s   r   c                  C   &   t d} | d}| d}||gS )Nenz!I saw a girl    with a telescope.u%   Today we    will eat    poké bowl.  spacyblankmake_docnlpdoc1doc2r   r   r   sample_docs_with_spaces.      


r*   c                  C   r    )Nr!   zI saw a girl with a telescope.u   Today we will eat poké bowl.r"   r&   r   r   r   sample_docs6   r+   r,   c                   C      t tjd d S )Ntokenizationz	toy.modelr   __file__r   r   r   r   r   sentencepiece_toy_model_path>      r1   c                   C   r-   )Nr.   ztoy.wordpiecesr/   r   r   r   r   wordpiece_toy_model_pathC   r2   r3   c                 C   s&   t  }tjd| d|_|  |S )Nz-spacy-curated-transformers.WordpieceLoader.v1)path)r   r   model_loadersgetinit
initialize)r3   encoderr   r   r   wordpiece_toy_encoderH   s   r:   )pathlibr   r   r#   9spacy_curated_transformers.tokenization.wordpiece_encoderr   spacy_curated_transformers.utilr   r   r   r   fixturer   r*   r,   r1   r3   r:   r   r   r   r   <module>   s(    	




