-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update "TESTS.md" to Show That There Is a Version of "pytest" for Both Python and Python3 #506
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
Conversation
Provides information on the different types of "pytest" available, as well as switched "py.test" to "pytest", as recommended here (pytest-dev/pytest#1629 (comment)).
Although what I have written is most likely far from clean or professional, if the difference between "pytest" packages from pip and pip3 is explained somehow by someone and that explanation is interwoven into this file, then I would consider this attempted addition to the documentation to be a success. The other changes I made concerning "how to run 'pytest' ( |
@TheUltraCode, so there is no difference between |
docs/TESTS.md
Outdated
@@ -107,10 +115,16 @@ compliance to the style guide, install | |||
pip install pytest-pep8 | |||
``` | |||
|
|||
or, for Python 3.X syntax compliance... |
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.
I don't understand this new part.
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.
Perhaps this might be better worded as "or, if you're using Python 3:"?
@m-a-ge Yes, there is no functional difference between |
@behrtam I have you to thank for finding a typo (meant "pip3" instead of "pip" after "or, for Python 3.X syntax compliance..."). Thanks! Now then, what do you do not understand? If you are referring to "Python 3.X syntax compliance", I can help you. Okay, let's start off with the fact that there are differences between Python 2.X and 3.X. For example, in Python 3.X, the
Now, this is one of the simplest differences between the different versions of Python. There are much more, most of which are minute, but this should act as an example, one which I will use later below. Okay, now that we know that "syntax" can differ between Python versions, generations, branches, what-have-you, let's now look at "pip", the Python package manager. There are currently two versions of "pip", "pip" (which installs Python packages and/or programs that employ and follow Python 2.X syntax), and "pip3" (which does the same thing, but for Python 3.X syntax). Okay, we are a few steps hopefully from solving your misunderstanding. Let's say for one of "exercism's" Python exercises you write code that relies heavily on Python 3.X, using features not in 2.X. Well, if you installed the "pip" version of "pytest" and tried to run Using the "print" statement mentioned above, if your goal in a Python exercise from "exercism" was to write using 3.X syntax, and you typed I'm sorry if none of this makes sense. I'm not good at explaining things, but I hope, you do indeed do not understand, someone catches my drift and then explains it better than me. Hope this helps! |
Not trying to sound mean. Just curious. Where are we with this Pull Request? Is it a strong, potential Go or a No Go? It's been a while. |
@TheUltraCode sorry for the delay and thanks for your patience! I like your proposal, |
@m-a-ge Oh, I already addressed that above in this "Conversation", where it starts with "@behrtam I have you to thank for finding a typo (meant "pip3" instead of "pip" after "or, for Python 3.X syntax compliance..."). Thanks!". If you would like me to repost that entire post into the "Reply" field, I can do that as well. If you would like me to clarify anything, I can do that as well. :) To say the least, though, it's just like the difference between |
docs/TESTS.md
Outdated
```bash | ||
pip3 install pytest pytest-cache | ||
``` | ||
**Note:** Whichever version of pytest you install first will be the default one used whenever `pytest` is executed, regardless of whether you have installed both versions. |
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.
It might be worth mentioning that you can check the default version by running pytest --version
(on Linux and presumably OSX?, not sure what the equivalent is in Windows).
On my system it returns:
$ pytest --version
This is pytest version 3.2.1, imported from /usr/lib/python3.6/site-packages/pytest.py
docs/TESTS.md
Outdated
```bash | ||
pip install pytest pytest-cache | ||
``` | ||
If you instead want the vesrion of pytest that obeys Python 3.X syntax, then use `pip3`: |
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.
Looks like you have a typo here: "vesrion" -> "version"
docs/TESTS.md
Outdated
@@ -4,9 +4,17 @@ We recommend you install [pytest](http://pytest.org/latest/) and | |||
[pytest-cache](http://pythonhosted.org/pytest-cache/). `pytest` is a testing | |||
tool that will give you more flexibility over running your unit tests. | |||
|
|||
If you want to install the version of pytest that obeys Python 2.X syntax, then use `pip`: |
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.
This might be better worded as: "If you want to install pytest
for Python 2, then use pip
:"?
Similar wording can be used for Python 3.
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.
Hi @TheUltraCode, thanks for your work on this - I'd love to get this merged in.
I've left a few comments for you that might help you to clarify what you meant regarding the differences between commands for Python 2 and Python 3 - I understood your intention, but I can also see how it could be confusing.
I'm wondering whether it might be better to just give the standard pip
command, but mention that people should use pip3
for Python 3. It would keep it nice and concise, and I don't think that people would have trouble changing pip
to pip3
themselves.
Cleaned it up, addressed what user "N-Parsons" commented on, fixed some errors, and added new information.
Thanks for the feedback @N-Parsons! I took your suggestions and updated "TESTS.md" accordingly. I also cleaned up the file a teensy bit and added some new information to it which I deemed (and hoped to be) helpful. I would be happy to know your thoughts on my changes! |
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.
LGTM!
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.
Looks good.
Thanks for your work on this, @TheUltraCode! |
You're welcome, everyone! |
Provides information on the different types of "pytest" available and how to install each, as well as switched "py.test" to "pytest", as recommended here (pytest-dev/pytest#1629 (comment)).