Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
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
640
2017 - Python Debugging with PUDB
pybay
0
840
2017 - Opening up to Open Source
pybay
0
320
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
250
2017 - Performant Asynchronous Programming at Quora
pybay
1
450
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
630
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
760
Other Decks in Programming
See All in Programming
【デモ】Kiroで体験する仕様駆動開発|設計からコーディングまでAIと進める開発フロー
cmkudo
0
600
アクセシビリティから考える情報設計
high_g_engineer
0
320
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
Deep dive into the select statement (GopherCon UK)
jespino
0
170
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
120
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
XHTMLが残したもの
yosuke_furukawa
PRO
2
450
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
160
スマート反転とウェブアクセシビリティ
camiha
0
160
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
110
typoなんかねぇよ
raspython3
0
670
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
680
Featured
See All Featured
Between Models and Reality
mayunak
4
450
Being A Developer After 40
akosma
91
590k
Google's AI Overviews - The New Search
badams
0
1.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Writing Fast Ruby
sferik
630
63k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
560
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
540
Done Done
chrislema
186
16k
WENDY [Excerpt]
tessaabrams
12
39k
Practical Orchestrator
shlominoach
191
12k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
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