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

pyta-uoft / pyta / 19255349751

11 Nov 2025 04:51AM UTC coverage: 93.909% (-0.3%) from 94.222%
19255349751

Pull #1251

github

web-flow
Merge b610418fd into ef514f733
Pull Request #1251: Optimizing performance for 'test_examples.py'

8 of 8 new or added lines in 2 files covered. (100.0%)

16 existing lines in 7 files now uncovered.

3515 of 3743 relevant lines covered (93.91%)

17.64 hits per line

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

91.67
/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():
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
        runtime_z3 = getattr(self.config, "z3", False)
20✔
20
        if runtime_z3:
20✔
21
            try:
10✔
22
                from ..transforms.z3_visitor import Z3Visitor
10✔
23

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

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

37
        return ast
20✔
38

39
    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