-
Notifications
You must be signed in to change notification settings - Fork 26
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
function calls can include integers and test script #2
Conversation
tests/run_tests.py
Outdated
import difflib | ||
from pprint import pprint | ||
try: | ||
from StringIO import StringIO # python 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quoting setup.py
'Programming Language :: Python :: 3 :: Only'
tests/run_tests.py
Outdated
@@ -0,0 +1,46 @@ | |||
import os | |||
from rockstarpy.rockstar import convert_code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP8 Imports
tests/run_tests.py
Outdated
rock_files = filter(lambda f: '.rock' == f[-5:], files) | ||
py_files = set(filter(lambda f: '.py' == f[-3:], files)) | ||
for rock_file in rock_files: | ||
file_name = rock_file[:-5] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are assuming that all rockstar files uses ".rock" extension, but on the help for the argument "input" there are listed three different extensions (rock|rockstar|lyrics)
.
I think that rock_file.rstrip('.', 1)[0]
is better
edit: actually rock_files
contains only files with the ".rock" extension, because are filtered, so now the problem is that rockstar files with other extension aren't tested
tests/run_tests.py
Outdated
file_name = rock_file[:-5] | ||
py_file = file_name + ".py" | ||
assert py_file in py_files, "Did not create a corrosponding expected output for " + file_name + ".rock" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, there is some code that can be improved:
line 24: py_files = set(filter(lambda f: f.endswith('.py'), files))
line 26: file_name = rock_file.rstrip('.', 1)[0]
line 28: assert py_file in py_files, "Did not create a corrosponding expected output for " + rock_file
Thank you! I'm accepting the PR. I'm planning to add support to Python 2, so soon I'll get back your try/except. |
@yanorestes Python2 is going to die soon, why you want to add support for it? |
test script looks at the input and expected output and checks the difference.