Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2017 - Reverb Chu - Concurrent Testing with py.test

PyBay
August 13, 2017

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

More Decks by PyBay

Other Decks in Programming

Transcript

  1. Concurrent Testing with py.test Reverb Chu, Sr. SWE @ Trend

    Micro James Wang, UGrad CS Student @ Uni. of Washington
  2. Why Not pytest-xdist? - Designed for test distribution - Only

    support multiprocessing - Not able to do test grouping https://goo.gl/mxthn3
  3. 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
  4. 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
  5. May ?? I want it... Jul 31 Let’s Do This

    Jun 20 Intern Onboard https://goo.gl/mxthn3
  6. 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