Skip to content

Commit 271ac1f

Browse files
committed
pytest cmd and test update
1 parent e7d7108 commit 271ac1f

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ omit = [
144144
module-root = "./src/galileo"
145145
tests-root = "tests"
146146
test-framework = "pytest"
147-
pytest-cmd = "-n 0"
147+
pytest-cmd = "pytest -n 0"
148148
ignore-paths = []
149149
disable-telemetry = false
150150
formatter-cmds = ["ruff check --exit-zero --fix $file", "ruff format $file"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
from typing import Any
2+
3+
14
def gcd_recursive(a: int, b: int) -> int:
25
"""Calculate greatest common divisor using Euclidean algorithm with recursion."""
36
if b == 0:
47
return a
58
return gcd_recursive(b, a % b)
9+
10+
11+
def is_instance_of(obj: Any, class_obj: Any) -> bool:
12+
return type(obj) is type(class_obj())

tests/test_badcode.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from galileo.badcode import gcd_recursive, is_instance_of
2+
3+
4+
def test_append_lists() -> None:
5+
assert gcd_recursive(2, 4) == 2
6+
assert gcd_recursive(51, 85) == 17
7+
8+
9+
def test_is_instance_of() -> None:
10+
class A:
11+
pass
12+
13+
class B:
14+
pass
15+
16+
obj_a = A()
17+
assert is_instance_of(obj_a, A) is True
18+
assert is_instance_of(obj_a, B) is False

tests/test_gcd.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)