Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import nose
- from nose.tools import istest, nottest
- nose.run()
- path1 = "/some/my/path1/"
- path2 = "/some/my/path2/"
- @istest
- def compare_dir(path1, path2):
- my_bool = mytest, bool
- yield my_test, my_bool
- sub_path1 = path1 + "some_path"
- sub_path2 = path2 + "some_path"
- compare_dir(sub_path1, sub_path2)
- def my_test(is_equal):
- assert is_equal, "Not equal!"
- Traceback (most recent call last):
- File "/Python27/lib/site-packages/nose/case.py", line 197, in runTest
- self.test(*self.arg)
- TypeError: compare_dir() takes exactly 2 arguments (0 given)
- /path/to/my/test/my_test_name.py --tests=my_test_name
- def compare_dir(path1, path2):
- def compare_dir(path1=path1, path2=path2):
- def compare_dir(path1, path2):
- global path1, path2
- my_bool = mytest, bool
- yield my_test, my_bool
- sub_path1 = path1 + "some_path"
- sub_path2 = path2 + "some_path"
- compare_dir(sub_path1, sub_path2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement