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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
790
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
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
170
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
290
CDK Deployのための ”反響定位”
watany
5
920
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
310
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
370
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
130
Firefoxにコントリビューションして得られた学び
ken7253
2
150
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
150
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
Running Swift without an OS
kishikawakatsumi
0
870
PHPでローカル環境用のSSL/TLS証明書を発行することはできるのか? #phpconkagawa
akase244
0
290
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
130
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Bash Introduction
62gerente
615
210k
Statistics for Hackers
jakevdp
799
230k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.9k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
190
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Marketing to machines
jonoalderson
1
5.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
160
Designing Powerful Visuals for Engaging Learning
tmiket
1
360
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