socek

Untitled

Jan 12th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. # normalna funkcja
  2. def func():
  3.     pass
  4. # używasz:
  5. func()
  6.  
  7. # dekorator dodaje argument:
  8. @dekorator
  9. def func(something):
  10.     pass
  11.  
  12. # ale używasz bez tego argumentu
  13. func()
  14.  
  15. # jednak jeśli zrobisz to w metodzie testującej, to py.test Ci zwróci, że nie ma fixtury "something"
  16. @dekorator
  17. def func(something):
  18.     pass
Advertisement
Add Comment
Please, Sign In to add comment