a
    lh                     @   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edddZeejdddgeddd	Z	d
S )TestMakeAbsolutePathpartial_path)sympy
sympy/corezsympy/nonexistant_directory)r   c                 C   s   t | }dS )z(Paths that start with `sympy` are valid.N)r   r   _ r   V/var/www/auris/lib/python3.9/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   s6   t t t| }W d   n1 s(0    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edddZ	ed	d
 Z
edd Zeejdddgg dfgee ee dddZeejdg dgdgdgdggee dddZeejdg dgdgdggee d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sBJ 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_basic)r$   c                 C   s4   t | gdg d}ttt dg}||ks0J 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s0J 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sFJ 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/utilities)r   expected_pathsc                 C   sJ   t | dg d}t|t|ks"J tt||D ]\}}||v s0J q0d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_rootr   zsympy/physicszsympy/physics/mechanicszsympy/physics/mechanics/testsz+sympy/physics/mechanics/tests/test_kane3.py)r   c                 C   sT   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   sT   d}t | |g d}dg}t|t|ks,J tt||D ]\}}||v s:J q:dS )z'Integer keywords are matched correctly.)3538r   1sympy/core/tests/test_sympify.py::test_issue_3538Nr+   r3   r   r   r   test_integer_as_keyword   s    z/TestUpdateArgsWithPaths.test_integer_as_keywordc                  C   sV   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.)r1   r6   r   r7   r2   Nr+   r   r   r4   r/   r"   r   r   r   test_multiple_keywords   s    z.TestUpdateArgsWithPaths.test_multiple_keywordsc                  C   sV   d} t g | g d}ddg}t|t|ks.J tt||D ]\}}||v s<J q<dS )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+   r9   r   r   r   $test_keyword_match_in_multiple_files   s    z<TestUpdateArgsWithPaths.test_keyword_match_in_multiple_filesN)r   r   r   r   r#   r   r   r   r   r&   r(   r)   r   r0   r5   r8   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
   