Skip to content

Commit

Permalink
Merge pull request #749 from QuLogic/ies
Browse files Browse the repository at this point in the history
Fix invalid escape sequences
  • Loading branch information
pv committed Oct 1, 2018
2 parents 653733b + 362c1d2 commit e336c9e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion asv/extern/asizeof.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/546530>
# <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/544288>

'''
r'''
This module exposes 9 functions and 2 classes to obtain lengths and
sizes of Python objects (for Python 2.2 or later [#test]_).
Expand Down
2 changes: 1 addition & 1 deletion asv/extern/minify_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import re

def json_minify(string, strip_space=True):
tokenizer = re.compile('"|(/\*)|(\*/)|(//)|\n|\r')
tokenizer = re.compile(r'"|(/\*)|(\*/)|(//)|\n|\r')
in_string = False
in_multi = False
in_single = False
Expand Down
4 changes: 2 additions & 2 deletions asv/plugins/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def is_local_repo(cls, path):
@classmethod
def url_match(cls, url):
regexes = [
'^https?://.*?\.git$',
'^git@.*?\.git$']
r'^https?://.*?\.git$',
r'^git@.*?\.git$']

for regex in regexes:
if re.match(regex, url):
Expand Down
6 changes: 3 additions & 3 deletions asv/plugins/mercurial.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def is_local_repo(cls, path):
@classmethod
def url_match(cls, url):
regexes = [
'^hg\+https?://.*$',
'^https?://.*?\.hg$',
'^ssh://hg@.*$']
r'^hg\+https?://.*$',
r'^https?://.*?\.hg$',
r'^ssh://hg@.*$']

for regex in regexes:
if re.match(regex, url):
Expand Down
4 changes: 2 additions & 2 deletions test/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ def test_discover_benchmarks(benchmarks_fixture):

# benchmark param selection with regex
b = benchmarks.Benchmarks.discover(conf, repo, envs, [commit_hash],
regex='track_param_selection\(.*, 3\)')
regex=r'track_param_selection\(.*, 3\)')
assert list(b.keys()) == ['params_examples.track_param_selection']
assert b._benchmark_selection['params_examples.track_param_selection'] == [0, 2]
b = benchmarks.Benchmarks.discover(conf, repo, envs, [commit_hash],
regex='track_param_selection\(1, ')
regex=r'track_param_selection\(1, ')
assert list(b.keys()) == ['params_examples.track_param_selection']
assert b._benchmark_selection['params_examples.track_param_selection'] == [0, 1]
b = benchmarks.Benchmarks.discover(conf, repo, envs, [commit_hash],
Expand Down
4 changes: 2 additions & 2 deletions test/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def test_benchmark_param_selection(basic_conf):
tools.generate_test_repo(tmpdir, values=[(1, 2, 3)])
tools.run_asv_with_conf(conf, 'run', 'master^!',
'--quick', '--show-stderr',
'--bench', 'track_param_selection\(.*, 3\)',
'--bench', r'track_param_selection\(.*, 3\)',
_machine_file=machine_file)

def get_results():
Expand All @@ -389,7 +389,7 @@ def get_results():

assert get_results() == [4, 'n/a', 5, 'n/a']
tools.run_asv_with_conf(conf, 'run', '--show-stderr',
'--bench', 'track_param_selection\(1, ',
'--bench', r'track_param_selection\(1, ',
_machine_file=machine_file)
assert get_results() == [4, 6, 5, 'n/a']
tools.run_asv_with_conf(conf, 'run', '--show-stderr',
Expand Down

0 comments on commit e336c9e

Please sign in to comment.