Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move test set code to separate package

  • Loading branch information...
commit b786a2d4c6367b8c1f9a479ef1e981c52b79a744 1 parent 81234c3
@mwilliamson authored
View
1  test-requirements.txt
@@ -1 +1,2 @@
nose>=1.2.1,<2
+nose-test-sets>=0.2.0,<0.3
View
2  tests/open_test_set.py
@@ -2,7 +2,7 @@
from nose.tools import assert_equal
-from test_sets import TestSetBuilder
+from nose_test_sets import TestSetBuilder
__all__ = ["create"]
View
2  tests/process_test_set.py
@@ -5,7 +5,7 @@
from nose.tools import assert_equal, assert_not_equal, assert_raises, assert_true
import spur
-from test_sets import TestSetBuilder
+from nose_test_sets import TestSetBuilder
__all__ = ["create"]
View
31 tests/test_sets.py
@@ -1,31 +0,0 @@
-import functools
-
-from nose.tools import istest, nottest
-
-
-class TestSetBuilder(object):
- def __init__(self):
- self._test_funcs = []
-
- @nottest
- def add_test(self, func):
- self._test_funcs.append(func)
-
- def create(self, name, run_test):
- @istest
- class Tests(object):
- pass
-
- for test_func in self._test_funcs:
- self._add_test_func(Tests, test_func, run_test)
-
- Tests.__name__ = name
- return Tests
-
- def _add_test_func(self, cls, test_func, run_test):
- @functools.wraps(test_func)
- @istest
- def test_method(self):
- return run_test(test_func)
-
- setattr(cls, test_func.__name__, test_method)

0 comments on commit b786a2d

Please sign in to comment.
Something went wrong with that request. Please try again.