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
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
610
2017 - Python Debugging with PUDB
pybay
0
800
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
590
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
740
Other Decks in Programming
See All in Programming
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
6
1.2k
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
250
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
380
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
330
AIとRubyの静的型付け
ukin0k0
0
140
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
130
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
150
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
250
Swiftのレキシカルスコープ管理
kntkymt
0
200
[BalkanRuby 2026] Drop your app/services!
palkan
3
700
iOS26時代の新規アプリ開発
yuukiw00w
0
210
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
760
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
140
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Test your architecture with Archunit
thirion
1
2.2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
The Curious Case for Waylosing
cassininazir
1
360
Information Architects: The Missing Link in Design Systems
soysaucechin
0
940
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.7k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
120
Making the Leap to Tech Lead
cromwellryan
135
9.8k
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