summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorSeth M Morton <seth.m.morton@gmail.com>2015-05-16 20:33:44 -0700
committerSeth M Morton <seth.m.morton@gmail.com>2015-05-16 23:35:57 -0700
commit5266d481ffb27be3e2ace3ac952b4fb458cdc0cc (patch)
treea2fd5d871425eb956a3d1b4af95ebdde96d932b3 /setup.py
parent51fda167094aef5663df5549301991848ed88259 (diff)
downloadnatsort-5266d481ffb27be3e2ace3ac952b4fb458cdc0cc.tar.gz
Now using the hypothesis library in tests.
The hypothesis library is awesome, and with it I found many holes in the natsort code that would have been difficult to find. This required rewriting most tests, and also creating two alternate number splitting functions for use in programmatically ensuring that numbers are split properly. Additionally, these tests found holes in the fastnumbers library, and fastnumbers was updated to account for these holes. natsort has been updated with new options and capabilities added to fastnumbers in this update. natsort now will only use the fastnumbers library if it is version 0.5.0 or greater. The new "num_only" option to fastnumbers check is used. The fake_fastnumbers code has been updated to better simulate the fastnumbers library. All number searching regular expressions have been updated to locate single unicode numeric characters like fastnumbers >= 0.5.0, and the fake_fastnumbers functions have been updated to support these characters. Many bugs have been fixed that were caught with hypothesis, including: - Using casefold() versus lower() on Python >= 3.3. - If an empty string was passed to UNGROUPLETTERS with LOCALE, an IndexError was raised; This has been fixed. - Extended the library of Unicode numerals that natsort is aware of. Because a programmatic search of these numbers would create costly imports, these values have been hard-coded in the unicode_numbers module. Previously not all numerals were known to natsort. - Fixed potential hard-to-find bug in the GROUPLETTERS option when letters that when case-folded contain two characters, not one, and the second character was dropped.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index a78bd14..89b4721 100644
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,10 @@ class PyTest(TestCommand):
import pytest
err1 = pytest.main(['--cov', 'natsort',
'--cov-report', 'term-missing',
- '--flakes', '--pep8'])
+ '--flakes',
+ '--pep8',
+ # '--failed',
+ ])
err2 = pytest.main(['--doctest-modules', 'natsort'])
err3 = pytest.main(['README.rst',
'docs/source/intro.rst',
@@ -59,6 +62,8 @@ REQUIRES = 'argparse' if sys.version[:3] in ('2.6', '3.0', '3.1') else ''
TESTS_REQUIRE = ['pytest', 'pytest-pep8', 'pytest-flakes', 'pytest-cov']
if sys.version[0] == 2 or (sys.version[3] == '3' and int(sys.version[2]) < 3):
TESTS_REQUIRE.append('mock')
+if sys.version[0] == 2 or (sys.version[3] == '3' and int(sys.version[2]) < 4):
+ TESTS_REQUIRE.append('pathlib')
# The setup parameters
setup(