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

pyta-uoft / pyta / 14159714644

30 Mar 2025 08:31PM UTC coverage: 92.559% (+0.002%) from 92.557%
14159714644

Pull #1164

github

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

1 of 2 new or added lines in 2 files covered. (50.0%)

13 existing lines in 1 file now uncovered.

3346 of 3615 relevant lines covered (92.56%)

17.63 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