Pytest Style: test_imports.py #1473
Merged
Conversation
Looking good, just minor things. |
if self.is_excluded(fpath): | ||
continue | ||
yield self._run_test_relative_import, fpath | ||
# yield self._run_test_relative_import, fpath |
orbeckst
Jul 11, 2017
Member
remove the commented line
remove the commented line
return paths | ||
|
||
|
||
@pytest.mark.parametrize('testing_module', get_file_paths()) |
orbeckst
Jul 11, 2017
Member
looks like a sensible and pretty clean way to turn the yield-based test into a parametrized one, good!
looks like a sensible and pretty clean way to turn the yield-based test into a parametrized one, good!
orbeckst
Jul 11, 2017
Member
(nothing to do here...)
(nothing to do here...)
jbarnoud
Jul 11, 2017
Contributor
It is rather neat indeed!
It is rather neat indeed!
|
||
path_to_testing_modules = MDAnalysisTests.__path__[0] | ||
# Exclusion path relative to MDAnalysisTests | ||
exclusions = ['/plugins'] |
orbeckst
Jul 11, 2017
Member
Also add '/data'
to exclusions – will save a tiny bit in the os.walk
and makes clear that nothing in the data directory should be looked at. (There are no .py
files in data
so nothing changes overall anyway.)
Also add '/data'
to exclusions – will save a tiny bit in the os.walk
and makes clear that nothing in the data directory should be looked at. (There are no .py
files in data
so nothing changes overall anyway.)
@kain88-de @richardjgowers Review please. |
|
||
path_to_testing_modules = MDAnalysisTests.__path__[0] | ||
# Exclusion path relative to MDAnalysisTests | ||
exclusions = ['/plugins', '/data'] |
jbarnoud
Jul 11, 2017
Contributor
Constants in the global scope should be in capital. PATH_TO_TESTING_MODULES
and EXCLUSIONS
. I'd like to see this changed but it is not blocking.
Constants in the global scope should be in capital. PATH_TO_TESTING_MODULES
and EXCLUSIONS
. I'd like to see this changed but it is not blocking.
richardjgowers
Jul 12, 2017
Member
Yeah I'd have preferred this too, it makes it obvious where things have come from
Yeah I'd have preferred this too, it makes it obvious where things have come from
return paths | ||
|
||
|
||
@pytest.mark.parametrize('testing_module', get_file_paths()) |
jbarnoud
Jul 11, 2017
Contributor
It is rather neat indeed!
It is rather neat indeed!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Fixes #
Changes made in this Pull Request:
PR Checklist