Repository navigation
Conversation
|
Hi there @drdavella 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. I noticed the following issue with this pull request:
Would it be possible to fix this? Thanks! If there are any issues with this message, please report them here. |
| import pytest_doctestplus | ||
| del pytest_doctestplus | ||
| except ImportError: | ||
| pytest_plugins.append('astropy.tests.pytest_doctestplus') |
There was a problem hiding this comment.
The code that allows for compatibility with pytest-astropy begins here.
8194088 to
98bde63
Compare
|
Hmm, technically, you have a change log, so you shouldn't label it as "no change log required". |
|
@pllim that's true... technically the change log entry comes from a commit on v3.0, but I can just update the PR number for this commit. On the other hand, I'm not sure that change required a change log entry to begin with... But I'll leave the decision to someone else 🤐 |
|
Thanks @drdavella. I'll try to come back to this in a reasonable time, but probably only after I'm back from dotastro. |
98bde63 to
561155e
Compare
|
@bsipocz thanks. There's something weird going on here, so it's going to take me a bit more time to sort it out anyway. |
55b4106 to
3624fda
Compare
3624fda to
428fb92
Compare
… packages may try and access that attribute
|
A quick note regarding some issues that have cropped up: when trying to use this to use the pytest plugins along side astropy, some issues appeared for me. Specifically, I get errors like those below when doing |
This is to enable backwards compatibility with affiliated packages that may both use the astropy test runner and import from astropy.tests.pytest_plugins. In this case it prevents the config/cache plugins from being registered with pytest more than once.
c4f63cd to
4634fb2
Compare
|
@eteq thanks for the report. This issue should be addressed in the latest commit. |
|
@bsipocz, @astrofrog, I believe the travis failures for Py27 are unrelated to this PR. The failure on CircleCI appears to be related to the use of |
|
I've checked and this latest commit fixes the problem with the affiliated package |
|
@bsipocz, @eteq, @astrofrog, this is possibly a stupid question but how would we feel about making |
|
@drdavella - I'm 👎 on that because it goes against our general philosophy of no "big changes" (even if they're aren't features per se) in bugfix releases. Given the hiccups I've been encountering when going beyond the simplest cases, I think it's important we leave users/affiliated developers the option to leave things as they stand (at least until 4.0 when we stop supporting 2.x). At some point it might be so big a maintenance burden that it's just not worth it, but it seems early to me to say that now. (Admittedly easy for me to say as I'm not the one doing most of it...) But others might have a different opinion here. |
eteq
left a comment
There was a problem hiding this comment.
A minor comment re: the changelog, but another thought related to the discussion above: it might be easier to maintain this if we change this to instead place all the new plugins into extern for astropy 2.0.x and control the plugin-loading on the pytest side instead of having to use astropy/tests/pytest_plugins.py to manage the loading. That will make future maintainence easier and might get around all the "two things are installed simultaneously" issues.
|
|
||
| - Fixed a bug that meant that the data.astropy.org mirror could not be used when | ||
| using --remote-data=astropy. [#6724] | ||
| - Split pytest plugins into separate modules. [#6384] |
There was a problem hiding this comment.
This should probably be [#6384, #6833], right? I'm thinking that'll be useful for someone who sees this and wants to know where to find more context, and this is where the "real" merge happened for this version...
There was a problem hiding this comment.
this sounds sensible to me, too, though we should add the "manual backport" to #6384, too.
bsipocz
left a comment
There was a problem hiding this comment.
Looks good, I only have a few marginal nitpicks.
| env: SETUP_CMD='test --coverage --remote-data=astropy -a "--mpl"' | ||
| CONDA_DEPENDENCIES=$CONDA_ALL_DEPENDENCIES | ||
| PIP_DEPENDENCIES='cpp-coveralls objgraph jplephem pytest-mpl bintrees' | ||
| PIP_DEPENDENCIES='cpp-coveralls objgraph jplephem pytest-astropy pytest-mpl bintrees' |
There was a problem hiding this comment.
pytest-mpl is already part of pytest-astropy isn't it?
|
|
||
| - Fixed a bug that meant that the data.astropy.org mirror could not be used when | ||
| using --remote-data=astropy. [#6724] | ||
| - Split pytest plugins into separate modules. [#6384] |
There was a problem hiding this comment.
nitpick, but add an empty line before this entry
| """ | ||
|
|
||
| # NOTE: This is retained only for backwards compatibility. Affiliated packages | ||
| # should no longer import `disable_internet` from `astropy.tests`. It is now |
There was a problem hiding this comment.
nitpick as it doesn't matter here, but better to pick up the habit to use double backticks for things not sphinx linkable
| # command line flag. This is either passed to `pytest` directly or to the | ||
| # `setup.py test` command. | ||
| # | ||
| # TODO: This import should eventually be removed once backwards compatibility |
There was a problem hiding this comment.
do we have an eta for that? If we have please include, it's much easier to grep for it.
| FIX) | ||
|
|
||
| class DocTestModulePlus(doctest_plugin.DoctestModule): | ||
| # pytest 2.4.0 defines "collect". Prior to that, it defined |
There was a problem hiding this comment.
is this collect() below then just needed as a workaround for pytest <2.4? We already require 2.8 to the 2.0.x branch, so if yes, please remove.
| from pkgutil import find_loader | ||
| # This is necessary to prevent pytest from reading the doctestplus plugin when | ||
| # the pytest_doctestplus standalone package is installed | ||
| if find_loader('pytest_doctestplus') is None: |
There was a problem hiding this comment.
it's already been done in the test runner, is it necessary to repeat here, too?
There was a problem hiding this comment.
if yes, why not do it for remote-data and open files, too?
| """ | ||
| remote_data : {'none', 'astropy', 'any'}, optional | ||
| Controls whether to run tests marked with @remote_data. This can be | ||
| Controls whether to run tests marked with @pytest.mark.remote_data. This can be |
There was a problem hiding this comment.
so, now both @remote_data and pytest.mark.remote_data would work? Since we don't yet rely on pytest-astropy here, probably better to leave this as is?
No, we can't do that. I tend to be amongs the flexible ones, but 2.0.x is LTS, so while I may agree adding a new dependency to a normal bugfix, it's really a no for LTS and for a something that terribly break backwards compatibility for the affiliates and such. |
|
having the plugins in |
|
Closing this as #6918 superseded it. |
This also required a backport of the separation of Astropy's pytest plugins into individual modules.