summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/tools/pytest/doc/en/example/assertion/test_failures.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/tools/pytest/doc/en/example/assertion/test_failures.py')
-rw-r--r--testing/web-platform/tests/tools/pytest/doc/en/example/assertion/test_failures.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/tools/pytest/doc/en/example/assertion/test_failures.py b/testing/web-platform/tests/tools/pytest/doc/en/example/assertion/test_failures.py
new file mode 100644
index 000000000..2e5cd20b1
--- /dev/null
+++ b/testing/web-platform/tests/tools/pytest/doc/en/example/assertion/test_failures.py
@@ -0,0 +1,14 @@
+
+import py
+failure_demo = py.path.local(__file__).dirpath('failure_demo.py')
+pytest_plugins = 'pytester',
+
+def test_failure_demo_fails_properly(testdir):
+ target = testdir.tmpdir.join(failure_demo.basename)
+ failure_demo.copy(target)
+ failure_demo.copy(testdir.tmpdir.join(failure_demo.basename))
+ result = testdir.runpytest(target, syspathinsert=True)
+ result.stdout.fnmatch_lines([
+ "*42 failed*"
+ ])
+ assert result.ret != 0