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

Refactor ExampleCollector #67

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

angelsanzn
Copy link
Contributor

And again, some improvements that I thought of when reading this class.

Mostly about naming, making methods smaller and narrowing scopes in general.

One question: I don't really undestand the TODO comment in this file. Is it still relevant? Should I wipe it as well, or add a more detailed issue?

@angelsanzn angelsanzn force-pushed the refactor-example-collector branch 2 times, most recently from b444e5d to 4d62974 Compare February 4, 2016 18:06
Ángel Sanz added 17 commits February 5, 2016 01:25
Rename some variables to make explicit that they are file names,
not files, and paths, not directories.

Extract a method for creating path to spec files.

Ignore the second item in the tuples returned by os.walk.

Adjust indendation
Only the call to __import__ can throw. So we can use a for-else
to make explicit what should be done in case it doesn't throw.
the importing of local non-installed modules
…text manager

There is no real setup/teardown work needing to be done
in that method, it just prepares the module name and delegates
to another method. So using a context manager adds little
benefit. This also simplifies the implementation of
ExampleCollector#modules a bit more.
- Give more information about the code object.
- Decouple _create_module_object from its particular usage
in the class.
- Remove unnecessary conversion to list
- Remove old unused variable binding in with statement
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.

1 participant