codespeed icon indicating copy to clipboard operation
codespeed copied to clipboard

BUG: stdout is bytes on python3

Open mattip opened this issue 6 years ago • 5 comments

discovered on speed.pypy.org

Where should I add a test?

mattip avatar Apr 18 '19 08:04 mattip

how do I run the tests? python -mpytest codespeed/tests doesn't work out of the box for me, some django setup is missing

django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, \
but settings are not configured. You must either define the environment variable \
DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings

mattip avatar Apr 18 '19 17:04 mattip

how do I run the tests? python -mpytest codespeed/tests doesn't work out of the box for me, some django setup is missing

It's not configured to run with pytest, you can run tests the standard django way: python manage.py test

tobami avatar Apr 19 '19 10:04 tobami

I need to get used to django unit tests. For instance, I am used to the testing framework supplying a tmp_dir so that I could set up a hg/git repo, but spent quite a while searching for the recommended way to do this in django so that the directory is erased when tests finish. Any hints?

OTOH, it seems like a lot of work to set up testing for a small fix...

mattip avatar Apr 19 '19 10:04 mattip

An example of how to do this with django tests: https://swapps.com/blog/testing-files-with-pythondjango/

tobami avatar Apr 19 '19 11:04 tobami

need to decode. Test added

mattip avatar May 07 '19 21:05 mattip