Skip to content

Instantly share code, notes, and snippets.

View spwilson2's full-sized avatar

Sean spwilson2

  • Droogle
  • Mountain View, CA
View GitHub Profile
@spwilson2
spwilson2 / custom_sheduler.py
Created June 27, 2017 16:11 — forked from wronglink/custom_sheduler.py
Custom pytest-xdist scheduler that groups tests by TestCase
import itertools
from xdist.dsession import LoadScheduling
"""
Custom scheduler implementation that prevents running in parallel tests, that belong same class (TestCase).
Custom scheduler support implemented in this PR: https://github.com/pytest-dev/pytest-xdist/pull/89
"""
class GroupedLoadScheduling(LoadScheduling):
def check_schedule(self, node, duration=0):