Skip to content

Commit f3ceac2

Browse files
committed
Fix: import error on build run
1 parent 9be644a commit f3ceac2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/validate_solutions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
from types import ModuleType
77
from typing import Dict, List
88

9-
import github
109
import pytest
1110

11+
try:
12+
import github
13+
except ImportError:
14+
pass
15+
1216
PROJECT_EULER_DIR_PATH = pathlib.Path.cwd().joinpath("project_euler")
1317
PROJECT_EULER_ANSWERS_PATH = pathlib.Path.cwd().joinpath(
1418
"scripts", "project_euler_answers.json"
@@ -82,7 +86,7 @@ def collect_solution_file_paths() -> List[pathlib.Path]:
8286
collect_solution_file_paths(),
8387
ids=lambda path: f"{path.parent.name}/{path.name}",
8488
)
85-
def test_project_euler(solution_path: pathlib.Path):
89+
def test_project_euler(solution_path: pathlib.Path) -> None:
8690
"""Testing for all Project Euler solutions"""
8791
# problem_[extract this part] and pad it with zeroes for width 3
8892
problem_number: str = solution_path.parent.name[8:].zfill(3)

0 commit comments

Comments
 (0)