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

BUG: stdout is bytes on python3 #272

Open
wants to merge 75 commits into
base: master
Choose a base branch
from
Open

BUG: stdout is bytes on python3 #272

wants to merge 75 commits into from

Conversation

mattip
Copy link
Contributor

@mattip mattip commented Apr 18, 2019

discovered on speed.pypy.org

Where should I add a test?

tobami and others added 30 commits July 17, 2011 14:16
Conflicts:
	example/templates/base.html
Update default baseline
Increase width of second graph
tilt xlabels on Plot 2
test, fix angling x-axis on cpythonplot2
Copy link
Owner

@tobami tobami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no tests currently for the mercurial module. It'd be awesome to add at least one for the happy path, but it is not a must for this PR if you don't have the time.

@@ -63,7 +63,7 @@ def getlogs(endrev, startrev):
if p.returncode != 0:
raise CommitLogError(str(stderr))
else:
stdout = stdout.rstrip('\n') # Remove last newline
stdout = str(stdout.rstrip(b'\n')) # Remove last newline
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stdout = str(stdout).rstrip('\n') looks clearer to me.

@mattip
Copy link
Contributor Author

mattip commented Apr 18, 2019

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

@tobami
Copy link
Owner

tobami commented Apr 19, 2019

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

@mattip
Copy link
Contributor Author

mattip commented Apr 19, 2019

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...

@tobami
Copy link
Owner

tobami commented Apr 19, 2019

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

@mattip
Copy link
Contributor Author

mattip commented May 7, 2019

need to decode. Test added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants