Skip to content

Commit

Permalink
[tests] Now depends on case
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Apr 5, 2016
1 parent c71b57b commit 0c34efb
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 266 deletions.
4 changes: 0 additions & 4 deletions billiard/five.py
Expand Up @@ -104,8 +104,6 @@ def _monotonic(): # noqa
range = range
int_types = (int, )

open_fqdn = 'builtins.open'

def items(d):
return d.items()

Expand Down Expand Up @@ -144,8 +142,6 @@ def write(self, data):
range = xrange
int_types = (int, long)

open_fqdn = '__builtin__.open'

def items(d): # noqa
return d.iteritems()

Expand Down
6 changes: 6 additions & 0 deletions billiard/tests/case.py
@@ -0,0 +1,6 @@
from __future__ import absolute_import, unicode_literals

import case
import sys

sys.modules[__name__] = case
85 changes: 0 additions & 85 deletions billiard/tests/compat.py

This file was deleted.

10 changes: 2 additions & 8 deletions billiard/tests/test_common.py
Expand Up @@ -2,20 +2,17 @@

import os
import signal
import sys

from contextlib import contextmanager
from mock import call, patch, Mock
from time import time

from nose import SkipTest
from billiard.common import (
_shutdown_cleanup,
reset_signals,
restart_state,
)

from .utils import Case
from .case import Case, Mock, call, patch, skip


def signo(name):
Expand All @@ -33,12 +30,9 @@ def termsigs(default, full):
common.TERMSIGS_DEFAULT, common.TERMSIGS_FULL = prev_def, prev_full


@skip.if_win32()
class test_reset_signals(Case):

def setUp(self):
if sys.platform == 'win32':
raise SkipTest('win32: skip')

def test_shutdown_handler(self):
with patch('sys.exit') as exit:
_shutdown_cleanup(15, Mock())
Expand Down
2 changes: 1 addition & 1 deletion billiard/tests/test_package.py
Expand Up @@ -2,7 +2,7 @@

import billiard

from .utils import Case
from .case import Case


class test_billiard(Case):
Expand Down
11 changes: 2 additions & 9 deletions billiard/tests/test_win32.py
@@ -1,12 +1,8 @@
from __future__ import absolute_import

import sys

from nose import SkipTest

from billiard.compat import _winapi

from .utils import Case
from .case import Case, skip

WIN32_CONSTANTS = {
'ERROR_ALREADY_EXISTS',
Expand Down Expand Up @@ -62,12 +58,9 @@
}


@skip.unless_win32()
class test_win32_module(Case):

def setUp(self):
if sys.platform != 'win32':
raise SkipTest('win32 only tests')

def test_constants(self):
for const in WIN32_CONSTANTS:
self.assertIsNotNone(getattr(_winapi, const))
Expand Down
145 changes: 0 additions & 145 deletions billiard/tests/utils.py

This file was deleted.

4 changes: 1 addition & 3 deletions requirements/test.txt
@@ -1,3 +1 @@
unittest2>=0.4.0
nose>=1.3.4
mock
case
2 changes: 0 additions & 2 deletions requirements/test3.txt

This file was deleted.

7 changes: 1 addition & 6 deletions setup.py
Expand Up @@ -184,11 +184,6 @@ def reqs(f):
return list(filter(None, [strip_comments(l) for l in open(
os.path.join(os.getcwd(), 'requirements', f)).readlines()]))

if py_version[0] == 3:
tests_require = reqs('test3.txt')
else:
tests_require = reqs('test.txt')


def _is_build_command(argv=sys.argv, cmds=('install', 'build', 'bdist')):
for arg in argv:
Expand Down Expand Up @@ -237,7 +232,7 @@ def run_setup(with_extensions=True):
url=meta['homepage'],
zip_safe=False,
license='BSD',
tests_require=tests_require,
tests_require=reqs('test.txt'),
test_suite='nose.collector',
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = 2.7, 3.3, 3.4, 3.5, pypy, pypy3
envlist = 2.7, 3.4, 3.5, pypy, pypy3

[testenv]
distribute = True
Expand All @@ -8,9 +8,8 @@ commands = nosetests --with-xunit \
--xunit-file={toxinidir}/nosetests.xml
deps=
-r{toxinidir}/requirements/test-ci.txt
-r{toxinidir}/requirements/test.txt

2.7,pypy: -r{toxinidir}/requirements/test.txt
3.3,3.4,3.5,pypy3: -r{toxinidir}/requirements/test3.txt
basepython =
2.7: python2.7
3.3: python3.3
Expand Down

0 comments on commit 0c34efb

Please sign in to comment.