Change pytest-faulthandler for simplification

* The --no-faulthandler option is not necessary given that we can use
  `-p no:faulthandler`.

* The `--faulthandler-timeout` command-line option has become an ini
  option, for the reasons described in
  https://github.com/pytest-dev/pytest-faulthandler/issues/34 and
  users can still set it from the command-line.

Fix pytest-dev/pytest-faulthandler#34
This commit is contained in:
Bruno Oliveira
2019-06-22 19:22:43 -03:00
parent a37b902afe
commit 3ce31b6370
4 changed files with 66 additions and 47 deletions

View File

@@ -44,7 +44,7 @@ def test_disabled(testdir):
assert not faulthandler.is_enabled()
"""
)
result = testdir.runpytest_subprocess("--no-faulthandler")
result = testdir.runpytest_subprocess("-p", "no:faulthandler")
result.stdout.fnmatch_lines(["*1 passed*"])
assert result.ret == 0
@@ -61,9 +61,13 @@ def test_timeout(testdir, enabled):
time.sleep(2.0)
"""
)
args = ["--faulthandler-timeout=1"]
if not enabled:
args.append("--no-faulthandler")
testdir.makeini(
"""
[pytest]
faulthandler_timeout = 1
"""
)
args = ["-p", "no:faulthandler"] if not enabled else []
result = testdir.runpytest_subprocess(*args)
tb_output = "most recent call first"