Testing in Python with pytest
Në shqip: Testimi në Python me pytest
ShpjegimiSQ
pytest është mënyra më e thjeshtë për teste në Python: funksione test_ me assert të zakonshëm, fiksturat në conftest.py, parametrize për shumë raste, dhe plugin-e për coverage, paralelizëm dhe Django.
EnglishEN
pytest is the simplest way to test in Python: test_ functions with plain assert, fixtures in conftest.py, parametrize for many cases, and plugins for coverage, parallelism and Django.
Si ta mendosh
Si një fletore e thjeshtë ku shënon çfarë duhet të jetë e vërtetë.
Lexoje në anglisht
Like a simple notebook where you write what should be true.
Shembull kodipython
def test_mesatarja():
assert mesatarja([4, 6]) == 5
with pytest.raises(ZeroDivisionError): mesatarja([])