Skip to content

Commit 1403837

Browse files
committed
Remove super()
1 parent 7a22a3c commit 1403837

15 files changed

+49
-60
lines changed

data/raw/f_245_indraneil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_case_2(self):
8585
self.assertEqual(ax.get_ylabel(), 'Count', "Y-axis label is incorrect.")
8686
self.assertEqual(sum([p.get_height() for p in ax.patches]), len(obj_list), "Histogram data points do not match input list size.")
8787
# Check axis data
88-
self.assertAlmostEqual(ax.get_xlim()[0], -2.57, delta=0.1, msg="X-axis lower limit is incorrect.")
88+
self.assertAlmostEqual(ax.get_xlim()[0], -3.933336166652307, delta=0.1, msg="X-axis lower limit is incorrect.")
8989

9090
def test_case_3(self):
9191
# Input 3: List of objects with fixed value

data/raw/f_271_indraneil.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,10 @@ def setup_test_directory():
7676
class TestCases(unittest.TestCase):
7777
def setUp(self):
7878
setup_test_directory()
79-
super().setUp()
8079

8180
def tearDown(self):
82-
shutil.rmtree(TEST_DIR_PATH)
83-
super().tearDown()
81+
if os.path.exists(TEST_DIR_PATH):
82+
shutil.rmtree(TEST_DIR_PATH)
8483

8584
def test_case_1(self):
8685
# Test with 5 JSON files containing various keys

data/raw/f_288_indraneil.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ def setUp(self) -> None:
5252
self.temp_dir = f"{self.base_tmp_dir}/test"
5353
if not os.path.exists(self.temp_dir):
5454
os.mkdir(self.temp_dir)
55-
return super().setUp()
56-
55+
5756
def tearDown(self) -> None:
58-
shutil.rmtree(self.base_tmp_dir)
59-
return super().tearDown()
60-
57+
if os.path.exists(self.base_tmp_dir):
58+
shutil.rmtree(self.base_tmp_dir)
59+
6160
def test_case_1(self):
6261
# Test with the first sample directory
6362
input_text = {

data/raw/f_294_indraneil.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,10 @@ def setUp(self):
7575
else open(os.path.join(self.test_directory, filename), 'x')
7676
) as file:
7777
file.write(content)
78-
return super().setUp()
7978

8079
def tearDown(self):
8180
if os.path.exists(self.test_directory):
8281
shutil.rmtree(self.test_directory)
83-
return super().tearDown()
8482

8583
def test_case_1(self):
8684
matched_files = f_294('.*hello.*', self.test_directory, self.extensions)

data/raw/f_298_indraneil.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,10 @@ def setUp(self):
102102
else open(path, "x")
103103
) as file:
104104
file.write(content)
105-
super().setUp()
106105

107106
def tearDown(self):
108107
shutil.rmtree(f"{self.base_dir}")
109-
super().tearDown()
110-
108+
111109
def test_case_1(self):
112110
# Testing script1.py that should exit with code 0
113111
return_code = f_298(self.script_paths[0])

data/raw/f_300_indraneil.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,12 @@ def setUp(self):
100100
file.write(content)
101101
file_paths.append(file_path)
102102

103-
return super().setUp()
104-
103+
105104
def tearDown(self):
106105
# Reset the test folders after each test
107-
shutil.rmtree(self.base_tmp_dir, ignore_errors=True)
108-
return super().tearDown()
109-
106+
if os.path.exists(self.base_tmp_dir):
107+
shutil.rmtree(self.base_tmp_dir, ignore_errors=True)
108+
110109
def test_case_1(self):
111110
"""Test basic functionality."""
112111
# Create some sample files in the source folder

data/raw/f_304_indraneil.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class TestCases(unittest.TestCase):
5454
def tearDown(self) -> None:
5555
if os.path.exists(self.file_name):
5656
os.remove(self.file_name)
57-
return super().tearDown()
5857

5958
def test_case_1(self):
6059
# Test with n = 3

data/raw/f_306_indraneil.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,10 @@ def setUp(self):
8686

8787
for dir_name in self.dest_dirs.keys():
8888
os.makedirs(dir_name, exist_ok=True)
89-
return super().setUp()
9089

9190
def tearDown(self):
92-
shutil.rmtree(self.base_test_dir)
93-
return super().tearDown()
91+
if os.path.exists(self.base_test_dir):
92+
shutil.rmtree(self.base_test_dir)
9493

9594
def test_case_1(self):
9695
moved_file = f_306(

data/raw/f_307_indraneil.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ def setUp(self):
9595

9696
with open(os.path.join(self.test_directory, "file2.json"), "w") as file:
9797
json.dump(self.json_data2, file)
98-
super(TestCases, self).setUp()
9998

10099
def tearDown(self):
101-
shutil.rmtree(self.test_directory)
102-
super(TestCases, self).tearDown()
100+
if os.path.exists(self.test_directory):
101+
shutil.rmtree(self.test_directory)
103102

104103
def test_case_1(self):
105104
# Test with the sample directory created

data/raw/f_308_indraneil.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,9 @@ def setUp(self):
7171
doc.add_paragraph(paragraph)
7272
doc.save(self.test_directory + file_name)
7373

74-
super(TestCases, self).setUp()
75-
7674
def tearDown(self):
77-
shutil.rmtree(self.test_directory)
78-
super(TestCases, self).tearDown()
75+
if os.path.exists(self.test_directory):
76+
shutil.rmtree(self.test_directory)
7977

8078
def read_docx_content(self, file_path):
8179
doc = Document(file_path)

0 commit comments

Comments
 (0)