Skip to content

Commit

Permalink
add pytest-xdist not compatible with -s/--capture=no
Browse files Browse the repository at this point in the history
  • Loading branch information
copdips committed Dec 10, 2024
1 parent f864a7a commit 34ba5c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _archive_jekyll/assets/js/plugins/smooth-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
var firstCodeUnit = string.charCodeAt(0);
while (++index < length) {
codeUnit = string.charCodeAt(index);
// Note: theres no need to special-case astral symbols, surrogate
// Note: there's no need to special-case astral symbols, surrogate
// pairs, or lone surrogates.

// If the character is NULL (U+0000), then throw an
Expand Down
4 changes: 3 additions & 1 deletion docs/posts/2021/2021-06-12-python-unittest-cheat-sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,10 @@ pip install pytest-xdist[psutil]
pytest -n auto
```

!!! note
!!! warning "pytest-xdist is not compatible with -s/--capture=no"
Due to how `pytest-xdist` is implemented, the `-s/--capture=no` option does not work. a possible workaround is to [creating one log file for each worker](https://pytest-xdist.readthedocs.io/en/latest/how-to.html#creating-one-log-file-for-each-worker), and an example from this [StackOverflow answer](https://stackoverflow.com/a/76261063).

!!! note
There's another module [pytest-parallel](https://github.com/browsertron/pytest-parallel), the author says his module can run the tests in concurrency, and very efficient in integration tests, which tests might be stateful or sequential. I haven't tested yet, so cannot say anything here.

## Ensure each pytest-xdist worker has its own database connection
Expand Down

0 comments on commit 34ba5c1

Please sign in to comment.