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

Readme template/running tests #1271

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions config/exercise_readme.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

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.

`-v` to be more verbose like this: `pytest {{ .Spec.SnakeCaseName }}_test.py`. Using the
Copy link
Member

Choose a reason for hiding this comment

The 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
```
Copy link
Member

Choose a reason for hiding this comment

The 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:

  • (Python 2) python -m py.test {{ .Spec.SnakeCaseName }}_test.py
  • (Python 3) python -m pytest {{ .Spec.SnakeCaseName }}_test.py

Additional flags are available for pytest:

  • -v to get more verbose failure messages
  • -x to fail at the first failure instead of running all the tests and showing all the failures at once

For example:

python -m pytest -x {{ .Spec.SnakeCaseName }}_test.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

The 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.
Expand Down
13 changes: 13 additions & 0 deletions exercises/accumulate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,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 accumulate_test.py`
(`py.test accumulate_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest accumulate_test.py`. Using the
`-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 accumulate_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/accumulate` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/acronym/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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 acronym_test.py`
(`py.test acronym_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest acronym_test.py`. Using the
`-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 acronym_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/acronym` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/all-your-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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 all_your_base_test.py`
(`py.test all_your_base_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest all_your_base_test.py`. Using the
`-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 all_your_base_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/all-your-base` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/allergies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,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 allergies_test.py`
(`py.test allergies_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest allergies_test.py`. Using the
`-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 allergies_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/allergies` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/alphametics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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 alphametics_test.py`
(`py.test alphametics_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest alphametics_test.py`. Using the
`-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 alphametics_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/alphametics` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/anagram/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,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 anagram_test.py`
(`py.test anagram_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest anagram_test.py`. Using the
`-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 anagram_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/anagram` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/armstrong-numbers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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 armstrong_numbers_test.py`
(`py.test armstrong_numbers_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest armstrong_numbers_test.py`. Using the
`-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 armstrong_numbers_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/armstrong-numbers` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/atbash-cipher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,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 atbash_cipher_test.py`
(`py.test atbash_cipher_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest atbash_cipher_test.py`. Using the
`-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 atbash_cipher_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/atbash-cipher` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/beer-song/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,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 beer_song_test.py`
(`py.test beer_song_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest beer_song_test.py`. Using the
`-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 beer_song_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/beer-song` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/binary-search-tree/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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 binary_search_tree_test.py`
(`py.test binary_search_tree_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest binary_search_tree_test.py`. Using the
`-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 binary_search_tree_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/binary-search-tree` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/binary-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,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 binary_search_test.py`
(`py.test binary_search_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest binary_search_test.py`. Using the
`-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 binary_search_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/binary-search` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/binary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,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 binary_test.py`
(`py.test binary_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest binary_test.py`. Using the
`-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 binary_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/binary` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/bob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,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 bob_test.py`
(`py.test bob_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest bob_test.py`. Using the
`-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 bob_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/bob` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/book-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,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 book_store_test.py`
(`py.test book_store_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest book_store_test.py`. Using the
`-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 book_store_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/book-store` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/bowling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,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 bowling_test.py`
(`py.test bowling_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest bowling_test.py`. Using the
`-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 bowling_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/bowling` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/bracket-push/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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 bracket_push_test.py`
(`py.test bracket_push_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest bracket_push_test.py`. Using the
`-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 bracket_push_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/bracket-push` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/change/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,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 change_test.py`
(`py.test change_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest change_test.py`. Using the
`-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 change_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/change` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/circular-buffer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,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 circular_buffer_test.py`
(`py.test circular_buffer_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest circular_buffer_test.py`. Using the
`-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 circular_buffer_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/circular-buffer` directory.
Expand Down
13 changes: 13 additions & 0 deletions exercises/clock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,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 clock_test.py`
(`py.test clock_test.py` for Python 2; `pytest <exercise>_test.py` for Python 3). Or run it with
`-v` to be more verbose like this: `pytest clock_test.py`. Using the
`-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 clock_test.py -v
```

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/clock` directory.
Expand Down
Loading