Changed pydoc's output to not show an absolute path.
- The absolute path was causing tools_test.py to fail within test_distributions.py.
This commit is contained in:
parent
111d362942
commit
09cc7d3272
4 changed files with 26 additions and 29 deletions
|
|
@ -1,12 +1,12 @@
|
||||||
Help on module hi3:
|
Help on module hi3:
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
hi3
|
hi3
|
||||||
|
|
||||||
FUNCTIONS
|
FUNCTIONS
|
||||||
hi()
|
hi()
|
||||||
|
|
||||||
FILE
|
FILE
|
||||||
/CWD/input/hi3.py
|
input/hi3.py
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
Help on module hi:
|
Help on module hi:
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
hi
|
hi
|
||||||
|
|
||||||
FILE
|
FILE
|
||||||
/CWD/input/hi.py
|
input/hi.py
|
||||||
|
|
||||||
FUNCTIONS
|
FUNCTIONS
|
||||||
hi()
|
hi()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -62,11 +62,7 @@ class ToolsTestCase(unittest.TestCase):
|
||||||
with self.subTest(input_filename=input_filename):
|
with self.subTest(input_filename=input_filename):
|
||||||
status, result = run_tool(tool, input_filename)
|
status, result = run_tool(tool, input_filename)
|
||||||
golden_path = result_path(tool, input_filename)
|
golden_path = result_path(tool, input_filename)
|
||||||
text = widget_to_string(result)
|
golden.assertGolden(widget_to_string(result), golden_path)
|
||||||
with chdir(os.path.join(VIGIL_ROOT, "golden-files")):
|
|
||||||
cwd = os.getcwd()
|
|
||||||
text = text.replace(cwd, "/CWD")
|
|
||||||
golden.assertGolden(text, golden_path)
|
|
||||||
self.assertEqual(status, expected_status)
|
self.assertEqual(status, expected_status)
|
||||||
|
|
||||||
def test_metadata(self):
|
def test_metadata(self):
|
||||||
|
|
|
||||||
|
|
@ -346,6 +346,7 @@ def pydoc(path):
|
||||||
status = Status.normal if returncode == 0 else Status.not_applicable
|
status = Status.normal if returncode == 0 else Status.not_applicable
|
||||||
if not stdout.startswith("Help on module"):
|
if not stdout.startswith("Help on module"):
|
||||||
status = Status.not_applicable
|
status = Status.not_applicable
|
||||||
|
stdout = stdout.replace(os.getcwd() + "/", "")
|
||||||
return status, fill3.Text(_fix_input(stdout))
|
return status, fill3.Text(_fix_input(stdout))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue