o
    jg                     @   s\   d dl Z d dlmZ d dlZd dlmZmZmZmZ dd Z	G dd dZ
G dd	 d	ZdS )
    N)List)make_absolute_path	sympy_dirupdate_args_with_pathsupdate_args_with_rootdirc                  C   s,   t g } | dtttjd gksJ dS )z>`--rootdir` and directory three above this added as arguments.z	--rootdir   N)r   strpathlibPath__file__parents)args r   `/var/www/html/zoom/venv/lib/python3.10/site-packages/sympy/testing/tests/test_runtests_pytest.pytest_update_args_with_rootdir   s   $r   c                   @   sT   e Zd Zeejdg ddefddZeejdddgdefddZ	d	S )
TestMakeAbsolutePathpartial_path)sympy
sympy/corezsympy/nonexistant_directoryc                 C   s   t | }dS )z(Paths that start with `sympy` are valid.N)r   r   _r   r   r   test_valid_partial_path   s   z,TestMakeAbsolutePath.test_valid_partial_path	not_sympyzalso/not/sympyc                 C   s8   t t t| }W d   dS 1 sw   Y  dS )z@A `ValueError` is raises on paths that don't start with `sympy`.N)pytestraises
ValueErrorr   r   r   r   r   ,test_invalid_partial_path_raises_value_error   s   
"zATestMakeAbsolutePath.test_invalid_partial_path_raises_value_errorN)
__name__
__module____qualname__staticmethodr   markparametrizer   r   r   r   r   r   r   r      s    r   c                	   @   s  e Zd Zedd ZeejdddgdefddZ	edd	 Z
ed
d Zeejdddgg dfgdee dee fddZeejdg dgdgdgdggdee fddZeejdg dgdgdggdee fddZedd  Zed!d" Zd#S )$TestUpdateArgsWithPathsc                  C   sF   g } t | dg d}ttt dttt dg}||ks!J dS )a3  If no paths are passed, only `sympy` and `doc/src` are appended.

        `sympy` and `doc/src` are the `testpaths` stated in `pytest.ini`. They
        need to be manually added as if any path-related arguments are passed
        to `pytest.main` then the settings in `pytest.ini` may be ignored.

        Npathskeywordsr   r   zdoc/srcr   r   r	   r
   r   r%   r   expectedr   r   r   test_no_paths*   s   	z%TestUpdateArgsWithPaths.test_no_pathspathsympy/core/tests/test_basic.py_basicc                 C   s4   t | gdg d}ttt dg}||ksJ dS )z;Single files/paths, full or partial, are matched correctly.Nr$   r,   r'   )r+   r   r)   r   r   r   test_one_file;   s   z%TestUpdateArgsWithPaths.test_one_filec                  C   s4   t dgdg d} ttt dg}| |ksJ dS )z;Partial paths from the root directly are matched correctly.sympy/functionsNr$   r'   )r   r)   r   r   r   test_partial_path_from_rootH   s   z3TestUpdateArgsWithPaths.test_partial_path_from_rootc                  C   sJ   ddg} t | dg d}ttt dttt dg}||ks#J dS )z7Multiple paths, partial or full, are matched correctly.r,   r/   Nr$   r'   r(   r   r   r   test_multiple_paths_from_rootO   s   z5TestUpdateArgsWithPaths.test_multiple_paths_from_rootzpaths, expected_pathsz/corez/util)zdoc/src/modules/utilitiesz"doc/src/reference/public/utilitiesr   zsympy/logic/utilitieszsympy/utilitiesr%   expected_pathsc                 C   sJ   t | dg d}t|t|ksJ tt||D ]
\}}||v s"J qdS )z-Multiple partial paths are matched correctly.Nr$   r   lenzipsorted)r%   r2   r   argr)   r   r   r   !test_multiple_paths_from_non_rootZ   s
   z9TestUpdateArgsWithPaths.test_multiple_paths_from_non_rootzsympy/physicszsympy/physics/mechanicszsympy/physics/mechanics/testsz+sympy/physics/mechanics/tests/test_kane3.pyc                 C   T   d}t | |g d}dg}t|t|ksJ tt||D ]
\}}||v s'J qdS )z&String keywords are matched correctly.)bicycler$   9sympy/physics/mechanics/tests/test_kane3.py::test_bicycleNr3   r%   r&   r   expected_argsr7   r)   r   r   r   test_string_as_keywordq   s   z.TestUpdateArgsWithPaths.test_string_as_keywordr   zsympy/core/testsz sympy/core/tests/test_sympify.pyc                 C   r9   )z'Integer keywords are matched correctly.)3538r$   1sympy/core/tests/test_sympify.py::test_issue_3538Nr3   r<   r   r   r   test_integer_as_keyword   s   z/TestUpdateArgsWithPaths.test_integer_as_keywordc                  C   V   d} t g | g d}ddg}t|t|ksJ tt||D ]
\}}||v s(J qdS )z(Multiple keywords are matched correctly.)r:   r?   r$   r@   r;   Nr3   r&   r   r=   r7   r)   r   r   r   test_multiple_keywords      z.TestUpdateArgsWithPaths.test_multiple_keywordsc                  C   rB   )z+Keywords are matched across multiple files.)1130r$   zJsympy/integrals/tests/test_heurisch.py::test_heurisch_symbolic_coeffs_1130zHsympy/utilities/tests/test_lambdify.py::test_python_div_zero_issue_11306Nr3   rC   r   r   r   $test_keyword_match_in_multiple_files   rE   z<TestUpdateArgsWithPaths.test_keyword_match_in_multiple_filesN)r   r   r   r    r*   r   r!   r"   r   r.   r0   r1   r   r8   r>   rA   rD   rG   r   r   r   r   r#   (   s^    



	
	
r#   )r	   typingr   r   sympy.testing.runtests_pytestr   r   r   r   r   r   r#   r   r   r   r   <module>   s    