diff options
Diffstat (limited to 'doc/en/example')
-rw-r--r-- | doc/en/example/assertion/failure_demo.py | 20 | ||||
-rw-r--r-- | doc/en/example/assertion/global_testmodule_config/conftest.py | 3 | ||||
-rw-r--r-- | doc/en/example/pythoncollection.py | 3 |
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 |