MCPcopy Index your code
hub / github.com/RustPython/RustPython / tearDown

Method tearDown

Lib/test/test_httpservers.py:1032–1064  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1030 os.chdir(self.parent_dir)
1031
1032 def tearDown(self):
1033 self.request_handler._test_case_self = None
1034 try:
1035 os.chdir(self.cwd)
1036 if self._pythonexe_symlink:
1037 self._pythonexe_symlink.__exit__(None, None, None)
1038 if self.nocgi_path:
1039 os.remove(self.nocgi_path)
1040 if self.file1_path:
1041 os.remove(self.file1_path)
1042 if self.file2_path:
1043 os.remove(self.file2_path)
1044 if self.file3_path:
1045 os.remove(self.file3_path)
1046 if self.file4_path:
1047 os.remove(self.file4_path)
1048 if self.file5_path:
1049 os.remove(self.file5_path)
1050 if self.file6_path:
1051 os.remove(self.file6_path)
1052 if self.file7_path:
1053 os.remove(self.file7_path)
1054 os.rmdir(self.cgi_child_dir)
1055 os.rmdir(self.cgi_dir)
1056 os.rmdir(self.cgi_dir_in_sub_dir)
1057 os.rmdir(self.sub_dir_2)
1058 os.rmdir(self.sub_dir_1)
1059 # The 'gmon.out' file can be written in the current working
1060 # directory if C-level code profiling with gprof is enabled.
1061 os_helper.unlink(os.path.join(self.parent_dir, 'gmon.out'))
1062 os.rmdir(self.parent_dir)
1063 finally:
1064 BaseTestCase.tearDown(self)
1065
1066 def test_url_collapse_path(self):
1067 # verify tail is the last portion and head is the rest on proper urls

Callers 1

setUpMethod · 0.95

Calls 6

rmdirMethod · 0.80
__exit__Method · 0.45
removeMethod · 0.45
unlinkMethod · 0.45
joinMethod · 0.45
tearDownMethod · 0.45

Tested by

no test coverage detected