o
    GZh                     @   sP   d dl Z d dlmZ d dlZd dlmZmZmZ G dd dZG dd dZ	dS )    N)List)make_absolute_path	sympy_dirupdate_args_with_pathsc                   @   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   W/var/www/auris/lib/python3.10/site-packages/sympy/testing/tests/test_runtests_pytest.pytest_valid_partial_path   s   z,TestMakeAbsolutePath.test_valid_partial_pathZ	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)pytestZ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parametrizestrr   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keywordsargsr   zdoc/srcr   r   pathlibPathr   r   r   expectedr   r   r   test_no_paths#   s   	z%TestUpdateArgsWithPaths.test_no_pathspathsympy/core/tests/test_basic.pyZ_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_file4   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_rootA   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_rootH   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   r*   r   argr"   r   r   r   !test_multiple_paths_from_non_rootS   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_bicycleNr+   r   r   r   expected_argsr/   r"   r   r   r   test_string_as_keywordj   s   z.TestUpdateArgsWithPaths.test_string_as_keywordr	   zsympy/core/testsz sympy/core/tests/test_sympify.pyc                 C   r1   )z'Integer keywords are matched correctly.)3538r   1sympy/core/tests/test_sympify.py::test_issue_3538Nr+   r4   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.)r2   r7   r   r8   r3   Nr+   r   r   r5   r/   r"   r   r   r   test_multiple_keywords      z.TestUpdateArgsWithPaths.test_multiple_keywordsc                  C   r:   )z+Keywords are matched across multiple files.)Z1130r   zJsympy/integrals/tests/test_heurisch.py::test_heurisch_symbolic_coeffs_1130zHsympy/utilities/tests/test_lambdify.py::test_python_div_zero_issue_11306Nr+   r;   r   r   r   $test_keyword_match_in_multiple_files   r=   z<TestUpdateArgsWithPaths.test_keyword_match_in_multiple_filesN)r   r   r   r   r#   r   r   r   r   r&   r(   r)   r   r0   r6   r9   r<   r>   r   r   r   r   r   !   s^    



	
	
r   )
r   typingr   r   Zsympy.testing.runtests_pytestr   r   r   r   r   r   r   r   r   <module>   s    