Skip to content

Commit 5ed023f

Browse files
committed
Fix flake8 warnings
1 parent 95ddb11 commit 5ed023f

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

asserts/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def assert_regex(text, regex, msg_fmt="{msg}"):
533533
expression object.
534534
535535
>>> assert_regex("Hello World!", r"llo.*rld!$")
536-
>>> assert_regex("Hello World!", r"\d")
536+
>>> assert_regex("Hello World!", r"\\d")
537537
Traceback (most recent call last):
538538
...
539539
AssertionError: 'Hello World!' does not match '\\\\d'
@@ -986,10 +986,10 @@ def assert_raises_regex(exception, regex, msg_fmt="{msg}"):
986986
987987
The regular expression can be a regular expression string or object.
988988
989-
>>> with assert_raises_regex(ValueError, r"\d+"):
989+
>>> with assert_raises_regex(ValueError, r"\\d+"):
990990
... raise ValueError("Error #42")
991991
...
992-
>>> with assert_raises_regex(ValueError, r"\d+"):
992+
>>> with assert_raises_regex(ValueError, r"\\d+"):
993993
... raise ValueError("Generic Error")
994994
...
995995
Traceback (most recent call last):
@@ -1252,7 +1252,7 @@ def assert_warns_regex(warning_type, regex, msg_fmt="{msg}"):
12521252
The message can be a regular expression string or object.
12531253
12541254
>>> from warnings import warn
1255-
>>> with assert_warns_regex(UserWarning, r"#\d+"):
1255+
>>> with assert_warns_regex(UserWarning, r"#\\d+"):
12561256
... warn("Error #42", UserWarning)
12571257
...
12581258
>>> with assert_warns_regex(UserWarning, r"Expected Error"):
@@ -1280,7 +1280,7 @@ def test(warning):
12801280
if sys.version_info >= (3,):
12811281
_Str = str
12821282
else:
1283-
_Str = unicode
1283+
_Str = unicode # noqa: F821
12841284

12851285

12861286
def assert_json_subset(first, second):

requirements.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
entrypoints==0.3
2+
flake8==3.7.7
3+
mccabe==0.6.1
14
mypy==0.670
5+
pycodestyle==2.5.0
6+
pyflakes==2.1.1
27
typed-ast==1.3.1
3-
wheel==0.33.1
8+
wheel==0.33.1

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
universal=1
33
[metadata]
44
license_file=LICENSE
5+
[flake8]
6+
# E501: line too long (required in docstrings)
7+
# W503: line break before binary operator
8+
ignore = E501,W503

0 commit comments

Comments
 (0)