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

pyta-uoft / pyta / 14200587856

01 Apr 2025 04:09PM UTC coverage: 92.587% (+0.03%) from 92.557%
14200587856

Pull #1164

github

web-flow
Merge dbce74df4 into a4b858faf
Pull Request #1164: Fix issue with inline comments in docstring assertions

0 of 1 new or added line in 1 file covered. (0.0%)

11 existing lines in 3 files now uncovered.

3360 of 3629 relevant lines covered (92.59%)

17.64 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

4
import logging
20✔
5

6
from pylint.lint import PyLinter
20✔
7

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

10

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

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

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

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

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