Format: application/x-python-code
1 o
2
3 ��h�K � @ sN d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl m
4 Z ddlm
5 Z
6 ddlZddlmZ ddlmZ ddlmZ ddlmZ dd lmZ d
7 d� Zdd
8 � Zdd� Zejdd� �Zejdke_ej dd� �Z!ejdke!_dd� Z"G dd� dej#�Z$G dd� dej#�Z%G dd� dej&�Z'dd� Z(dd � Z)d!d"� Z*d#d$� Z+dS )%a+ Tests for code execution (%run and related), which is particularly tricky.
9
10 Because of how %run manages namespaces, and the fact that we are trying here to
11 verify subtle object deletion and reference counting issues, the %run tests
12 will be kept in this separate file. This makes it easier to aggregate in one
13 place the tricks needed to handle it; most other magics are much easier to test
14 and we do so in a common test_magic file.
15
16 Note that any test using `run -i` should make sure to do a `reset` afterwards,
17 as otherwise it may influence later tests.
18 � N)�join)�patch)�TemporaryDirectory)�debugger)�
19 decorators)�tools)�capture_outputc C � dS )aV Very nasty problem with references held by multiple runs of a script.
20 See: https://github.com/ipython/ipython/issues/141
21
22 In [1]: _ip.clear_main_mod_cache()
23 # random
24
25 In [2]: %run refbug
26
27 In [3]: call_f()
28 lowercased: hello
29
30 In [4]: %run refbug
31
32 In [5]: call_f()
33 lowercased: hello
34 lowercased: hello
35 N� r
36 r
37 r
38 �Qc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/core/tests/test_run.py�doctest_refbug'