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
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
1.1k
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
750
2017 - Bringing Python 3 to LinkedIn
pybay
1
630
2017 - Python Debugging with PUDB
pybay
0
840
2017 - Opening up to Open Source
pybay
0
310
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
250
2017 - Performant Asynchronous Programming at Quora
pybay
1
440
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
620
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
760
Other Decks in Programming
See All in Programming
ソフトウェアラスタライザ
fadis
1
280
Oxlintはいいぞ(続)
yug1224
1
340
FastAPI の並行処理モデルを完全に理解する
hoto17296
7
2.4k
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
530
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
220
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
5
500
運用ダッシュボードの設計を誰も教えてくれないのだけどみなさんどうしてるんですか? - チームに監視するという文化を根付かせるための第一歩を踏みたい -
satoshi256kbyte
1
140
typoなんかねぇよ
raspython3
0
250
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
220
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.6k
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
120
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
120
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.5k
Google's AI Overviews - The New Search
badams
0
1.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Deep Space Network (abreviated)
tonyrice
0
260
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
How to train your dragon (web standard)
notwaldorf
97
6.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
900
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
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