{ "cells": [ { "cell_type": "code", "source": [ "from testgen.instrumentation.instrument_test_source import instrument_test_source\n", "from aiservice.models.functions_to_optimize import FunctionToOptimize\n", "\n", "\n", "test_source = \"\"\"[42]\n", "\"\"\"\n", "function_to_optimize = FunctionToOptimize(\n", " function_name=\"mutinator\",\n", " file_path=\"/Users/renaud/repos/codeflash/cli/code_to_optimize/impure.py\",\n", " parents=[],\n", " starting_line=None,\n", " ending_line=None,\n", ")\n", "module_path = \"code_to_optimize.impure\"\n", "test_module_path = \"code_to_optimize.tests.pytest.test_sorter__unit_test_0\"\n", "instr_test = instrument_test_source(\n", " test_source, function_to_optimize, [], module_path, test_module_path, 'pytest', 15)\n", "\n", "print(instr_test)" ], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-02-29T07:12:25.515265Z", "start_time": "2024-02-29T07:12:25.510325Z" } }, "id": "8d108492763a25a5", "execution_count": 5, "outputs": [] }, { "cell_type": "code", "source": [], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-02-29T07:11:56.826388Z", "start_time": "2024-02-29T07:11:56.809516Z" } }, "id": "694116ed54c4af6a", "execution_count": 4, "outputs": [] }, { "cell_type": "code", "execution_count": 4, "id": "initial_id", "metadata": { "collapsed": true, "ExecuteTime": { "end_time": "2024-02-29T07:11:56.826672Z", "start_time": "2024-02-29T07:11:56.812619Z" } }, "source": [], "outputs": [] }, { "cell_type": "code", "source": [], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-02-29T07:11:56.826732Z", "start_time": "2024-02-29T07:11:56.815532Z" } }, "id": "80fefa4a71d32347", "execution_count": 4, "outputs": [] }, { "cell_type": "code", "source": [], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-02-29T07:11:56.827003Z", "start_time": "2024-02-29T07:11:56.820078Z" } }, "id": "3cb5881311ca16e2", "execution_count": 4, "outputs": [] }, { "cell_type": "code", "source": [], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-02-29T07:11:56.830003Z", "start_time": "2024-02-29T07:11:56.823116Z" } }, "id": "639c96f42318a856", "execution_count": 4, "outputs": [] }, { "cell_type": "code", "source": [], "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-02-29T07:11:56.830236Z", "start_time": "2024-02-29T07:11:56.825068Z" } }, "id": "12baa8a023eafc26", "execution_count": 4, "outputs": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 5 }