File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from pathlib import Path
22
33import lief
4+ import pytest
45
56
67def _remove_eol (string : str ):
78 return string .replace ("\n " , "" ).replace ("\r " , "" )
89
910
11+ @pytest .mark .thread_unsafe
1012def test_filesink (tmp_path : Path ):
1113 lief .logging .log (lief .logging .LEVEL .ERROR , "hello from default sink" )
1214 out_log = tmp_path / "lief.log"
@@ -16,6 +18,7 @@ def test_filesink(tmp_path: Path):
1618 lief .logging .reset ()
1719
1820
21+ @pytest .mark .thread_unsafe
1922def test_stderr (capsys ):
2023 lief .logging .log (lief .logging .LEVEL .ERROR , "This is an error" )
2124 lief .logging .log (lief .logging .LEVEL .ERROR , "This is another error" )
@@ -24,6 +27,7 @@ def test_stderr(capsys):
2427 assert _remove_eol (captured .err ) == "This is an errorThis is another error"
2528
2629
30+ @pytest .mark .thread_unsafe
2731def test_context_manager (capsys ):
2832 lief .logging .reset ()
2933 lief .logging .set_level (lief .logging .LEVEL .ERROR )
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ pytest==9.0.3
22requests == 2.33.0
33progressbar2 == 4.5.0
44coverage == 7.13.5
5+ pytest-run-parallel == 0.8.2
You can’t perform that action at this time.
0 commit comments