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

Pytest Style: test_imports.py #1473

Merged
merged 2 commits into from Jul 11, 2017
Merged

Pytest Style: test_imports.py #1473

merged 2 commits into from Jul 11, 2017

Conversation

@utkbansal
Copy link
Member

@utkbansal utkbansal commented Jul 10, 2017

Fixes #

Changes made in this Pull Request:

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?
@orbeckst orbeckst added the testing label Jul 11, 2017
Copy link
Member

@orbeckst orbeckst left a comment

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

This comment has been minimized.

@orbeckst

orbeckst Jul 11, 2017
Member

remove the commented line

return paths


@pytest.mark.parametrize('testing_module', get_file_paths())

This comment has been minimized.

@orbeckst

orbeckst Jul 11, 2017
Member

looks like a sensible and pretty clean way to turn the yield-based test into a parametrized one, good!

This comment has been minimized.

@orbeckst

orbeckst Jul 11, 2017
Member

(nothing to do here...)

This comment has been minimized.

@jbarnoud

jbarnoud Jul 11, 2017
Contributor

It is rather neat indeed!


path_to_testing_modules = MDAnalysisTests.__path__[0]
# Exclusion path relative to MDAnalysisTests
exclusions = ['/plugins']

This comment has been minimized.

@orbeckst

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

@utkbansal
Copy link
Member Author

@utkbansal utkbansal commented Jul 11, 2017

@kain88-de @richardjgowers Review please.


path_to_testing_modules = MDAnalysisTests.__path__[0]
# Exclusion path relative to MDAnalysisTests
exclusions = ['/plugins', '/data']

This comment has been minimized.

@jbarnoud

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.

This comment has been minimized.

@richardjgowers

richardjgowers Jul 12, 2017
Member

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

This comment has been minimized.

@jbarnoud

jbarnoud Jul 11, 2017
Contributor

It is rather neat indeed!

@kain88-de kain88-de merged commit 5a1b55c into MDAnalysis:develop Jul 11, 2017
3 checks passed
3 checks passed
QuantifiedCode No new issues introduced.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 89.66%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants