Skip to content

Commit

Permalink
add "Running the tests" section to README template (#1271)
Browse files Browse the repository at this point in the history
* add "Running the tests" section to README template

* regenerate README files with new template

* rewrite Running the tests section for clarity

* -switch to a plaintext-readable format
-add link explaining py.test vs pytest
  • Loading branch information
cmccandless authored Feb 26, 2018
1 parent c7a6ae2 commit 875a78a
Show file tree
Hide file tree
Showing 114 changed files with 1,938 additions and 0 deletions.
17 changes: 17 additions & 0 deletions config/exercise_readme.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test {{ .Spec.SnakeCaseName }}_test.py`
- Python 3.3+: `pytest {{ .Spec.SnakeCaseName }}_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest {{ .Spec.SnakeCaseName }}_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## 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
17 changes: 17 additions & 0 deletions exercises/accumulate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test accumulate_test.py`
- Python 3.3+: `pytest accumulate_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest accumulate_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/accumulate` directory.
Expand Down
17 changes: 17 additions & 0 deletions exercises/acronym/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test acronym_test.py`
- Python 3.3+: `pytest acronym_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest acronym_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/acronym` directory.
Expand Down
17 changes: 17 additions & 0 deletions exercises/all-your-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test all_your_base_test.py`
- Python 3.3+: `pytest all_your_base_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest all_your_base_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## 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
17 changes: 17 additions & 0 deletions exercises/allergies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test allergies_test.py`
- Python 3.3+: `pytest allergies_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest allergies_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/allergies` directory.
Expand Down
17 changes: 17 additions & 0 deletions exercises/alphametics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test alphametics_test.py`
- Python 3.3+: `pytest alphametics_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest alphametics_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/alphametics` directory.
Expand Down
17 changes: 17 additions & 0 deletions exercises/anagram/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test anagram_test.py`
- Python 3.3+: `pytest anagram_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest anagram_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/anagram` directory.
Expand Down
17 changes: 17 additions & 0 deletions exercises/armstrong-numbers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test armstrong_numbers_test.py`
- Python 3.3+: `pytest armstrong_numbers_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest armstrong_numbers_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## 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
17 changes: 17 additions & 0 deletions exercises/atbash-cipher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test atbash_cipher_test.py`
- Python 3.3+: `pytest atbash_cipher_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest atbash_cipher_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## 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
17 changes: 17 additions & 0 deletions exercises/beer-song/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test beer_song_test.py`
- Python 3.3+: `pytest beer_song_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest beer_song_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## 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
17 changes: 17 additions & 0 deletions exercises/binary-search-tree/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test binary_search_tree_test.py`
- Python 3.3+: `pytest binary_search_tree_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest binary_search_tree_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## 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
17 changes: 17 additions & 0 deletions exercises/binary-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test binary_search_test.py`
- Python 3.3+: `pytest binary_search_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest binary_search_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## 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
17 changes: 17 additions & 0 deletions exercises/binary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test binary_test.py`
- Python 3.3+: `pytest binary_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest binary_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/binary` directory.
Expand Down
17 changes: 17 additions & 0 deletions exercises/bob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test bob_test.py`
- Python 3.3+: `pytest bob_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest bob_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `$EXERCISM_WORKSPACE/python/bob` directory.
Expand Down
17 changes: 17 additions & 0 deletions exercises/book-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test book_store_test.py`
- Python 3.3+: `pytest book_store_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest book_store_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## 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
17 changes: 17 additions & 0 deletions exercises/bowling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,23 @@ 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 appropriate command below ([why they are different](https://github.com/pytest-dev/pytest/issues/1629#issue-161422224)):

- Python 2.7: `py.test bowling_test.py`
- Python 3.3+: `pytest bowling_test.py`

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardless of Python version):
`python -m pytest bowling_test.py`

### Common pytest options
- -v : enable verbose output
- -x : stop running tests on first failure
- --ff : run failures from previous test before running other test cases

For other options, see `python -m pytest -h`

## Submitting Exercises

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

0 comments on commit 875a78a

Please sign in to comment.