File tree Expand file tree Collapse file tree 4 files changed +26
-7
lines changed Expand file tree Collapse file tree 4 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ omit = [
144
144
module-root = " ./src/galileo"
145
145
tests-root = " tests"
146
146
test-framework = " pytest"
147
- pytest-cmd = " -n 0"
147
+ pytest-cmd = " pytest -n 0"
148
148
ignore-paths = []
149
149
disable-telemetry = false
150
150
formatter-cmds = [" ruff check --exit-zero --fix $file" , " ruff format $file" ]
Original file line number Diff line number Diff line change
1
+ from typing import Any
2
+
3
+
1
4
def gcd_recursive (a : int , b : int ) -> int :
2
5
"""Calculate greatest common divisor using Euclidean algorithm with recursion."""
3
6
if b == 0 :
4
7
return a
5
8
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 ())
Original file line number Diff line number Diff line change
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
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments