1"""
2Determine when dev tests should be skipped by regular users.
3
4Some tests are only intended to be tested during development right
5before performing a release.  These do not test core functionality
6of `cytoolz` and may be skipped.  These tests are only run if the
7following conditions are true:
8
9    - toolz is installed
10    - toolz is the correct version
11    - cytoolz is a release version
12"""
13import cytoolz
14try:
15    from nose.tools import nottest, istest
16except ImportError:
17    istest = lambda func: setattr(func, '__test__', True) or func
18    nottest = lambda func: setattr(func, '__test__', False) or func
19
20try:
21    import toolz
22    do_toolz_tests = True
23except ImportError:
24    do_toolz_tests = False
25
26if do_toolz_tests:
27    do_toolz_tests = toolz.__version__.startswith(cytoolz.__toolz_version__)
28    do_toolz_tests &= 'dev' not in cytoolz.__version__
29
30# Decorator used to skip tests for developmental versions of CyToolz
31if do_toolz_tests:
32    dev_skip_test = istest
33else:
34    dev_skip_test = nottest
35