Skip to content

Commit 5679646

Browse files
Added pytest run to Part 1
1 parent 2cd6bf4 commit 5679646

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,20 @@ The `pass` statement at the end is just a no-op.
242242

243243
Remember, write test *cases* before you write test *code*.
244244

245+
Before continuing, run this test to make sure everything is set up correctly:
246+
247+
```bash
248+
$ python3 -m pytest tests
249+
```
250+
251+
pytest should discover, run, and pass the single test case under the `tests` directory.
252+
253+
*A note about the pytest command:*
254+
Many online articles and examples use the `pytest` command directly to run tests, like this: `pytest tests`.
255+
Unfortunately, this version of the command does **not** add the current directory to the Python path.
256+
If your tests reference anything outside of their test modules, then the command will fail.
257+
Therefore, I always recommend running the full `python3 -m pytest tests` command.
258+
245259

246260
### Part 2: First steps with Playwright
247261

0 commit comments

Comments
 (0)