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
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
600
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
580
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
730
Other Decks in Programming
See All in Programming
アーキテクチャモダナイゼーションとは何か
nwiizo
17
4.8k
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.8k
Radical Imagining - LIFT 2025-2027 Policy Agenda
lift1998
0
250
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
580
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
840
Go_College_最終発表資料__外部公開用_.pdf
xe_pc23
0
180
Make GenAI Production-Ready with Kubernetes Patterns
bibryam
0
110
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
160
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
260
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
380
Nuxt Server Components
wattanx
0
260
感情を設計する
ichimichi
5
1.4k
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
Abbi's Birthday
coloredviolet
2
6.7k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.5k
Paper Plane (Part 1)
katiecoart
PRO
0
6.5k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
680
The World Runs on Bad Software
bkeepers
PRO
72
12k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
240
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Testing 201, or: Great Expectations
jmmastey
46
8.1k
How to train your dragon (web standard)
notwaldorf
97
6.6k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
53k
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