003 File Manager
Current Path:
/usr/local/lib/python3.8/test/test_tools
usr
/
local
/
lib
/
python3.8
/
test
/
test_tools
/
📁
..
📄
__init__.py
(825 B)
📄
__main__.py
(72 B)
📁
__pycache__
📄
test_fixcid.py
(2.89 KB)
📄
test_gprof2html.py
(919 B)
📄
test_i18n.py
(8.83 KB)
📄
test_lll.py
(1.15 KB)
📄
test_md5sum.py
(2.56 KB)
📄
test_pathfix.py
(4.21 KB)
📄
test_pdeps.py
(824 B)
📄
test_pindent.py
(8.42 KB)
📄
test_reindent.py
(1006 B)
📄
test_sundry.py
(1.85 KB)
📄
test_unparse.py
(8.83 KB)
Editing: test_gprof2html.py
"""Tests for the gprof2html script in the Tools directory.""" import os import sys import unittest from unittest import mock import tempfile from test.test_tools import skip_if_missing, import_tool skip_if_missing() class Gprof2htmlTests(unittest.TestCase): def setUp(self): self.gprof = import_tool('gprof2html') oldargv = sys.argv def fixup(): sys.argv = oldargv self.addCleanup(fixup) sys.argv = [] def test_gprof(self): # Issue #14508: this used to fail with a NameError. with mock.patch.object(self.gprof, 'webbrowser') as wmock, \ tempfile.TemporaryDirectory() as tmpdir: fn = os.path.join(tmpdir, 'abc') open(fn, 'w').close() sys.argv = ['gprof2html', fn] self.gprof.main() self.assertTrue(wmock.open.called) if __name__ == '__main__': unittest.main()
Upload File
Create Folder