Skip to content

Commit

Permalink
refactor: move import pytest line of blockchain algs under "main" sec…
Browse files Browse the repository at this point in the history
…tion. (TheAlgorithms#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]>
  • Loading branch information
allarobot and cclauss authored May 19, 2020
1 parent 1c62bd1 commit c906ba8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions blockchain/diophantine_equation.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@ def extended_gcd(a, b):
return (d, x, y)


# import testmod for testing our function
from doctest import testmod

if __name__ == "__main__":
from doctest import testmod

testmod(name="diophantine", verbose=True)
testmod(name="diophantine_all_soln", verbose=True)
testmod(name="extended_gcd", verbose=True)
Expand Down
5 changes: 2 additions & 3 deletions blockchain/modular_division.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,9 @@ def greatest_common_divisor(a, b):
return b


# Import testmod for testing our function
from doctest import testmod

if __name__ == "__main__":
from doctest import testmod

testmod(name="modular_division", verbose=True)
testmod(name="modular_division2", verbose=True)
testmod(name="invert_modulo", verbose=True)
Expand Down

0 comments on commit c906ba8

Please sign in to comment.