Skip to content

Commit f842597

Browse files
committed
Reflect Andrei's comments
1 parent 770c444 commit f842597

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/cloudai/_core/base_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def get_job_output_path(self, test: Test) -> Path:
263263
if not self.output_path.exists():
264264
raise FileNotFoundError(f"Output directory {self.output_path} does not exist")
265265

266-
job_output_path = None # Initialize the variable
266+
job_output_path = Path() # avoid reportPossiblyUnboundVariable from pyright
267267

268268
try:
269269
assert test.section_name is not None, "test.section_name must not be None"

tests/test_slurm_report_generation_strategy.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import os
1817
from pathlib import Path
1918

2019
import pandas as pd
@@ -60,9 +59,8 @@ def setup_test_environment(tmp_path: Path):
6059
# Avg bus bandwidth : 111.111
6160
#
6261
"""
63-
stdout_path = os.path.join(test_dir, "stdout.txt")
64-
with open(stdout_path, "w") as f:
65-
f.write(stdout_content)
62+
stdout_path = test_dir / "stdout.txt"
63+
stdout_path.write_text(stdout_content)
6664

6765
return test_dir
6866

@@ -77,11 +75,11 @@ def test_nccl_report_generation(setup_test_environment):
7775
assert strategy.can_handle_directory(test_dir) is True
7876

7977
# Generate the report
80-
strategy.generate_report("nccl_test", Path(test_dir))
78+
strategy.generate_report("nccl_test", test_dir)
8179

8280
# Verify the CSV report
83-
csv_report_path = os.path.join(test_dir, "cloudai_nccl_test_csv_report.csv")
84-
assert os.path.isfile(csv_report_path), "CSV report was not generated."
81+
csv_report_path = test_dir / "cloudai_nccl_test_csv_report.csv"
82+
assert csv_report_path.is_file(), "CSV report was not generated."
8583

8684
# Read the CSV and validate the content
8785
df = pd.read_csv(csv_report_path)

0 commit comments

Comments
 (0)