diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2019-08-29 11:31:57 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2019-08-29 11:38:14 +0200 |
commit | e1ea37642d0fd9bffb865da4122706e7349afec1 (patch) | |
tree | 4a18c2f26f95333dc9e6c7016e2eb44b174599b5 /tests/test_parsing.py | |
parent | 1655f9cdd72dd3e6dcaf071e84aa5e897e06d39d (diff) | |
download | semantic-version-rbarrois/restore-py2.tar.gz |
Restore Python2 support.rbarrois/restore-py2
Diffstat (limited to 'tests/test_parsing.py')
-rwxr-xr-x | tests/test_parsing.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_parsing.py b/tests/test_parsing.py index 0da679f..01b7b5e 100755 --- a/tests/test_parsing.py +++ b/tests/test_parsing.py @@ -5,11 +5,18 @@ import itertools import unittest +import sys import semantic_version class ParsingTestCase(unittest.TestCase): + if sys.version_info[0] <= 2: + import contextlib + @contextlib.contextmanager + def subTest(self, **kwargs): + yield + invalids = [ None, '', @@ -66,6 +73,12 @@ class ParsingTestCase(unittest.TestCase): class ComparisonTestCase(unittest.TestCase): + if sys.version_info[0] <= 2: + import contextlib + @contextlib.contextmanager + def subTest(self, **kwargs): + yield + order = [ '1.0.0-alpha', '1.0.0-alpha.1', |