Skip to content

Test helper - #22

Merged
astrofrog merged 2 commits into
astropy:masterfrom
jiffyclub:test-helper
Oct 17, 2011
Merged

astrofrog merged 2 commits into
astropy:masterfrom
jiffyclub:test-helper

Conversation

@jiffyclub

Copy link
Copy Markdown
Contributor

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.

…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.
astrofrog added a commit that referenced this pull request Oct 17, 2011
@astrofrog
astrofrog merged commit fb2b910 into astropy:master Oct 17, 2011
@astrofrog

Copy link
Copy Markdown
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
embray pushed a commit to embray/astropy that referenced this pull request Jan 23, 2015
mdboom added a commit that referenced this pull request Apr 7, 2015
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
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.

2 participants