Repository navigation
Test helper - #22
Merged
Merged
Test helper#22
Conversation
…t attribute. In the case when the user has pytest installed it will just point to that but when the user does not have pytest installed it will be a useable pytest imported from extern/pytest.py.
…ecessary import of imp module.
Member
|
Thanks! |
keflavich
pushed a commit
to keflavich/astropy
that referenced
this pull request
Oct 9, 2013
adrn
pushed a commit
to adrn/astropy
that referenced
this pull request
May 2, 2014
Implements SkyCoord to_string method
embray
pushed a commit
to embray/astropy
that referenced
this pull request
Jan 23, 2015
Change package-template git URL
saimn
pushed a commit
that referenced
this pull request
Apr 13, 2020
Use numpy's memmap and avoid changing ostream's file mode
This was referenced Dec 17, 2024
jeffjennings
pushed a commit
to jeffjennings/astropy
that referenced
this pull request
Jul 2, 2025
Added more prominent note on acknowledging Astropy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I modified tests/helper.py so that it automatically loads the pytest module from the script in extern/pytest.py in the event that it can't import pytest directly.
When developers are writing tests they can import pytest like so (they'll have to get the relative part right for their module):
from ..tests.helper import pytest
This will give them an installed pytest if it exists, or extern/pytest otherwise.
This change also allowed me to remove the pytest.main function wrapper from helper.py. Now the best thing to do is directly call pytest.main after importing pytest from test.helper.