diff options
Diffstat (limited to 'pkg_resources/tests/test_working_set.py')
-rw-r--r-- | pkg_resources/tests/test_working_set.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg_resources/tests/test_working_set.py b/pkg_resources/tests/test_working_set.py index 42ddcc8..db13c71 100644 --- a/pkg_resources/tests/test_working_set.py +++ b/pkg_resources/tests/test_working_set.py @@ -12,8 +12,8 @@ from .test_resources import Metadata def strip_comments(s): return '\n'.join( - l for l in s.split('\n') - if l.strip() and not l.strip().startswith('#') + line for line in s.split('\n') + if line.strip() and not line.strip().startswith('#') ) @@ -37,7 +37,7 @@ def parse_distributions(s): requires=['foo>=3.0', 'baz; extra=="feature"'] ''' s = s.strip() - for spec in re.split('\n(?=[^\s])', s): + for spec in re.split(r'\n(?=[^\s])', s): if not spec: continue fields = spec.split('\n', 1) @@ -54,7 +54,7 @@ def parse_distributions(s): yield dist -class FakeInstaller(object): +class FakeInstaller: def __init__(self, installable_dists): self._installable_dists = installable_dists @@ -87,7 +87,7 @@ def parametrize_test_working_set_resolve(*test_list): ): idlist.append(id_) expected = strip_comments(expected.strip()) - if re.match('\w+$', expected): + if re.match(r'\w+$', expected): expected = getattr(pkg_resources, expected) assert issubclass(expected, Exception) else: |