Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError on conftest.py during collection #2532

Closed
crisAD opened this issue Jun 27, 2017 · 3 comments
Closed

TypeError on conftest.py during collection #2532

crisAD opened this issue Jun 27, 2017 · 3 comments
Labels
type: question general question, might be closed after 2 weeks of inactivity

Comments

@crisAD
Copy link

crisAD commented Jun 27, 2017

Hello,

I am new to pytest.
I was just trying to run the pytest sample from the PYTEST_C_RUNNER repository(https://github.com/jmcnamara/pytest_c_testrunner) and I encountered this error:

_________________ ERROR collecting test/test_basic_integers.c _________________
conftest.py:38: in collect
lines = test_output.split("\n")
E TypeError: a bytes-like object is required, not 'str'


I did not do anything, I was just simply running pytest.
My pytest version is 3.1.2 and my python version is 3.5.2 running on anaconda version 2.5.0 (32-bit)

How do I fix this error?
Thanks.

@RonnyPfannschmidt
Copy link
Member

i suspect adding a b to make it b"\n" should suffice, please report back and close if that was the case

@RonnyPfannschmidt RonnyPfannschmidt added the type: question general question, might be closed after 2 weeks of inactivity label Jun 27, 2017
@The-Compiler
Copy link
Member

You'd probably need to ask @jmcnamara but it looks like that code was written for Python 2, not Python 3.

Also, note there's pytest-cpp which should also work for testing C code.

Either way, I'm closing this as it's not a pytest issue 😉

@crisAD
Copy link
Author

crisAD commented Jun 27, 2017

thanks guys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question general question, might be closed after 2 weeks of inactivity
Projects
None yet
Development

No branches or pull requests

3 participants