-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Readme template/running tests #1271
Changes from 2 commits
21709b5
5e7fe8a
d67cfb8
0f02639
2086c39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,19 @@ To raise a message with an exception, just write it as an argument to the except | |
raise Exception("Meaningful message indicating the source of the error") | ||
``` | ||
|
||
## Running the tests | ||
|
||
To run the tests run the command `python -m pytest {{ .Spec.SnakeCaseName }}_test.py` | ||
(`py.test {{ .Spec.SnakeCaseName }}_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with | ||
`-v` to be more verbose like this: `pytest {{ .Spec.SnakeCaseName }}_test.py`. Using the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line doesn't make sense. It seems to be explaining the verbose flag, but doesn't use it in the example. |
||
`-x` flag will cause the test to fail at the first failure instead of it | ||
trying all cases before exiting. | ||
|
||
To run this exercises's tests for example, run this command: | ||
``` | ||
python -m pytest {{ .Spec.SnakeCaseName }}_test.py -v | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find this section a little bit hard to scan. How about something like: The command to run the tests is:
Additional flags are available for pytest:
For example:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've rewritten this section for clarity; however, it just occurred to me that while tables are valid markdown, they might be discouraged in this instance to make it easier for users to view the README file in a text editor. If that is the case, I am happy to convert my changes to a similar format to what you have written. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this needs to be readable in plain text. |
||
|
||
## Submitting Exercises | ||
|
||
Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/{{ .Spec.Slug }}` directory. | ||
|
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 should be
{{ .Spec.SnakeCaseName }}
instead of<exercise>_test.py
for Python 3 as well.