Skip to content

Fix python version used to run tests #426

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

Merged
merged 2 commits into from
Mar 19, 2017

Conversation

behrtam
Copy link
Contributor

@behrtam behrtam commented Mar 8, 2017

Even if the test runner itself is executed with a specific python version the subprocess used to execute the respective test script always uses the generic 'python' found in the PATH. On most systems that have python2 & 3 installed 'python' is a symlink to 'python2.X'. So this would mean that even if you would run 'python3 ./test/...py' the tests would still be run with python2.

Even if the test runner itself is executed with a specific python
version the subprocess used to execute the respective test script
always uses the generic 'python' found in the PATH. On most systems
that have python2 & 3 installed 'python' is a symlink to 'python2.X'.
So this would mean that even if you would run 'python3 ./test/...py'
the tests would still be run with python2.
@rootulp
Copy link
Contributor

rootulp commented Mar 19, 2017

Good catch! Do you think we could've caught this sooner if we included a DEBUG log line that prints the version of Python that is used to test? Do you think it is worth adding this log line now? I'm torn because the check-exercises.py output is very concise but we explicitly ask contributors to test with both versions and an additional log line might serve to validate that the version they have tested against did in fact work (ex. 2.7 and 3.5).

@behrtam
Copy link
Contributor Author

behrtam commented Mar 19, 2017

I like the idea of adding a log line. If we add one line right before the FAILURE/SUCCESS message I don't think that would ruin the concise output.

$ test-runner  ./test/check-exercises.py hello-world
#  hello-world
......
----------------------------------------------------------------------
Ran 6 tests in 0.000s

OK

TestEnvironment: Python2.7

SUCCESS!

@rootulp
Copy link
Contributor

rootulp commented Mar 19, 2017

Looks good to me 👍

@behrtam behrtam merged commit d47fb2a into exercism:master Mar 19, 2017
@behrtam behrtam deleted the fix-test-runner branch September 3, 2017 10:49
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.

2 participants