diff options
author | Andras Tim <andras.tim@gmail.com> | 2017-07-17 01:25:09 +0200 |
---|---|---|
committer | Andras Tim <andras.tim@gmail.com> | 2017-07-17 01:44:23 +0200 |
commit | b840622819ee9867e92b094a07b371be68a1a43b (patch) | |
tree | 3d94226e509c2b642e610800b8dbd287a2c9315d /_pytest/assertion | |
parent | 17a21d540bb7d5e8fc2da115b29e6f5c0c966b43 (diff) | |
download | pytest-b840622819ee9867e92b094a07b371be68a1a43b.tar.gz |
Fixed E302 flake8 errors
expected 2 blank lines, found 0
Diffstat (limited to '_pytest/assertion')
-rw-r--r-- | _pytest/assertion/rewrite.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/_pytest/assertion/rewrite.py b/_pytest/assertion/rewrite.py index bce04398b..48f5d4388 100644 --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -283,6 +283,7 @@ N = "\n".encode("utf-8") cookie_re = re.compile(r"^[ \t\f]*#.*coding[:=][ \t]*[-\w.]+") BOM_UTF8 = '\xef\xbb\xbf' + def _rewrite_test(config, fn): """Try to read and rewrite *fn* and return the code object.""" state = config._assertstate @@ -340,6 +341,7 @@ def _rewrite_test(config, fn): return None, None return stat, co + def _make_rewritten_pyc(state, source_stat, pyc, co): """Try to dump rewritten code to *pyc*.""" if sys.platform.startswith("win"): @@ -353,6 +355,7 @@ def _make_rewritten_pyc(state, source_stat, pyc, co): if _write_pyc(state, co, source_stat, proc_pyc): os.rename(proc_pyc, pyc) + def _read_pyc(source, pyc, trace=lambda x: None): """Possibly read a pytest pyc containing rewritten code. @@ -412,6 +415,7 @@ def _saferepr(obj): from _pytest.assertion.util import format_explanation as _format_explanation # noqa + def _format_assertmsg(obj): """Format the custom assertion message given. @@ -439,9 +443,11 @@ def _format_assertmsg(obj): s = s.replace(t("\\n"), t("\n~")) return s + def _should_repr_global_name(obj): return not hasattr(obj, "__name__") and not py.builtin.callable(obj) + def _format_boolop(explanations, is_or): explanation = "(" + (is_or and " or " or " and ").join(explanations) + ")" if py.builtin._istext(explanation): @@ -450,6 +456,7 @@ def _format_boolop(explanations, is_or): t = py.builtin.bytes return explanation.replace(t('%'), t('%%')) + def _call_reprcompare(ops, results, expls, each_obj): for i, res, expl in zip(range(len(ops)), results, expls): try: |