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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
PyBay
August 13, 2017
Programming
210
0
Share
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
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
720
2017 - Bringing Python 3 to LinkedIn
pybay
1
600
2017 - Python Debugging with PUDB
pybay
0
790
2017 - Opening up to Open Source
pybay
0
290
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
230
2017 - Performant Asynchronous Programming at Quora
pybay
1
420
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
580
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
730
Other Decks in Programming
See All in Programming
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
840
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
320
飯MCP
yusukebe
0
500
Radical Imagining - LIFT 2025-2027 Policy Agenda
lift1998
0
250
10 Tips of AWS ~Gen AI on AWS~
licux
5
280
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
260
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
300
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
0
130
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
220
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
460
Rethinking API Platform Filters
vinceamstoutz
0
11k
実践CRDT
tamadeveloper
0
440
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Odyssey Design
rkendrick25
PRO
2
570
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Visualization
eitanlees
150
17k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
220
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
170
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
260
Product Roadmaps are Hard
iamctodd
PRO
55
12k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
430
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
320
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