-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use unittest instead of Nose as base #117
Conversation
This finally passes on Python 3, but is still likely to be hard to make work properly on Python 2. |
Passes on Python 2 too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally ++. Minor thoughts.
aloe/loader.py
Outdated
Loader for tests written in Gherkin. | ||
""" | ||
|
||
from __future__ import unicode_literals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single line?
aloe/loader.py
Outdated
return | ||
|
||
self.feature_dirs = [ | ||
dir_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identity comprehension? Could this just be list()
?
aloe/loader.py
Outdated
|
||
if hasattr(self, 'after_hook'): | ||
self.after_hook() | ||
delattr(self, 'after_hook') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels weird, why not re-retrieve it from the registry like in run_before_callbacks
?
aloe/main.py
Outdated
Unittest main working with Gherkin tests. | ||
""" | ||
|
||
from __future__ import unicode_literals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single line?
@@ -178,4 +177,5 @@ def check_types(self): | |||
('none', type(None)), | |||
('bool', bool), | |||
('date', date)): | |||
assert_equal(type(getattr(MyWeirdObject.ref, attr)), type_) | |||
# pylint:disable=unidiomatic-typecheck | |||
assert type(getattr(MyWeirdObject.ref, attr)) == type_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is
finally: | ||
if fh: | ||
fh.close() | ||
release_lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put some space in here to make the flow control easier to read :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lifted from Nose, I'd rather replace this altogether or use some library.
- Use a single __future__ import - Avoid unnecessary list comprehension - Use 'is' for comparing types
d8f3689
to
9dfe8a6
Compare
9dfe8a6
to
2ea3e68
Compare
Note to self: I've promised to test this against one of my projects. |
what’s the status of this? |
There's no one brave enough to try the change on a live project and share the results here. With the level of invasiveness required to make both nose and, sadly, unittest work, I am reluctant to merge the changes in (see also aloetesting/aloe_django#50) without such a confirmation. |
@koterpillar im not going to lie -- yes its a little scary, specially since i just finished creating a migration aloe testing implementation (im going to release it soon) and it heavily relies on nose. I'm going to test test when i get a chance, our code should be the perfect example: $ find /code -type f -path '*/features/*' -name '*.py' -exec cat {} \; -exec echo \; | wc -l
17630
$ find /code -type f -path '*/features/*' -name '*.feature' -exec cat {} \; -exec echo \; | wc -l
88730 |
Uncluttering my PRs. |
See #108 for motivation.