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

pyta-uoft / pyta / 18953194444

29 Oct 2025 03:58AM UTC coverage: 93.664% (-0.6%) from 94.222%
18953194444

Pull #1251

github

web-flow
Merge 40670e5b3 into cc0379cd3
Pull Request #1251: Optimizing performance for 'test_examples.py'

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

21 existing lines in 7 files now uncovered.

3474 of 3709 relevant lines covered (93.66%)

17.54 hits per line

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

83.33
/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✔
UNCOV
34
        except Exception as e:
×
UNCOV
35
            logging.warning(f"Could not run CFGVisitor: {e}")
×
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