Skip to content

Commit f1c0c04

Browse files
committed
Updated README files of main repo and exc01
1 parent 630fcf3 commit f1c0c04

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,24 @@ These exercises are intended to complement [The Python Ledger](https://thepython
1010
2. **Install dependencies.** From the repo root:
1111
```bash
1212
python -m venv .venv
13-
source .venv/bin/activate # .venv\Scripts\activate on Windows
13+
source .venv/bin/activate
1414
pip install -r requirements-dev.txt
1515
```
1616
3. **Each exercise directory contains:**
1717
- `README.md` — the task description
1818
- `<exercise_name>.py` — a mostly-empty file where you write your code
1919
- `test_<exercise_name>.py` — the tests that check your code
2020
- `solution/` — a reference solution, plus the same tests fully unlocked
21-
4. **Run tests for one exercise** by `cd`-ing into its folder and running:
21+
4. **Run tests for first exercise** by running:
2222
```bash
23-
pytest test_<exercise_name>.py -v
23+
python check.py 01
2424
```
2525
The first run will fail. That's expected — open the exercise file and write the code needed to make it pass.
26+
27+
All excercises are marked numericly, so you can use the number, or use the full path to test (TAB completions work too)
28+
```bash
29+
python check.py foundations/01_hello_world
30+
```
2631
5. **Some tests start marked `@pytest.mark.skip`.** This is intentional, same idea as unlocking levels. Once the active test passes, open the spec file, remove the `@pytest.mark.skip(...)` line above the next test, and run again. Keep going until every test in the file passes with no skips left.
2732
6. **Once you're done**, compare against `solution/` — but not before. There's more than one valid way to pass the tests; the solution is just one example.
2833

‎exercises/foundations/01_hello_world/README.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ In this directory you'll find 2 other files:
77
1. `hello_world.py`
88
2. `test_hello_world.py`
99

10-
Run the test from inside this directory:
10+
Run the test from the root directory (python-exercises):
11+
**Note:** try `python3` if the command fails
1112

1213
```bash
13-
pytest test_hello_world.py -v
14+
python check.py 01
15+
```
16+
or
17+
```bash
18+
python check.py foundations/01_hello_world
1419
```
1520

1621
Watch it fail. Right now `hello_world.py` is empty, so nothing gets printed.

0 commit comments

Comments
 (0)