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
590
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
400
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
560
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
720
Other Decks in Programming
See All in Programming
猫の手も借りたい!ので AIエージェント猫を作って社内に放した話 Claude Code × Container Lambda の Slack Bot "DevNeko"
naramomi7
0
260
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
670
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
220
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
510
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
200
CopilotKit + AG-UIを学ぶ
nearme_tech
PRO
2
150
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
380
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
CSC307 Lecture 13
javiergs
PRO
0
310
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
360
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
290
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Chasing Engaging Ingredients in Design
codingconduct
0
130
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
290
How to train your dragon (web standard)
notwaldorf
97
6.5k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
960
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
Mobile First: as difficult as doing things right
swwweet
225
10k
Making Projects Easy
brettharned
120
6.6k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
140
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
110
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
230
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