Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New scheduler for distribution of groups of related tests #191

Merged
merged 6 commits into from
Aug 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions example/loadscope/epsilon/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
def epsilon1(arg1, arg2=1000):
"""Do epsilon1

Usage:

>>> epsilon1(10, 20)
40
>>> epsilon1(30)
1040
"""
return arg1 + arg2 + 10


def epsilon2(arg1, arg2=1000):
"""Do epsilon2

Usage:

>>> epsilon2(10, 20)
-20
>>> epsilon2(30)
-980
"""
return arg1 - arg2 - 10


def epsilon3(arg1, arg2=1000):
"""Do epsilon3

Usage:

>>> epsilon3(10, 20)
200
>>> epsilon3(30)
30000
"""
return arg1 * arg2
3 changes: 3 additions & 0 deletions example/loadscope/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ipdb
pytest
../../
51 changes: 51 additions & 0 deletions example/loadscope/test/test_alpha.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from time import sleep


def test_alpha0():
sleep(5)
assert True


def test_alpha1():
sleep(5)
assert True


def test_alpha2():
sleep(5)
assert True


def test_alpha3():
sleep(5)
assert True


def test_alpha4():
sleep(5)
assert True


def test_alpha5():
sleep(5)
assert True


def test_alpha6():
sleep(5)
assert True


def test_alpha7():
sleep(5)
assert True


def test_alpha8():
sleep(5)
assert True


def test_alpha9():
sleep(5)
assert True
51 changes: 51 additions & 0 deletions example/loadscope/test/test_beta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from time import sleep


def test_beta0():
sleep(5)
assert True


def test_beta1():
sleep(5)
assert True


def test_beta2():
sleep(5)
assert True


def test_beta3():
sleep(5)
assert True


def test_beta4():
sleep(5)
assert True


def test_beta5():
sleep(5)
assert True


def test_beta6():
sleep(5)
assert True


def test_beta7():
sleep(5)
assert True


def test_beta8():
sleep(5)
assert True


def test_beta9():
sleep(5)
assert True
88 changes: 88 additions & 0 deletions example/loadscope/test/test_delta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
from time import sleep
from unittest import TestCase


class Delta1(TestCase):

def test_delta0(self):
sleep(5)
assert True

def test_delta1(self):
sleep(5)
assert True

def test_delta2(self):
sleep(5)
assert True

def test_delta3(self):
sleep(5)
assert True

def test_delta4(self):
sleep(5)
assert True

def test_delta5(self):
sleep(5)
assert True

def test_delta6(self):
sleep(5)
assert True

def test_delta7(self):
sleep(5)
assert True

def test_delta8(self):
sleep(5)
assert True

def test_delta9(self):
sleep(5)
assert True


class Delta2(TestCase):

def test_delta0(self):
sleep(5)
assert True

def test_delta1(self):
sleep(5)
assert True

def test_delta2(self):
sleep(5)
assert True

def test_delta3(self):
sleep(5)
assert True

def test_delta4(self):
sleep(5)
assert True

def test_delta5(self):
sleep(5)
assert True

def test_delta6(self):
sleep(5)
assert True

def test_delta7(self):
sleep(5)
assert True

def test_delta8(self):
sleep(5)
assert True

def test_delta9(self):
sleep(5)
assert True
51 changes: 51 additions & 0 deletions example/loadscope/test/test_gamma.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from time import sleep


def test_gamma0():
sleep(5)
assert True


def test_gamma1():
sleep(5)
assert True


def test_gamma2():
sleep(5)
assert True


def test_gamma3():
sleep(5)
assert True


def test_gamma4():
sleep(5)
assert True


def test_gamma5():
sleep(5)
assert True


def test_gamma6():
sleep(5)
assert True


def test_gamma7():
sleep(5)
assert True


def test_gamma8():
sleep(5)
assert True


def test_gamma9():
sleep(5)
assert True
17 changes: 17 additions & 0 deletions example/loadscope/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tox]
envlist = test
setupdir = {toxinidir}/../../

[testenv:test]
basepython = python3
passenv = http_proxy https_proxy
deps = -rrequirements.txt
changedir = {envtmpdir}
commands =
py.test -s -v \
--doctest-modules \
--junitxml=tests.xml \
--dist=loadscope \
--tx=8*popen \
{toxinidir}/test \
{toxinidir}/epsilon
14 changes: 11 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
from setuptools import setup
from sys import version_info

from setuptools import setup, find_packages

install_requires = ['execnet>=1.1', 'pytest>=3.0.0']

if version_info < (2, 7):
install_requires.append('ordereddict')


setup(
name="pytest-xdist",
Expand All @@ -11,7 +19,7 @@
author_email='[email protected],[email protected]',
url='https://github.com/pytest-dev/pytest-xdist',
platforms=['linux', 'osx', 'win32'],
packages=['xdist'],
packages=find_packages(exclude=['testing', 'example']),
entry_points={
'pytest11': [
'xdist = xdist.plugin',
Expand All @@ -20,7 +28,7 @@
],
},
zip_safe=False,
install_requires=['execnet>=1.1', 'pytest>=3.0.0'],
install_requires=install_requires,
setup_requires=['setuptools_scm'],
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand Down
Loading