• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pyta-uoft / pyta / 15657295841

14 Jun 2025 11:52PM UTC coverage: 92.697% (-0.1%) from 92.844%
15657295841

Pull #1188

github

web-flow
Merge 03ff4a356 into 02ddeab02
Pull Request #1188: Refactoring of the codebase to delay the import of z3 module

29 of 37 new or added lines in 2 files covered. (78.38%)

16 existing lines in 4 files now uncovered.

3427 of 3697 relevant lines covered (92.7%)

17.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.22
/python_ta/patches/transforms.py
1
"""Patch to add transforms for setting type constraints and creating control flow graphs."""
2

3
import logging
20✔
4

5
from pylint.lint import PyLinter
20✔
6

7
from ..cfg.visitor import CFGVisitor
20✔
8

9

10
def patch_ast_transforms(z3: bool):
20✔
11
    old_get_ast = PyLinter.get_ast
20✔
12

13
    def new_get_ast(self, filepath, modname, data):
20✔
14
        ast = old_get_ast(self, filepath, modname, data)
20✔
15
        if ast is None:
20✔
16
            return None
20✔
17

18
        # Run the Z3Visitor
19
        if z3:
20✔
20
            try:
×
21
                from ..transforms.z3_visitor import Z3Visitor
×
22

UNCOV
23
                ast = Z3Visitor().visitor.visit(ast)
×
24
            except Exception as e:
×
25
                logging.warning(f"Could not run Z3Visitor: {e}")
×
26

27
        # Run the CFGVisitor
28
        try:
20✔
29
            if z3:
20✔
30
                ast.accept(CFGVisitor(options={"separate-condition-blocks": True}))
×
31
            else:
32
                ast.accept(CFGVisitor())
20✔
UNCOV
33
        except Exception as e:
×
34
            logging.warning(f"Could not run CFGVisitor: {e}")
×
35

36
        return ast
20✔
37

38
    PyLinter.get_ast = new_get_ast
20✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc