Import pytest and created some test- test scripts.
This commit is contained in:
@@ -5,3 +5,4 @@ enzyme>=0.4.1
|
|||||||
click>=6.7
|
click>=6.7
|
||||||
langdetect>=1.0.7
|
langdetect>=1.0.7
|
||||||
titlecase>=0.12.0
|
titlecase>=0.12.0
|
||||||
|
pytest>=5.3.5
|
||||||
|
|||||||
0
test/__init__.py
Normal file
0
test/__init__.py
Normal file
6
test/test_import.py
Normal file
6
test/test_import.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import sys, os
|
||||||
|
sys.path.append(os.path.realpath(os.path.dirname(__file__)+"/../src"))
|
||||||
|
|
||||||
|
def test_import_env_variables():
|
||||||
|
import env_variables as env
|
||||||
|
assert env.logfile == 'conf/output.log'
|
||||||
9
test/test_square.py
Normal file
9
test/test_square.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
def square(x):
|
||||||
|
return x * x
|
||||||
|
|
||||||
|
def test_square():
|
||||||
|
assert square(2) == 4
|
||||||
|
|
||||||
|
def test_square_negative():
|
||||||
|
assert square(-2) == 4
|
||||||
Reference in New Issue
Block a user