summaryrefslogtreecommitdiff
path: root/_pytest/assertion
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2016-11-20 18:59:15 -0200
committerBruno Oliveira <nicoddemus@gmail.com>2016-11-20 18:59:15 -0200
commit1eb5a690d4c416962b6ccf46618367f68e54ea89 (patch)
tree6d9b8c722c6d78747f5c617fcfd1145c61065558 /_pytest/assertion
parentcbf261c74ef1713f88ac56f2c382f096b252dedb (diff)
downloadpytest-1eb5a690d4c416962b6ccf46618367f68e54ea89.tar.gz
Fix flake8 E305 and E306 errors
These errors started to appear with flake8-3.1.1, while they don't appear with version 3.1.0 (weird).
Diffstat (limited to '_pytest/assertion')
-rw-r--r--_pytest/assertion/__init__.py2
-rw-r--r--_pytest/assertion/rewrite.py1
2 files changed, 3 insertions, 0 deletions
diff --git a/_pytest/assertion/__init__.py b/_pytest/assertion/__init__.py
index fd1ebe2c1..18cb7d32c 100644
--- a/_pytest/assertion/__init__.py
+++ b/_pytest/assertion/__init__.py
@@ -80,10 +80,12 @@ def install_importhook(config):
config._assertstate.hook = hook = rewrite.AssertionRewritingHook(config)
sys.meta_path.insert(0, hook)
config._assertstate.trace('installed rewrite import hook')
+
def undo():
hook = config._assertstate.hook
if hook is not None and hook in sys.meta_path:
sys.meta_path.remove(hook)
+
config.add_cleanup(undo)
return hook
diff --git a/_pytest/assertion/rewrite.py b/_pytest/assertion/rewrite.py
index 6b4c1f483..c2098936d 100644
--- a/_pytest/assertion/rewrite.py
+++ b/_pytest/assertion/rewrite.py
@@ -276,6 +276,7 @@ def _write_pyc(state, co, source_stat, pyc):
fp.close()
return True
+
RN = "\r\n".encode("utf-8")
N = "\n".encode("utf-8")