Skip to content

Commit 0171cfa

Browse files
committed
Fixing link to issue and creating testcase that shows that it finds the line in the stderr lines
1 parent 61e605f commit 0171cfa

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
level an error will be raised during collection.
1515
Thanks `@omarkohl`_ for the complete PR (`#1519`_).
1616

17-
* Fix (`1516`_): ConftestImportFailure now shows the traceback
17+
* Fix (`#1516`_): ConftestImportFailure now shows the traceback
1818

1919
**Incompatible changes**
2020

@@ -30,6 +30,7 @@
3030
* removed support code for python 3 < 3.3 addressing (`#1627`_)
3131

3232
.. _#607: https://github.com/pytest-dev/pytest/issues/607
33+
.. _#1516: https://github.com/pytest-dev/pytest/issues/1516
3334
.. _#1519: https://github.com/pytest-dev/pytest/pull/1519
3435
.. _#1664: https://github.com/pytest-dev/pytest/pull/1664
3536
.. _#1627: https://github.com/pytest-dev/pytest/pull/1627

testing/test_conftest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,3 +407,16 @@ def test_some():
407407
""")
408408
res = testdir.runpytest()
409409
assert res.ret == 0
410+
411+
412+
def test_conftest_exception_handling(testdir):
413+
testdir.makeconftest('''
414+
raise ValueError()
415+
''')
416+
testdir.makepyfile("""
417+
def test_some():
418+
pass
419+
""")
420+
res = testdir.runpytest()
421+
assert res.ret == 4
422+
assert 'raise ValueError()' in [line.strip() for line in res.errlines]

0 commit comments

Comments
 (0)