Remove code with side effects from main (#1577)

* Remove code with side effects from main

When running tests withy pytest, some modules execute code in main scope
and open plot or browser windows.

Moves such code under `if __name__ == "__main__"`.

* fixup! Format Python code with psf/black push
This commit is contained in:
Mantas Zimnickas
2019-11-17 20:38:48 +02:00
committed by Christian Clauss
parent 5616fa9e62
commit 12f69a86f5
4 changed files with 516 additions and 505 deletions

View File

@ -36,8 +36,9 @@ def viz_polymonial():
return
viz_polymonial()
if __name__ == "__main__":
viz_polymonial()
# Predicting a new result with Polymonial Regression
pol_reg.predict(poly_reg.fit_transform([[5.5]]))
# output should be 132148.43750003
# Predicting a new result with Polymonial Regression
pol_reg.predict(poly_reg.fit_transform([[5.5]]))
# output should be 132148.43750003