Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some invalid escape sequences. #749

Merged
merged 1 commit into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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