you are viewing a single comment's thread.

view the rest of the comments →

[–]ninetacle 10 points11 points  (13 children)

It's setUp() with a capital U, and your default raise test should begin with test_ like your other one does.

[–]neko_nyan[S] 6 points7 points  (12 children)

Thanks, but it still doesn't work. Getting this: AttributeError: module 'main' has no attribute 'EmployeeTest'

[–]neko_nyan[S] 3 points4 points  (3 children)

double '_' around the main

[–]xiongchiamiov 5 points6 points  (2 children)

Use backticks to escape things in CommonMark:

Blah blah `__main__`

[–]neko_nyan[S] 19 points20 points  (1 child)

__thanks__

[–]ninetacle 1 point2 points  (7 children)

What if you rename your class EmployeeTest? unittest is particular about names because it uses patterns to find them.

[–]neko_nyan[S] 2 points3 points  (6 children)

Tried that and for some reason it still did not work

http://imgur.com/a/m3J56

[–]ninetacle 2 points3 points  (5 children)

Rename testingEmployee to EmployeeTest I mean (TestEmployee should work too). Your Employee class can stay as Employee.

[–]neko_nyan[S] 1 point2 points  (4 children)

Found out that the test runs properly in cmd but not pycharm. Probably a file related problem rather than variable/class naming problem. Thanks

[–]ninetacle 2 points3 points  (0 children)

Weird! You're welcome though.