
    Ph                     B    d Z ddlZddlZddlmZ d Zd Zd Z	d Z
d Zy)	a  
Tests for the private NumPy argument parsing functionality.
They mainly exists to ensure good test coverage without having to try the
weirder cases on actual numpy functions but test them in one place.

The test function is defined in C to be equivalent to (errors may not always
match exactly, and could be adjusted):

    def func(arg1, /, arg2, *, arg3):
        i = integer(arg1)  # reproducing the 'i' parsing in Python.
        return None
    N)argparse_example_functionc                      t        j                  t        d      5  t        d       d d d        t        j                  t              5  t        ddz         d d d        y # 1 sw Y   :xY w# 1 sw Y   y xY w)Nz$integer argument expected, got floatmatchg      ?   d   )pytestraises	TypeErrorfuncOverflowError     iC:\Users\daisl\Desktop\realtime-object-detection\venv\Lib\site-packages\numpy/core/tests/test_argparse.pytest_invalid_integersr      sT    	y8
:R
: 
}	%QV 
&	%
: 
: 
&	%s   A!	A-!A*-A6c                  l   t        j                  t        d      5  t                d d d        t        j                  t        d      5  t        dd       d d d        t        j                  t        d      5  t        dd       d d d        y # 1 sw Y   lxY w# 1 sw Y   GxY w# 1 sw Y   y xY w)	Nz&missing required positional argument 0r         )arg2arg3z,missing required argument \'arg2\' \(pos 1\)   )r   r	   r
   r   r   r   r   r   test_missing_argumentsr      s    	y:
<
< 
y:
<!!
< 
yA
CQQ
C 
C
< 
<
< 
<
C 
Cs#   B
B;B*BB'*B3c                      t        j                  t        d      5  t        dddd       d d d        y # 1 sw Y   y xY w)Nz7takes from 2 to 3 positional arguments but 4 were givenr   r   r      r   r   r   r   r   test_too_many_positionalr   (   s5    	yK
MQ1a
M 
M 
M   4=c                      t        j                  t        d      5  t        ddd       d d d        y # 1 sw Y   y xY w)Nz4given by name \('arg2'\) and position \(position 1\)r   r   r   r   )r   r   r   r   r   test_multiple_valuesr   /   s3    	yI
KQ
K 
K 
Kr   c                      t        j                  d      } t        j                  d      }t        di | di t        j                  t
        d      5  t        di |di d d d        y # 1 sw Y   y xY w)Nr   missing_argr   z0got an unexpected keyword argument 'missing_arg'r   )r   )r   )npstr_r   r	   r
   r   )r   r!   s     r   test_string_fallbacksr$   5   sc     776?D''-(KtQi	yD
F#;"#
F 
F 
Fs   A**A3)__doc__r	   numpyr"   numpy.core._multiarray_testsr   r   r   r   r   r   r$   r   r   r   <module>r(      s.      J	$r   