Skip to content

Commit c906ba8

Browse files
allarobotcclauss
andauthored
refactor: move import pytest line of blockchain algs under "main" section. (#2012)
* change doctest line import doctest is not relevant with algorithms. move it under main section. * from doctest import testmod * refactor: move doctest under "main" section * Update diophantine_equation.py * Update modular_division.py Co-authored-by: Christian Clauss <[email protected]>
1 parent 1c62bd1 commit c906ba8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

blockchain/diophantine_equation.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,9 @@ def extended_gcd(a, b):
118118
return (d, x, y)
119119

120120

121-
# import testmod for testing our function
122-
from doctest import testmod
123-
124121
if __name__ == "__main__":
122+
from doctest import testmod
123+
125124
testmod(name="diophantine", verbose=True)
126125
testmod(name="diophantine_all_soln", verbose=True)
127126
testmod(name="extended_gcd", verbose=True)

blockchain/modular_division.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@ def greatest_common_divisor(a, b):
139139
return b
140140

141141

142-
# Import testmod for testing our function
143-
from doctest import testmod
144-
145142
if __name__ == "__main__":
143+
from doctest import testmod
144+
146145
testmod(name="modular_division", verbose=True)
147146
testmod(name="modular_division2", verbose=True)
148147
testmod(name="invert_modulo", verbose=True)

0 commit comments

Comments
 (0)