Skip to content

AttributeError: module 'pylint.checkers.utils' has no attribute 'is_test_condition' #4097

@ahartikainen

Description

@ahartikainen

Hi, I noticed an error with the latest PyPI release (pylint==2.6.1)

ArviZ CI (azure devops)

Not sure what is going on, but apparently python can't access is_test_condition. Maybe there is some import order problem or something similar or our CI just behaving wrong.

Steps to reproduce

  1. pip install pylint
  2. pylint .

Current behavior

AttributeError: module 'pylint.checkers.utils' has no attribute 'is_test_condition'

Traceback message
/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/0069574e-9b2e-4af7-a7d5-711353132a5f.sh
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/__main__.py", line 18, in <module>
    pylint.run_pylint()
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/__init__.py", line 22, in run_pylint
    PylintRun(sys.argv[1:])
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/lint/run.py", line 349, in __init__
    linter.check(args)
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 862, in check
    self._check_files(
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 896, in _check_files
    self._check_file(get_ast, check_astroid_module, name, filepath, modname)
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 922, in _check_file
    check_astroid_module(ast_node)
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1054, in check_astroid_module
    retval = self._check_astroid_module(
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1099, in _check_astroid_module
    walker.walk(ast_node)
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
    self.walk(child)
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
    self.walk(child)
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
    self.walk(child)
  [Previous line repeated 1 more time]
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 72, in walk
    callback(astroid)
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/checkers/refactoring/refactoring_checker.py", line 1039, in visit_boolop
    self._check_simplifiable_condition(node)
  File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/pylint/checkers/refactoring/refactoring_checker.py", line 1006, in _check_simplifiable_condition
    if not utils.is_test_condition(node):
AttributeError: module 'pylint.checkers.utils' has no attribute 'is_test_condition'

Expected behavior

pylint --version output

pylint==2.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions