Skip to content
This repository was archived by the owner on May 29, 2024. It is now read-only.

Commit 6ddba5d

Browse files
committed
Initial functionality
1 parent 6c91523 commit 6ddba5d

File tree

6 files changed

+553
-1
lines changed

6 files changed

+553
-1
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Len Boyette
3+
Copyright (c) 2018-Present Browsertron
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Pipfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
pytest = ">=3.0.0"
8+
9+
[dev-packages]
10+
pylint = "*"
11+
twine = ">=1.11.0"
12+
wheel = ">=0.31.0"
13+
setuptools = ">=39.0.1"
14+
15+
[requires]
16+
python_version = "3.6"
17+
18+
[scripts]
19+
build = "python setup.py sdist bdist_wheel"
20+
deploy = "twine upload dist/*"

Pipfile.lock

Lines changed: 216 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,57 @@
11
# pytest-parallel
22
a py.test plugin for parallel and concurrent testing
3+
4+
## What?
5+
6+
This plugin makes it possible to run tests quickly using multiprocessing (parallelism) and multithreading (concurrency).
7+
8+
## Why?
9+
10+
`pytest-xdist` is great to run tests that:
11+
1. aren't threadsafe
12+
2. perform poorly when multithreaded
13+
3. need state isolation
14+
15+
`pytest-parallel` is better for some use cases (like Selenium tests) that:
16+
1. can be threadsafe
17+
2. can use non-blocking IO for http requests to make it performant
18+
3. manage little or no state in the Python environment
19+
20+
Put simply, `pytest-xdist` does parallelism while `pytest-parallel` does parallelism and concurrency.
21+
22+
## Requirements
23+
24+
* Python3 version [3.6+]
25+
* Unix or Mac for parallelism
26+
27+
## Installation
28+
29+
`pip install pytest-parallel`
30+
31+
## Options
32+
33+
* `workers` (optional) - max workers (aka processes) to start. Can be a **positive integer or `auto`** which uses one worker per core. **Defaults to 1**.
34+
* `tests-per-worker` (optional) - max concurrent tests per worker. Can be a **positive integer or `auto`** which evenly divides tests among the workers up to 50 concurrent tests. **Defaults to 1**.
35+
36+
## Examples
37+
38+
```bash
39+
# runs 2 workers with 1 test per worker at a time
40+
pytest --workers 2
41+
42+
# runs 4 workers (assuming a quad-core machine) with 1 test per worker
43+
pytest --workers auto
44+
45+
# runs 1 worker with 4 tests at a time
46+
pytest --tests-per-worker 4
47+
48+
# runs 1 worker with up to 50 tests at a time
49+
pytest --tests-per-worker auto
50+
51+
# runs 2 workers with up to 50 tests per worker
52+
pytest --workers 2 --tests-per-worker auto
53+
```
54+
55+
## License
56+
57+
MIT

0 commit comments

Comments
 (0)