feat: Export errors to csv file formats - Unit Tests #1
+91
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I started working from feat: Export errors to csv file formats.
👋 I'm an AI agent who writes, runs, and maintains Unit Tests. I even highlight the bugs I spot! I'm free for open-source repos.
🔄 3 test files added and 3 test files updated to reflect recent changes.
🐛 Found 23 bugs
🛠️ 171/395 tests passed
🔄 Test Updates
I've updated 3 tests. They all pass ☑️
Updated Tests:
pytype/tools/tool_utils_test.py
🩹pytype/datatypes_test.py
🩹pytype/inspect/graph_test.py
🩹🐛 Bug Detection
Potential issues found in the following files:
pytype/overlays/future_overlay.py
Since the test code is standard and could be rewritten to test something else, and the test settings aren’t at fault, the error is being caused by a bug in the pytype package – a bug where “cfg” is missing from pytype.typegraph.
Test Error Log
``` pytype/tests/test_future_overlay.py: ImportError while importing test module '/app/temp_workspace/pytype/tests/test_future_overlay.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/tests/test_future_overlay.py:3: in from pytype.tests import test_base pytype/tests/test_base.py:9: in from pytype import analyze pytype/analyze.py:6: in from pytype import context pytype/context.py:6: in from pytype import annotation_utils pytype/annotation_utils.py:9: in from pytype import state pytype/state.py:9: in from pytype import compare pytype/compare.py:3: in from pytype.abstract import abstract pytype/abstract/abstract.py:9: in from pytype.abstract import _base pytype/abstract/_base.py:11: in from pytype.abstract import abstract_utils pytype/abstract/abstract_utils.py:13: in from pytype.pytd import pytd_utils pytype/pytd/pytd_utils.py:18: in from pytype.pytd import printer pytype/pytd/printer.py:8: in from pytype.pytd import base_visitor pytype/pytd/base_visitor.py:8: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/pytd/main_test.py: ImportError while importing test module '/app/temp_workspace/pytype/pytd/main_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/pytd/main_test.py:7: in from pytype.pytd import main as pytd_tool pytype/pytd/main.py:16: in from pytype.imports import builtin_stubs pytype/imports/builtin_stubs.py:6: in from pytype.pyi import parser pytype/pyi/parser.py:15: in from pytype.pyi import definitions pytype/pyi/definitions.py:13: in from pytype.pytd import pep484 pytype/pytd/pep484.py:3: in from pytype.pytd import base_visitor pytype/pytd/base_visitor.py:8: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/vm_test.py: ImportError while importing test module '/app/temp_workspace/pytype/vm_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/vm_test.py:23: in from pytype import context pytype/context.py:6: in from pytype import annotation_utils pytype/annotation_utils.py:9: in from pytype import state pytype/state.py:9: in from pytype import compare pytype/compare.py:3: in from pytype.abstract import abstract pytype/abstract/abstract.py:9: in from pytype.abstract import _base pytype/abstract/_base.py:11: in from pytype.abstract import abstract_utils pytype/abstract/abstract_utils.py:13: in from pytype.pytd import pytd_utils pytype/pytd/pytd_utils.py:18: in from pytype.pytd import printer pytype/pytd/printer.py:8: in from pytype.pytd import base_visitor pytype/pytd/base_visitor.py:8: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/rewrite/operators_test.py: ImportError while importing test module '/app/temp_workspace/pytype/rewrite/operators_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/rewrite/operators_test.py:3: in from pytype.rewrite import operators pytype/rewrite/operators.py:5: in from pytype.rewrite.abstract import abstract pytype/rewrite/abstract/abstract.py:3: in from pytype.rewrite.abstract import base as _base pytype/rewrite/abstract/base.py:7: in from pytype import config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/load_pytd_test.py: ImportError while importing test module '/app/temp_workspace/pytype/load_pytd_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/load_pytd_test.py:10: in from pytype import config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/pyi/parser_test.py: ImportError while importing test module '/app/temp_workspace/pytype/pyi/parser_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/pyi/parser_test.py:5: in from pytype.pyi import parser pytype/pyi/parser.py:15: in from pytype.pyi import definitions pytype/pyi/definitions.py:13: in from pytype.pytd import pep484 pytype/pytd/pep484.py:3: in from pytype.pytd import base_visitor pytype/pytd/base_visitor.py:8: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/convert_test.py: ImportError while importing test module '/app/temp_workspace/pytype/convert_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/convert_test.py:3: in from pytype import config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/rewrite/analyze_test.py: ImportError while importing test module '/app/temp_workspace/pytype/rewrite/analyze_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/rewrite/analyze_test.py:1: in from pytype import config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/tools/arg_parser_test.py: ImportError while importing test module '/app/temp_workspace/pytype/tools/arg_parser_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/tools/arg_parser_test.py:6: in from pytype import config as pytype_config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/pretty_printer_test.py: ImportError while importing test module '/app/temp_workspace/pytype/pretty_printer_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/pretty_printer_test.py:3: in from pytype import config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/block_environment_test.py: ImportError while importing test module '/app/temp_workspace/pytype/block_environment_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/block_environment_test.py:5: in from pytype import block_environment pytype/block_environment.py:4: in from pytype.blocks import blocks pytype/blocks/blocks.py:9: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/config_test.py: ImportError while importing test module '/app/temp_workspace/pytype/config_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/config_test.py:6: in from pytype import config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/tools/analyze_project/pytype_runner_test.py: ImportError while importing test module '/app/temp_workspace/pytype/tools/analyze_project/pytype_runner_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/tools/analyze_project/pytype_runner_test.py:9: in from pytype import config as pytype_config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/tools/merge_pyi/merge_pyi_test.py: ImportError while importing test module '/app/temp_workspace/pytype/tools/merge_pyi/merge_pyi_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/tools/merge_pyi/merge_pyi_test.py:8: in from pytype.tools.merge_pyi import merge_pyi pytype/tools/merge_pyi/merge_pyi.py:13: in from pytype.imports import pickle_utils pytype/imports/pickle_utils.py:37: in from pytype.pytd import serialize_ast pytype/pytd/serialize_ast.py:10: in from pytype.pyi import parser pytype/pyi/parser.py:15: in from pytype.pyi import definitions pytype/pyi/definitions.py:13: in from pytype.pytd import pep484 pytype/pytd/pep484.py:3: in from pytype.pytd import base_visitor pytype/pytd/base_visitor.py:8: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/imports_map_loader_test.py: ImportError while importing test module '/app/temp_workspace/pytype/imports_map_loader_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/imports_map_loader_test.py:8: in from pytype.tests import test_utils pytype/tests/test_utils.py:17: in from pytype import config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/debug_test.py: ImportError while importing test module '/app/temp_workspace/pytype/debug_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/debug_test.py:5: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/imports/builtin_stubs_test.py: ImportError while importing test module '/app/temp_workspace/pytype/imports/builtin_stubs_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/imports/builtin_stubs_test.py:4: in from pytype.imports import builtin_stubs pytype/imports/builtin_stubs.py:6: in from pytype.pyi import parser pytype/pyi/parser.py:15: in from pytype.pyi import definitions pytype/pyi/definitions.py:13: in from pytype.pytd import pep484 pytype/pytd/pep484.py:3: in from pytype.pytd import base_visitor pytype/pytd/base_visitor.py:8: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/io_test.py: ImportError while importing test module '/app/temp_workspace/pytype/io_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/io_test.py:9: in from pytype import config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/pytd/pep484_test.py: ImportError while importing test module '/app/temp_workspace/pytype/pytd/pep484_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/pytd/pep484_test.py:1: in from pytype.pytd import pep484 pytype/pytd/pep484.py:3: in from pytype.pytd import base_visitor pytype/pytd/base_visitor.py:8: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Thus, the error is caused by a bug/missing definition in the code being tested, not by how the test was written or configured.
Test Error Log
``` pytype/pytd/serialize_ast_test.py: ImportError while importing test module '/app/temp_workspace/pytype/pytd/serialize_ast_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/pytd/serialize_ast_test.py:3: in from pytype import config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/tests/test_annotations.py: ImportError while importing test module '/app/temp_workspace/pytype/tests/test_annotations.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/tests/test_annotations.py:3: in from pytype.tests import test_base pytype/tests/test_base.py:9: in from pytype import analyze pytype/analyze.py:6: in from pytype import context pytype/context.py:6: in from pytype import annotation_utils pytype/annotation_utils.py:9: in from pytype import state pytype/state.py:9: in from pytype import compare pytype/compare.py:3: in from pytype.abstract import abstract pytype/abstract/abstract.py:9: in from pytype.abstract import _base pytype/abstract/_base.py:11: in from pytype.abstract import abstract_utils pytype/abstract/abstract_utils.py:13: in from pytype.pytd import pytd_utils pytype/pytd/pytd_utils.py:18: in from pytype.pytd import printer pytype/pytd/printer.py:8: in from pytype.pytd import base_visitor pytype/pytd/base_visitor.py:8: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/tools/xref/indexer_test.py: ImportError while importing test module '/app/temp_workspace/pytype/tools/xref/indexer_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/tools/xref/indexer_test.py:4: in from pytype import config pytype/config.py:20: in from pytype.errors import errors pytype/errors/errors.py:11: in from pytype import debug pytype/debug.py:12: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```Test Error Log
``` pytype/rewrite/tests/test_utils_test.py: ImportError while importing test module '/app/temp_workspace/pytype/rewrite/tests/test_utils_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/local/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) pytype/rewrite/tests/test_utils_test.py:4: in from pytype.rewrite.tests import test_utils pytype/rewrite/tests/test_utils.py:8: in from pytype.blocks import blocks pytype/blocks/blocks.py:9: in from pytype.typegraph import cfg_utils pytype/typegraph/cfg_utils.py:7: in from pytype.typegraph import cfg E ImportError: cannot import name 'cfg' from 'pytype.typegraph' (/app/temp_workspace/pytype/typegraph/__init__.py) ```☂️ Coverage Improvements
Coverage improvements by file:
pytype/tools/tool_utils_test.py
pytype/datatypes_test.py
pytype/inspect/graph_test.py
About CodeBeaver | Unit Test AI | AI Software Testing