• This repository has been archived on 29/May/2024
  • Stars
    star
    313
  • Rank 133,714 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A pytest plugin for parallel and concurrent testing

Maintainers needed

The project is currently unmaintained

pytest-parallel

a pytest plugin for parallel and concurrent testing

What?

This plugin makes it possible to run tests quickly using multiprocessing (parallelism) and multithreading (concurrency).

Why?

pytest-xdist is great to run tests that:

  1. aren't threadsafe
  2. perform poorly when multithreaded
  3. need state isolation

pytest-parallel is better for some use cases (like Selenium tests) that:

  1. can be threadsafe
  2. can use non-blocking IO for http requests to make it performant
  3. manage little or no state in the Python environment

Put simply, pytest-xdist does parallelism while pytest-parallel does parallelism and concurrency.

Requirements

  • Python3 version [3.6+]
  • Unix or Mac for --workers
  • Unix, Mac, or Windows for --tests-per-worker

Installation

pip install pytest-parallel

Options

  • workers (optional) - max workers (aka processes) to start. Can be a positive integer or auto which uses one worker per core. Defaults to 1.
  • 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.

Examples

# runs 2 workers with 1 test per worker at a time
pytest --workers 2

# runs 4 workers (assuming a quad-core machine) with 1 test per worker
pytest --workers auto

# runs 1 worker with 4 tests at a time
pytest --tests-per-worker 4

# runs 1 worker with up to 50 tests at a time
pytest --tests-per-worker auto

# runs 2 workers with up to 50 tests per worker
pytest --workers 2 --tests-per-worker auto

Notice

Beginning with Python 3.8, forking behavior is forced on macOS at the expense of safety.

Changed in version 3.8: On macOS, the spawn start method is now the default. The fork start method should be considered unsafe as it can lead to crashes of the subprocess. See bpo-33725.

Source

License

MIT

More Repositories

1

fireway

A schema migration tool for firestore
JavaScript
277
star
2

isomorphic-webcrypto

🎲 webcrypto library for Node, React Native and IE11+
JavaScript
116
star
3

sikuli_cpython

UNMAINTAINED: A CPython wrapper around the sikuli standalone jar
Python
61
star
4

msrCrypto

GitHub mirror of the MSR JavaScript Cryptography Library
JavaScript
24
star
5

csvToXspf

Python
10
star
6

pyrson

A Digital Life Assistant (DLA) linking several Python libraries
Rust
10
star
7

debug-webpack-plugin

Debug webpack builds and plugins
JavaScript
9
star
8

Sahi

Sahi Open Source
Java
8
star
9

remarkable-node

Unofficial reMarkable api wrapper for node.js
JavaScript
6
star
10

pytanium

Wrapper for Selenium
Python
5
star
11

foodmarklet

Bookmarklet version of plainoldrecipe
JavaScript
5
star
12

hex-lite

📐 isomorphic hex library in 256 bytes
JavaScript
4
star
13

threadwork

Simple, no frills, threading in Node.js
JavaScript
4
star
14

b64-lite

🎮 isomorphic base64 library in 377 bytes
JavaScript
4
star
15

talkjs-node

A Node.js wrapper for the talkjs rest api
TypeScript
3
star
16

webcrypto-test-suite

A library to ensure your WebCrypto polyfill or shim works correctly
JavaScript
2
star
17

jose

🌐 Collection of JSON Web libraries
JavaScript
2
star
18

globally.js

Add javascript global event listeners in bulk
JavaScript
1
star
19

webcrypto-react-native-examples

Examples of using isomorphic-webcrypto with React Native
Objective-C
1
star
20

python-webdriver-stress-test

Stress test the Python Selenium WebDriver http://selenium-python.readthedocs.io/api.html
Python
1
star
21

Urika

Dead project
Java
1
star
22

swree

Bundles swr, htm, preact and wouter to skip the build step
JavaScript
1
star
23

ZK

(Z)illion (K)eys - Public app/license management.
Python
1
star