OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
hps
/
faces
/
.venv
/
lib
/
python3.10
/
site-packages
/
numpy
/
distutils
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/26/2024 01:27:34 PM
rwxr-xr-x
📄
__init__.py
0 bytes
10/26/2024 01:27:34 PM
rw-r--r--
📁
__pycache__
-
10/26/2024 01:28:53 PM
rwxr-xr-x
📄
test_build_ext.py
2.7 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_ccompiler_opt.py
28.09 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_ccompiler_opt_conf.py
6.2 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_exec_command.py
7.22 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_fcompiler.py
1.25 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_fcompiler_gnu.py
2.09 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_fcompiler_intel.py
1.03 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_fcompiler_nagfor.py
1.08 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_from_template.py
1.08 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_log.py
868 bytes
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_mingw32ccompiler.py
1.57 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_misc_util.py
3.14 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_npy_pkg_config.py
2.5 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_shell_utils.py
2.06 KB
10/26/2024 01:27:34 PM
rw-r--r--
📄
test_system_info.py
10.75 KB
10/26/2024 01:27:34 PM
rw-r--r--
Editing: test_log.py
Close
import io import re from contextlib import redirect_stdout import pytest from numpy.distutils import log def setup_module(): f = io.StringIO() # changing verbosity also logs here, capture that with redirect_stdout(f): log.set_verbosity(2, force=True) # i.e. DEBUG def teardown_module(): log.set_verbosity(0, force=True) # the default r_ansi = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])") @pytest.mark.parametrize("func_name", ["error", "warn", "info", "debug"]) def test_log_prefix(func_name): func = getattr(log, func_name) msg = f"{func_name} message" f = io.StringIO() with redirect_stdout(f): func(msg) out = f.getvalue() assert out # sanity check clean_out = r_ansi.sub("", out) line = next(line for line in clean_out.splitlines()) assert line == f"{func_name.upper()}: {msg}"