Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
2017 - Reverb Chu - Concurrent Testing with py....
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
PyBay
August 13, 2017
Programming
0
200
2017 - Reverb Chu - Concurrent Testing with py.test
Introducing a different way to perform concurrent testing with the py.test framework.
PyBay
August 13, 2017
Tweet
Share
More Decks by PyBay
See All by PyBay
2017 - The Packaging Gradient
pybay
2
1k
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
710
2017 - Bringing Python 3 to LinkedIn
pybay
1
600
2017 - Python Debugging with PUDB
pybay
0
780
2017 - Opening up to Open Source
pybay
0
280
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
220
2017 - Performant Asynchronous Programming at Quora
pybay
1
400
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
570
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
720
Other Decks in Programming
See All in Programming
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
130
Java 21/25 Virtual Threads 소개
debop
0
230
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
120
AHC061解説
shun_pi
0
410
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
450
AI活用のコスパを最大化する方法
ochtum
0
270
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
530
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
370
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
370
Codex の「自走力」を高める
yorifuji
0
1.3k
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.3k
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
230
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
190
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.5k
4 Signs Your Business is Dying
shpigford
187
22k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
230
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.2k
The Language of Interfaces
destraynor
162
26k
How STYLIGHT went responsive
nonsquared
100
6k
We Have a Design System, Now What?
morganepeng
55
8k
Visualization
eitanlees
150
17k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
88
Speed Design
sergeychernyshev
33
1.6k
Prompt Engineering for Job Search
mfonobong
0
210
Transcript
Concurrent Testing with py.test Reverb Chu, Sr. SWE @ Trend
Micro James Wang, UGrad CS Student @ Uni. of Washington
https://goo.gl/mxthn3
https://goo.gl/mxthn3 https://www.apple.com/macbook/
https://goo.gl/mxthn3
Current Solutions https://goo.gl/mxthn3
Current Solutions 1. pytest-xdist https://goo.gl/mxthn3
Current Solutions 1. pytest-xdist 2. ...there’s no 2. https://goo.gl/mxthn3
Why Not pytest-xdist? - Designed for test distribution - Only
support multiprocessing - Not able to do test grouping https://goo.gl/mxthn3
pytest-concurrent life is too short for sequential tests https://goo.gl/mxthn3
Different Concurrent Mode mthread - Impl. with threading - For
IO intensive tests mproc - Impl. with multiprocessing - For CPU intensive tests asyncnet - Impl. with gevent - For network IO intensive tests https://goo.gl/mxthn3
Configurable Worker Amount $ pytest --concmode=mthread --concworkers=10 https://goo.gl/mxthn3
Configurable Worker Amount $ pytest --concmode=mthread --concworkers=max https://goo.gl/mxthn3
Testing in Groups import pytest import time @pytest.mark.concgroup(1) @pytest.mark.parametrize('para', [1,
2, 3, 4, 5]) def test_something(para): time.sleep(2) assert para % 2 @pytest.mark.concgroup(1) def test_something_else(): time.sleep(1) assert 1 == 2 @pytest.mark.concgroup(2) @pytest.mark.parametrize('name', ['this', 'is', 'a', 'book']) def test_second_group(name): time.sleep(2) def test_something_last(): time.sleep(2) raise MemoryError @pytest.mark.concgroup(group: int) https://goo.gl/mxthn3
May ?? I want it... https://goo.gl/mxthn3
May ?? I want it... Jun 20 Intern Onboard https://goo.gl/mxthn3
May ?? I want it... Jul 31 Let’s Do This
Jun 20 Intern Onboard https://goo.gl/mxthn3
May ?? I want it... Aug 11 v0.1.2 Jul 31
Let’s Do This Jun 20 Intern Onboard Aug 10 v0.1.1 Aug 9 v0.1.0 https://goo.gl/mxthn3
$ pip install pytest-concurrent https://goo.gl/mxthn3 @reverbc @jamesw96