summaryrefslogtreecommitdiff
path: root/doc/en/example
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2018-05-23 18:12:04 +0200
committerRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2018-05-23 18:12:04 +0200
commit3e08c4ee64dffa14450ca29b1ef8bc3f820a5b2b (patch)
tree1b06e17fd94de2d9912b60e25513ada3f44ce20b /doc/en/example
parent703e4b11ba76171eccd3f13e723c47b810ded7ef (diff)
downloadpytest-3e08c4ee64dffa14450ca29b1ef8bc3f820a5b2b.tar.gz
sort out flake8 issues and unicode name usage
Diffstat (limited to 'doc/en/example')
-rw-r--r--doc/en/example/assertion/failure_demo.py20
-rw-r--r--doc/en/example/assertion/global_testmodule_config/conftest.py3
-rw-r--r--doc/en/example/pythoncollection.py3
3 files changed, 14 insertions, 12 deletions
diff --git a/doc/en/example/assertion/failure_demo.py b/doc/en/example/assertion/failure_demo.py
index f311b4ad7..dc27f5dfb 100644
--- a/doc/en/example/assertion/failure_demo.py
+++ b/doc/en/example/assertion/failure_demo.py
@@ -153,7 +153,7 @@ def globf(x):
class TestRaises(object):
def test_raises(self):
- s = "qwe"
+ s = "qwe" # NOQA
raises(TypeError, "int(s)")
def test_raises_doesnt(self):
@@ -163,15 +163,15 @@ class TestRaises(object):
raise ValueError("demo error")
def test_tupleerror(self):
- a, b = [1]
+ a, b = [1] # NOQA
def test_reinterpret_fails_with_print_for_the_fun_of_it(self):
- l = [1, 2, 3]
- print("l is %r" % l)
- a, b = l.pop()
+ items = [1, 2, 3]
+ print("items is %r" % items)
+ a, b = items.pop()
def test_some_error(self):
- if namenotexi:
+ if namenotexi: # NOQA
pass
def func1(self):
@@ -205,12 +205,12 @@ class TestMoreErrors(object):
somefunc(f(), g())
def test_z1_unpack_error(self):
- l = []
- a, b = l
+ items = []
+ a, b = items
def test_z2_type_error(self):
- l = 3
- a, b = l
+ items = 3
+ a, b = items
def test_startswith(self):
s = "123"
diff --git a/doc/en/example/assertion/global_testmodule_config/conftest.py b/doc/en/example/assertion/global_testmodule_config/conftest.py
index e4a25a038..4859bea78 100644
--- a/doc/en/example/assertion/global_testmodule_config/conftest.py
+++ b/doc/en/example/assertion/global_testmodule_config/conftest.py
@@ -1,4 +1,5 @@
-import pytest, py
+import pytest
+import py
mydir = py.path.local(__file__).dirpath()
diff --git a/doc/en/example/pythoncollection.py b/doc/en/example/pythoncollection.py
index 7a9226bc6..3603361c3 100644
--- a/doc/en/example/pythoncollection.py
+++ b/doc/en/example/pythoncollection.py
@@ -1,6 +1,7 @@
-
# run this with $ pytest --collect-only test_collectonly.py
#
+
+
def test_function():
pass