pdit 0.3.2__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pdit-0.3.2/pdit.egg-info → pdit-0.4.0}/PKG-INFO +1 -1
- {pdit-0.3.2 → pdit-0.4.0}/pdit/ipython_executor.py +3 -0
- {pdit-0.3.2 → pdit-0.4.0/pdit.egg-info}/PKG-INFO +1 -1
- {pdit-0.3.2 → pdit-0.4.0}/pyproject.toml +1 -1
- {pdit-0.3.2 → pdit-0.4.0}/tests/test_ipython_executor.py +20 -0
- {pdit-0.3.2 → pdit-0.4.0}/LICENSE +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/MANIFEST.in +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/README.md +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit/__init__.py +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit/_demo.py +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit/_static/assets/index-1w8kifoA.js +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit/_static/assets/index-rS96z8hq.css +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit/_static/export.html +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit/_static/index.html +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit/cli.py +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit/exporter.py +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit/file_watcher.py +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit/server.py +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit.egg-info/SOURCES.txt +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit.egg-info/dependency_links.txt +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit.egg-info/entry_points.txt +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit.egg-info/requires.txt +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/pdit.egg-info/top_level.txt +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/setup.cfg +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/tests/test_file_watcher.py +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/tests/test_local_import.py +0 -0
- {pdit-0.3.2 → pdit-0.4.0}/tests/test_server.py +0 -0
|
@@ -167,6 +167,9 @@ del _register_pdit_runtime_hooks
|
|
|
167
167
|
|
|
168
168
|
for node in tree.body:
|
|
169
169
|
line_start = node.lineno
|
|
170
|
+
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)):
|
|
171
|
+
if node.decorator_list:
|
|
172
|
+
line_start = min(dec.lineno for dec in node.decorator_list)
|
|
170
173
|
line_end = node.end_lineno or node.lineno
|
|
171
174
|
|
|
172
175
|
# Extract source
|
|
@@ -448,6 +448,26 @@ result"""
|
|
|
448
448
|
assert results[2]["isInvisible"] is True # assignment
|
|
449
449
|
assert "7" in results[3]["output"][0]["content"]
|
|
450
450
|
|
|
451
|
+
async def test_function_decorator_applied(self, executor):
|
|
452
|
+
"""Test that function decorators are applied."""
|
|
453
|
+
script = """from functools import wraps
|
|
454
|
+
|
|
455
|
+
def add_one(fn):
|
|
456
|
+
@wraps(fn)
|
|
457
|
+
def wrapper(*args, **kwargs):
|
|
458
|
+
return fn(*args, **kwargs) + 1
|
|
459
|
+
return wrapper
|
|
460
|
+
|
|
461
|
+
@add_one
|
|
462
|
+
def add(a, b):
|
|
463
|
+
return a + b
|
|
464
|
+
|
|
465
|
+
add(2, 3)"""
|
|
466
|
+
results = await collect_results(executor.execute_script(script))
|
|
467
|
+
|
|
468
|
+
final_result = results[-1]
|
|
469
|
+
assert "6" in final_result["output"][0]["content"]
|
|
470
|
+
|
|
451
471
|
async def test_list_comprehension(self, executor):
|
|
452
472
|
"""Test list comprehension execution."""
|
|
453
473
|
script = "[x**2 for x in range(5)]"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|