Format: application/x-python-code
1 o
2
3 ��h�6 � @ s� d Z ddlZddlmZ ddlZddlZddlZddlZddlm Z ddl
4 mZ ddlm
5 Z
6 mZ ddlmZ ddlmZ dd lmZ dd
7 lmZ ddlmZmZ ddlmZ d
8 dlmZ d
9 dlmZ ej dkrjej!nej"Z#e#de$de%e$ de%e$ fdd��Z&dd� Z'de'_(dd� Z)dd� Z*d:dd�Z+d;d d!�Z, " d<d#d$�Z-G d%d&� d&ej.�Z/d'Z0d(d)� Z1eZ2e3e�4d"��Z5d*Z6G d+d,� d,e7�Z8d-Z9G d.d/� d/e8�Z:e d0d1� �Z;e d2d3� �Z<d4d5� Z=d=d6d7�Z>d=d8d9�Z?dS )>zWGeneric testing tools.
10
11 Authors
12 -------
13 - Fernando Perez <Fernando.Perez@berkeley.edu>
14 � N)�Path)�contextmanager)�StringIO)�Popen�PIPE)�patch)�Config)�get_output_error_code)�list_strings)�temp_pyfile�Tee)� py3compat� )�
15 decorators)�skipdoctest�win32� startPath�files�returnc s0 t |t�sJ �tj�| �d � � fdd�|D �S )a� Make full paths for all the listed files, based on startPath.
16
17 Only the base part of startPath is kept, since this routine is typically
18 used with a script's ``__file__`` variable as startPath. The base of startPath
19 is then prepended to all the listed files, forming the output list.
20
21 Parameters
22 ----------
23 startPath : string
24 Initial path to use as the base for the results. This path is split
25 using os.path.split() and only its first component is kept.
26
27 files : list
28 One or more files.
29
30 Examples
31 --------
32
33 >>> full_path('/foo/bar.py',['a.txt','b.txt'])
34 ['/foo/a.txt', '/foo/b.txt']
35
36 >>> full_path('/foo',['a.txt','b.txt'])
37 ['/a.txt', '/b.txt']
38
39 r c s g | ] }t j�� |��qS � )�os�path�join)�.0�f��baser �Kc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/testing/tools.py�
40 <listcomp>C s zfull_path.<locals>.<listcomp>)�
41 isinstance�listr r �split)r r r r r � full_path&