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
pytest-concurrent @ PyBay 2017
Search
Reverb C.
August 13, 2017
Programming
1
320
pytest-concurrent @ PyBay 2017
Introduce to pytest-concurrent plugin in lightning talk of PyBay 2017
https://goo.gl/mxthn3
Reverb C.
August 13, 2017
Tweet
Share
More Decks by Reverb C.
See All by Reverb C.
師大資工系友就業講座
reverbc
0
180
Trend Micro Device App Contest Final Demo
reverbc
0
58
Other Decks in Programming
See All in Programming
CQRS/ES avec Symfony, c’est (trop) bien !
jeremyfreeagent
1
630
チームでモデリングを育てるうえで 考えたこと・気づいたこと / Cultivating Modeling in Teams: Thoughts and Insights
mackey0225
7
4.1k
コーンフレークから始める モデリング会話入門
ogurotakayuki
0
270
ONE WEDGE_company_guide
1wedge_one
0
340
Hanami and htmx
bkuhlmann
0
190
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
170
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
180
Elm 0.19.0 Changes
bkuhlmann
0
480
Code Reviews
bkuhlmann
4
870
App Router への移行は「改善」となり得るのか?/ Can migration to App Router be an improvement
takefumiyoshii
8
2.1k
ログラスを支える設計標準について / loglass-design-standards
urmot
10
2.1k
1인 개발자로 행복하게 살기 - GDG 송도 헬로월드 2024
benjaminkim
1
5.6k
Featured
See All Featured
Docker and Python
trallard
33
2.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
13
1.5k
Happy Clients
brianwarren
91
6.4k
Designing Experiences People Love
moore
135
23k
Building an army of robots
kneath
300
41k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
8
8.3k
The Cult of Friendly URLs
andyhume
73
5.7k
Git: the NoSQL Database
bkeepers
PRO
421
63k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
355
22k
Gamification - CAS2011
davidbonilla
76
4.6k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
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 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... 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