Skip to content

pytest.fail(), pytest.skip() and pytest.xfail() are not considered callable (call-not-callable diagnostic emitted) #553

@johnniemorrow

Description

@johnniemorrow

Summary

Hi,

I'm seeing a call-non-callable error calling pytest.fail():

import pytest

def test_pytest():
    pytest.fail("because...")
$ ty check tests/test_pytest.py
error[call-non-callable]: Object of type `_WithException[Unknown, <class 'Failed'>]` is not callable
 --> tests/test_pytest.py:4:5
  |
3 | def test_pytest():
4 |     pytest.fail("because...")
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
info: rule `call-non-callable` is enabled by default

Found 1 diagnostic

Version

ty 0.0.1-alpha.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    ProtocolsgenericsBugs or features relating to ty's generics implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions