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
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
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
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
ソフトウェアラスタライザ
fadis
1
800
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
520
Press start. Python's next generation.
willingc
PRO
3
330
新卒PdEのリアル
ryu1013
1
480
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
140
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
270
XHTMLが残したもの
yosuke_furukawa
PRO
2
640
typoなんかねぇよ
raspython3
0
680
Foundry Localでエージェント開発
seosoft
0
160
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.9k
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
アクセシビリティから考える情報設計
high_g_engineer
0
350
Featured
See All Featured
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
New Earth Scene 8
popppiees
3
2.5k
Six Lessons from altMBA
skipperchong
29
4.5k
It's Worth the Effort
3n
188
29k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Producing Creativity
orderedlist
PRO
348
41k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
510
Google's AI Overviews - The New Search
badams
0
1.6k
AI: The stuff that nobody shows you
jnunemaker
PRO
9
980
Designing Experiences People Love
moore
143
24k
Crafting Experiences
bethany
1
310
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