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
410
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
730
Other Decks in Programming
See All in Programming
Claude Codeログ基盤の構築
giginet
PRO
7
3.7k
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
270
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
370
ロボットのための工場に灯りは要らない
watany
12
3.2k
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
150
OTP を自動で入力する裏技
megabitsenmzq
0
130
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
200
AI Assistants for YourAngular Solutions @Angular Graz, March 2026
manfredsteyer
PRO
0
110
Codex の「自走力」を高める
yorifuji
0
1.3k
The free-lunch guide to idea circularity
hollycummins
0
360
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
400
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
560
Featured
See All Featured
How to build a perfect <img>
jonoalderson
1
5.3k
For a Future-Friendly Web
brad_frost
183
10k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
790
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
280
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
200
Site-Speed That Sticks
csswizardry
13
1.1k
Designing for Performance
lara
611
70k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
410
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
250
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
340
Unsuck your backbone
ammeep
672
58k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
120
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