Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import nose
  2. from nose.tools import istest, nottest
  3. nose.run()
  4. path1 = "/some/my/path1/"
  5. path2 = "/some/my/path2/"
  6.  
  7. @istest
  8. def compare_dir(path1, path2):
  9. my_bool = mytest, bool
  10. yield my_test, my_bool
  11. sub_path1 = path1 + "some_path"
  12. sub_path2 = path2 + "some_path"
  13. compare_dir(sub_path1, sub_path2)
  14.  
  15. def my_test(is_equal):
  16. assert is_equal, "Not equal!"
  17.  
  18. Traceback (most recent call last):
  19. File "/Python27/lib/site-packages/nose/case.py", line 197, in runTest
  20. self.test(*self.arg)
  21. TypeError: compare_dir() takes exactly 2 arguments (0 given)
  22.  
  23. /path/to/my/test/my_test_name.py --tests=my_test_name
  24.  
  25. def compare_dir(path1, path2):
  26.  
  27. def compare_dir(path1=path1, path2=path2):
  28.  
  29. def compare_dir(path1, path2):
  30. global path1, path2
  31. my_bool = mytest, bool
  32. yield my_test, my_bool
  33. sub_path1 = path1 + "some_path"
  34. sub_path2 = path2 + "some_path"
  35. compare_dir(sub_path1, sub_path2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement