6 from conftest
import fspath
9 def test_no_dump_files(check_for_crashes
):
10 """Test that check_for_crashes returns 0 if no dumps are present."""
11 assert 0 == check_for_crashes()
14 @pytest.mark
.parametrize("minidump_files", [3], indirect
=True)
15 def test_dump_count(check_for_crashes
, minidump_files
):
16 """Test that check_for_crashes returns the number of crash dumps."""
17 assert 3 == check_for_crashes()
20 def test_dump_directory_unicode(request
, check_for_crashes
, tmpdir
, capsys
):
21 """Test that check_for_crashes can handle unicode in dump_directory."""
22 from conftest
import minidump_files
24 tmpdir
= tmpdir
.ensure(u
"🍪", dir=1)
25 minidump_files
= minidump_files(request
, tmpdir
)
27 assert 1 == check_for_crashes(dump_directory
=fspath(tmpdir
), quiet
=False)
29 out
, _
= capsys
.readouterr()
30 assert fspath(minidump_files
[0]["dmp"]) in out
34 def test_test_name_unicode(check_for_crashes
, minidump_files
, capsys
):
35 """Test that check_for_crashes can handle unicode in dump_directory."""
36 assert 1 == check_for_crashes(test_name
=u
"🍪", quiet
=False)
38 out
, err
= capsys
.readouterr()
42 if __name__
== "__main__":