balabit / typesafety

Type safety checker for Python3
GNU Lesser General Public License v2.1
23 stars 9 forks source link

validator: Hide typesafety part of traceback when run with py.test #23

Closed andras-tim closed 8 years ago

andras-tim commented 8 years ago

This makes a bit lighter traceback on TypesafetyError.

andras-tim commented 8 years ago

This is too strange, I will make a thinner solution. - type mismatched decorated function calls can make trace with validator.py only, therefore the trace will be empty in this case

In other hand, there was an Travis env problem.

andras-tim commented 8 years ago

There was not enough to use the __tracebackhide__ = True trick, because e.g. this test with type mismatch by decorator could make empty traceback:

import pytest

@pytest.fixture
def foo():
    return []

def test_type_mismatch(foo: dict):
    assert isinstance(foo, list)