You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 11, 2023. It is now read-only.
Tardis is built upon the package_template. I tried several things to solve this issue but the only thing that worked was redefining pytest_runtest_setup which I think is not the best solution. Any idea what we may be causing this? Were there major changes in the package template that need to be propagated? Is there a recommended way of keeping the template files up to date with astropy/package-template?
@pllim Sorry I updated the link. I guess we are using the new configuration system. We are using astropy 1.0.4 in 'production'. When updating to astropy 1.1 we stumbled upon this error.
The line with the error is:
The tracebacks point to astropy/tests/pytest_plugins.py, which is not really in the template, but rather in Astropy core itself. Also, how exactly are you running your tests, i.e., what command do you use?
I think I found the 'bug'. redefining pytest_addoption is a bad idea because there the ini option is defined.
What's the recommended way to add pytest optinons?
We add two options for running extended tests. Without these options a quick test run is preformed. Adding the option enables something like integration tests.
Hmm, not sure about redefining pytest_addoption itself. Maybe someone else can comment on that.
Personally, I have used the @remote_data decorator on my tests to mark it as "extended", which means they won't run unless I give the --remote-data option. Kinda hacky for your case but might be a temporary workaround until someone can suggest something better.
I actually suggested using @remote_data to replace --atomic-dataset but with the currently WIP implementation of full integration tests which need a specific config file I don't think that works.
A workaround would be to hardcode the path to the integration_test_config and if it's missing skip the tests. But that would be hacky.
Thank you very much for the help so far. I'll discuss this issue with the rest of the collaboration.
Another option, maybe, is to move all those tests to a different sub-package. Then you can instruct your test runner to run everything but the tests in the sub-package using -P option. Something to think about.
Sure, I just asked on gitter how they feel about it. If it's worth doing I'd make an issue and if I have the time and it works the way I currently think about it, I'll make a PR.
Thanks for the help. I ended up doing the following:
from astropy.tests.pytest_plugins import pytest_addoption as _pytest_addoption
def pytest_addoption(parser):
_pytest_addoption(parser)
parser.addconfig(...)
Activity
pllim commentedon Jun 3, 2016
Your GitHub link appears broken. A full traceback would also be nice. Are you using the new configuration system?
http://docs.astropy.org/en/stable/config/
http://docs.astropy.org/en/stable/config/config_0_4_transition.html
yeganer commentedon Jun 3, 2016
@pllim Sorry I updated the link. I guess we are using the new configuration system. We are using astropy 1.0.4 in 'production'. When updating to astropy 1.1 we stumbled upon this error.
The line with the error is:
pllim commentedon Jun 3, 2016
The tracebacks point to
astropy/tests/pytest_plugins.py, which is not really in the template, but rather in Astropy core itself. Also, how exactly are you running your tests, i.e., what command do you use?yeganer commentedon Jun 3, 2016
I'm using
./setup.py test.pllim commentedon Jun 3, 2016
My hunch is that your
conftest.pyis messed up. In your file, you re-defineddef pytest_*()functions.pllim commentedon Jun 3, 2016
Compare yours with the one in the template, and you can see the difference.
yeganer commentedon Jun 3, 2016
I thought the same but deleting everything pytest_ related didn't solve the issue.
pllim commentedon Jun 3, 2016
What version is your pytest? Maybe try update to the latest Astropy and astropy-helpers if you still see problem?
yeganer commentedon Jun 3, 2016
I think I found the 'bug'. redefining
pytest_addoptionis a bad idea because there the ini option is defined.What's the recommended way to add pytest optinons?
pllim commentedon Jun 3, 2016
What options do you need that is not already available?
yeganer commentedon Jun 3, 2016
We add two options for running extended tests. Without these options a quick test run is preformed. Adding the option enables something like integration tests.
EDIT:
Here is the option in question:
https://github.com/tardis-sn/tardis/blob/master/tardis/conftest.py#L52
pllim commentedon Jun 3, 2016
Hmm, not sure about redefining
pytest_addoptionitself. Maybe someone else can comment on that.Personally, I have used the
@remote_datadecorator on my tests to mark it as "extended", which means they won't run unless I give the--remote-dataoption. Kinda hacky for your case but might be a temporary workaround until someone can suggest something better.yeganer commentedon Jun 3, 2016
I actually suggested using
@remote_datato replace--atomic-datasetbut with the currently WIP implementation of full integration tests which need a specific config file I don't think that works.A workaround would be to hardcode the path to the integration_test_config and if it's missing skip the tests. But that would be hacky.
Thank you very much for the help so far. I'll discuss this issue with the rest of the collaboration.
pllim commentedon Jun 3, 2016
Another option, maybe, is to move all those tests to a different sub-package. Then you can instruct your test runner to run everything but the tests in the sub-package using
-Poption. Something to think about.yeganer commentedon Jun 3, 2016
-Ponly runs tests inside a specific module/package? What's the difference to--test-path?yeganer commentedon Jun 3, 2016
Another option would be to 'fix' this in astropy by providing something like
PYTEST_HEADER_MODULESfor ini and config options.pllim commentedon Jun 3, 2016
Yes.
You can certainly bring this up as an issue, but that would be at https://github.com/astropy/astropy/issues
yeganer commentedon Jun 3, 2016
Sure, I just asked on gitter how they feel about it. If it's worth doing I'd make an issue and if I have the time and it works the way I currently think about it, I'll make a PR.
yeganer commentedon Jun 5, 2016
Thanks for the help. I ended up doing the following:
pllim commentedon Jun 6, 2016
Great it works out for you. Feel free to close this issue if you think it is no longer a problem.
yeganer commentedon Jun 7, 2016
Sorry, totally forgot to close it.