[Pytest-commit] Issue #548: isinstance check in warn() is inconsistent on py2/py3 (hpk42/pytest)

Andreas Pelme issues-reply at bitbucket.org
Tue Jul 29 11:29:29 CEST 2014


New issue 548: isinstance check in warn() is inconsistent on py2/py3
https://bitbucket.org/hpk42/pytest/issue/548/isinstance-check-in-warn-is-inconsistent

Andreas Pelme:

There is an assertion that reads

```
assert isinstance(code, str)
```

in `warn()` in _pytest/main.py.

I guess the purpose here is to check for a Python 2 str or unicode, and Python 3 str. Currently it fails with an assertion error for unicode strings on Python 2.

What is the intended behavior here?




More information about the pytest-commit mailing list