Die vermoë merke te stel op py.test toets metodes is pretty cool.
& Nbsp; & nbsp; & nbsp; @ Pytest.mark.red
& Nbsp; & nbsp; & nbsp; def some_test_method (self):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; # Sommige check-y dinge
Maar as jy 'n half dosyn punte wat jy wil op 'n metode om te sit, raak dit kinda yucky.
& Nbsp; & nbsp; & nbsp; @ Pytest.mark.red
& Nbsp; & nbsp; & nbsp; @ Pytest.mark.green
& Nbsp; & nbsp; & nbsp; @ Pytest.mark.blue
& Nbsp; & nbsp; & nbsp; @ Pytest.mark.black
& Nbsp; & nbsp; & nbsp; @ Pytest.mark.orange
& Nbsp; & nbsp; & nbsp; @ Pytest.mark.pink
& Nbsp; & nbsp; & nbsp; def some_test_method (self):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; # Sommige check-y dinge
Wat sal lekker wees, is as jy hulle almal kan aansoek doen in 'n enkele versierder.
& Nbsp; & nbsp; & nbsp; @ Pytest.marks ('n rooi "," groen "," blou "," swart "," oranje "," pienk ")
& Nbsp; & nbsp; & nbsp; def some_test_method (self):
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; # Sommige check-y dinge
Wel, nou kan jy, met die pytest-punte module
Vereistes :.
- Python
Kommentaar nie gevind