Skip to content

Commit 01fb257

Browse files
glaxxieBethanyG
andauthored
Update TESTS.md (exercism#3830)
* Update TESTS.md - Change placeholder brackets from `{}` to `<>` - Add a note explain placeholder value - Change pytest version number to reflect the latest one * Update TOOLS.md Small change to fit with the version in `INSTALLATION.md` * Update docs/TESTS.md Using exercism note block and clearer example Co-authored-by: BethanyG <[email protected]> * Update docs/TOOLS.md Add more details about tooling Co-authored-by: BethanyG <[email protected]> --------- Co-authored-by: BethanyG <[email protected]>
1 parent c38e94b commit 01fb257

File tree

2 files changed

+33
-17
lines changed

2 files changed

+33
-17
lines changed

docs/TESTS.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,51 @@ Otherwise, the `pytest` installation will be global.
2828

2929
```powershell
3030
PS C:\Users\foobar> py -m pip install pytest pytest-cache pytest-subtests pytest-pylint
31-
Successfully installed pytest-7.2.2 ...
31+
Successfully installed pytest-8.3.3 ...
3232
```
3333

3434
#### Linux / MacOS
3535

3636
```bash
3737
$ python3 -m pip install pytest pytest-cache pytest-subtests pytest-pylint
38-
Successfully installed pytest-7.2.2 ...
38+
Successfully installed pytest-8.3.3 ...
3939

4040
```
4141

4242
To check if installation was successful:
4343

4444
```bash
4545
$ python3 -m pytest --version
46-
pytest 7.2.2
46+
pytest 8.3.3
4747
```
4848

4949
## Running the tests
5050

51-
To run the tests, go to the folder where the exercise is stored using `cd` in your terminal (_replace `{exercise-folder-location}` below with your path_).
51+
To run the tests, go to the folder where the exercise is stored using `cd` in your terminal (_replace `<exercise-folder-location>` below with your path_).
5252

5353
```bash
54-
$ cd {exercise-folder-location}
54+
$ cd <exercise-folder-location>
5555
```
5656

57+
<br>
58+
59+
~~~~exercism/note
60+
`<exercise-folder-location>` or most things inside angle brackets denote a **_placeholder value_**.
61+
A normal path or file name should be written _without_ any brackets.
62+
63+
64+
For example: `/Users/janedoe/exercism/python/exercises/concept/chaitanas-colossal-coaster` (on *nix systems), `C:\Users\janedoe\exercism\python\exercises\practice\hello-world\` (on Windows), `myFolder` or `my_file.py`.
65+
~~~~
66+
67+
<br>
68+
69+
5770
The file you will want to run usually ends in `_test.py`.
5871
This file contains the tests for the exercise solution, and are the same tests that run on the website when a solution is uploaded.
59-
Next, run the following command in your terminal, replacing `{exercise_test.py}` with the location/name of the test file:
72+
Next, run the following command in your terminal, replacing `<exercise_test.py>` with the location/name of the test file:
6073

6174
```bash
62-
$ python3 -m pytest -o markers=task {exercise_test.py}
75+
$ python3 -m pytest -o markers=task <exercise_test.py>
6376
==================== 7 passed in 0.08s ====================
6477
```
6578

@@ -88,15 +101,15 @@ When tests fail, `pytest` prints the text of each failed test, along with the ex
88101
Below is an generic example of a failed test:
89102

90103
```bash
91-
$(my_venv) python3 -m pytest -o markers=task {exercise_test.py}
104+
$(my_venv) python3 -m pytest -o markers=task <exercise_test.py>
92105

93106
=================== FAILURES ====================
94107
______________ name_of_failed_test ______________
95-
# Test code inside of {exercise_test.py} that failed.
108+
# Test code inside of <exercise_test.py> that failed.
96109
...
97110
E TypeOfError: ReturnedValue != ExpectedValue
98111

99-
exercise_test.py:{line_of_failed_test}: TypeOfError
112+
exercise_test.py:<line_of_failed_test>: TypeOfError
100113
============ short test summary info ============
101114
FAILED exercise_test.py::ExerciseTest::name_of_failed_test
102115
========== 1 failed, 2 passed in 0.13s ==========
@@ -216,10 +229,10 @@ If you do not know where you have installed Python, run the following command in
216229

217230
```bash
218231
$ python3 -c "import os, sys; print(os.path.dirname(sys.executable))"
219-
{python_directory}
232+
<python_directory>
220233
```
221234

222-
The _returned_ directory is where your current active Python version is installed, in this section it is referred to as `{python_directory}`.
235+
The _returned_ directory is where your current active Python version is installed, in this section it is referred to as `<python_directory>`.
223236

224237
#### Windows
225238

@@ -232,25 +245,25 @@ Then find the `Path` variable in your _User variables_, select it, and click `Ed
232245

233246
![Selecting the path variable](https://raw.githubusercontent.com/exercism/python/main/docs/img/Windows-EnvironmentVariables.png)
234247

235-
Then add a new line, as shown in the picture, replacing `{python_directory}` with your Python installation's directory:
248+
Then add a new line, as shown in the picture, replacing `<python_directory>` with your Python installation's directory:
236249

237250
![Add python to path](https://raw.githubusercontent.com/exercism/python/main/docs/img/Windows-AddPythonPath.png)
238251

239252
#### MacOS/Linux
240253

241254
The below should work for most Linux and MacOS flavors with a `bash` shell.
242255
Commands may vary by Linux distro, and whether a `fish` or `zsh` shell is used.
243-
Replace `{python_directory}` with the output of `python3 -c "import os, sys; print(os.path.dirname(sys.executable))"`
256+
Replace `<python_directory>` with the output of `python3 -c "import os, sys; print(os.path.dirname(sys.executable))"`
244257

245258
```bash
246-
export PATH=”$PATH:{python_directory}}
259+
export PATH=”$PATH:<python_directory>
247260
```
248261

249262
[Code Quality: Tools and Best Practices]: https://realpython.com/python-code-quality/
250263
[Getting Started Guide]: https://docs.pytest.org/en/latest/getting-started.html
251264
[configuration file formats]: https://docs.pytest.org/en/6.2.x/customize.html#configuration-file-formats
252265
[marking test functions with attributes]: https://docs.pytest.org/en/6.2.x/mark.html#raising-errors-on-unknown-marks
253-
[pdb]: https://docs.python.org/3.9/library/pdb.html
266+
[pdb]: https://docs.python.org/3.11/library/pdb.html
254267
[pip]: https://pip.pypa.io/en/stable/getting-started/
255268
[psf-installer]: https://www.python.org/downloads/
256269
[pylint]: https://pylint.pycqa.org/en/latest/user_guide/

docs/TOOLS.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ If you have an editor, IDE, tool, or plugin recommendation, we encourage you to
3030

3131

3232
Before you start exploring, make sure that you have a recent version of Python installed.
33-
The Exercism platform currently supports `Python 3.7 - 3.11.2` (_exercises and tests_) and `Python 3.11.2` (_tooling_).
33+
The Exercism web platform currently supports `Python 3.7 - 3.11.5` (_exercises and tests_) and `Python 3.11.5` (_tooling_).
34+
Our online test runner currently uses `pytest 7.2.2` and `pytest-subtests 0.11.0`.
35+
Our online analyzer uses `pylint 2.17.7`.
36+
Using different versions of `Python`, `pytest`, or `pylint` locally might give you different results than the website.
3437
For more information, please refer to [Installing Python locally][Installing Python locally].
3538

3639
<br>

0 commit comments

Comments
 (0)