Skip to content
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

Closed
wants to merge 35 commits into from
Closed

Conversation

koterpillar
Copy link
Member

See #108 for motivation.

@koterpillar
Copy link
Member Author

This finally passes on Python 3, but is still likely to be hard to make work properly on Python 2.

@koterpillar
Copy link
Member Author

Passes on Python 2 too. --no-ignore-python is broken, and Django and Webdriver need an update too.

Copy link
Contributor

@danni danni left a 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
Copy link
Contributor

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_
Copy link
Contributor

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')
Copy link
Contributor

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
Copy link
Contributor

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_
Copy link
Contributor

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()
Copy link
Contributor

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 :)

Copy link
Member Author

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
@danni
Copy link
Contributor

danni commented Oct 24, 2016

Note to self: I've promised to test this against one of my projects.

@kingbuzzman
Copy link

what’s the status of this?

@koterpillar
Copy link
Member Author

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.

@kingbuzzman
Copy link

@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

@koterpillar
Copy link
Member Author

Uncluttering my PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants