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

pyta-uoft / pyta / 15791974148

21 Jun 2025 04:11AM UTC coverage: 92.849% (+0.03%) from 92.821%
15791974148

Pull #1190

github

web-flow
Merge b652ed720 into 02ddeab02
Pull Request #1190: Simplify Combined Z3 Preconditions in z3_visitor.py Using z3.simplify

4 of 4 new or added lines in 1 file covered. (100.0%)

26 existing lines in 5 files now uncovered.

3428 of 3692 relevant lines covered (92.85%)

17.54 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✔
UNCOV
20
            try:
×
UNCOV
21
                from ..transforms.z3_visitor import Z3Visitor
×
22

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

27
        # Run the CFGVisitor
28
        try:
20✔
29
            if z3:
20✔
UNCOV
30
                ast.accept(CFGVisitor(options={"separate-condition-blocks": True}))
×
31
            else:
32
                ast.accept(CFGVisitor())
20✔
UNCOV
33
        except Exception as e:
×
UNCOV
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