Skip to content

Commit

Permalink
Update README, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
olzhasar committed Feb 6, 2024
1 parent d65f996 commit 89d60b9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ Example:
### Why not general tools

- Easy to use and remember
- Works for most python projects out of the box
- Works for most Python projects out of the box
- Uses native system monitoring API instead of polling on supported systems (see [watchdog documentation](https://python-watchdog.readthedocs.io/en/stable/installation.html#supported-platforms-and-caveats))
- Listens for new file, delete file, change and move events
- Runs your tests with latest changes in case of post-processing events (see [delay](#delay))
- Has interactive mode with handy keyboard shortcuts

### What about pytest-watch

Expand Down
26 changes: 20 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ Example:
### Why not general tools

- Easy to use and remember
- Works for most python projects out of the box
- Works for most Python projects out of the box
- Uses native system monitoring API instead of polling on supported systems (see [watchdog documentation](https://python-watchdog.readthedocs.io/en/stable/installation.html#supported-platforms-and-caveats))
- Listens for new file, delete file, change and move events
- Runs your tests with latest changes in case of post-processing events (see [delay](#delay))
- Has interactive mode with handy keyboard shortcuts

### What about pytest-watch

Expand Down Expand Up @@ -103,23 +104,35 @@ ptw . --ignore-patterns 'settings.py,db.py'

You can control the actual delay value with the `--delay` flag:

`ptw . --delay 0.2`
```sh
ptw . --delay 0.2
```

To disable the delay altogether, you can set zero as a value:

`ptw . --delay 0`
```sh
ptw . --delay 0
```

### Screen clearing

Use the `--clear` flag to clear the terminal screen before each test run

```sh
ptw . --clear
```

### Differences with `pytest-watch`

Even though this project was inspired by [`pytest-watch`](https://github.com/joeyespo/pytest-watch), it's not a fork of it. Therefore, there are **differences** in behavior:

- `pytest-watch` needs you to specify a path to watch as a first argument:
- `pytest-watcher` needs you to specify a path to watch as a first argument:

```
```sh
ptw .
```

- `pytest-watch` doesn't start tests immediately by default. You can customize this behavior using `--now` flag.
- `pytest-watcher` doesn't start tests immediately by default. You can customize this behavior using `--now` flag.

## Configuring

Expand All @@ -128,6 +141,7 @@ You can configure `pytest-watcher` via `pyproject.toml` file. Here is the defaul
```toml
[tool.pytest-watcher]
now = false
clear = true
delay = 0.2
runner = "pytest"
runner_args = []
Expand Down

0 comments on commit 89d60b9

Please sign in to comment.