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

some of our tests now fail due to pytest=5.4.0 #757

Closed
DougBurke opened this issue Mar 13, 2020 · 1 comment · Fixed by #758
Closed

some of our tests now fail due to pytest=5.4.0 #757

DougBurke opened this issue Mar 13, 2020 · 1 comment · Fixed by #758

Comments

@DougBurke
Copy link
Contributor

Some of Omar's data-regridding tests are now failing because they rely on an "accidental" feature which has now been "fixed". See pytest-dev/pytest#6909 for more details (and it's not just us that has been bitten by this).

For reference, the tests fail with a message like

==================================== test session starts =====================================
platform linux -- Python 3.8.1, pytest-5.4.0, py-1.8.1, pluggy-0.13.1
rootdir: /home/dburke
collected 2329 items / 1 error / 2328 selected

=========================================== ERRORS ===========================================
_ ERROR collecting anaconda/envs/sherpa-wtf/lib/python3.8/site-packages/sherpa-4.12.0+121.g2d36b10e.dirty-py3.8-linux-x86_64.egg/sherpa/models/tests/test_regrid_unit.py _
In function "test_evaluation_space2d_overlaps":
Parameter "x_overlaps" should be declared explicitly via indirect or in function itself
!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================== 1 error in 1.23s ======================================

It also does not hit all our test configurations on Travis; I don't know if that's just that the new version hasn't made it to all set ups yet or something more interesting on how we set things up.

@DougBurke
Copy link
Contributor Author

Explicitly setting the indirect argument, as shown below, makes the tests run, but they now fail

@pytest.mark.parametrize('x_overlaps, y_overlaps', [
    (True, True),
    (True, False),
    (False, False),
], indirect=True)
@pytest.mark.parametrize('integrated', [
    True, False
], indirect=True)
def test_evaluation_space2d_overlaps(setup_overlapping_spaces):

which creates

=========================================== ERRORS ===========================================
_____________ ERROR at setup of test_evaluation_space2d_overlaps[True-True-True] _____________
file /home/dburke/anaconda/envs/sherpa-wtf/lib/python3.8/site-packages/sherpa-4.12.0+121.g2d36b10e.dirty-py3.8-linux-x86_64.egg/sherpa/models/tests/test_regrid_unit.py, line 852
  @pytest.mark.parametrize('x_overlaps, y_overlaps', [
      (True, True),
      (True, False),
      (False, False),
  ], indirect=True)
  @pytest.mark.parametrize('integrated', [
      True, False
  ], indirect=True)
  def test_evaluation_space2d_overlaps(setup_overlapping_spaces):
file /home/dburke/anaconda/envs/sherpa-wtf/lib/python3.8/site-packages/sherpa-4.12.0+121.g2d36b10e.dirty-py3.8-linux-x86_64.egg/sherpa/models/tests/test_regrid_unit.py, line 884
  @pytest.fixture
  def setup_overlapping_spaces(integrated, x_overlaps, y_overlaps):
E       fixture 'integrated' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capture_all_warnings, clean_astro_ui, clean_ui, doctest_namespace, make_data_path, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, restore_xspec_settings, run_thread, setup_1d, setup_overlapping_spaces, test_data_path, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

/home/dburke/anaconda/envs/sherpa-wtf/lib/python3.8/site-packages/sherpa-4.12.0+121.g2d36b10e.dirty-py3.8-linux-x86_64.egg/sherpa/models/tests/test_regrid_unit.py:884
____________ ERROR at setup of test_evaluation_space2d_overlaps[True-True-False] _____________
...

Oooh. It looks like we just need to add x_overlaps, y_overlaps, integrated to the argument list to test_evaluation_space2d_overlaps and everything will be golden. Expect a PR.

DougBurke added a commit to DougBurke/sherpa that referenced this issue Mar 13, 2020
The pytest 5.4.0 update changed how "implicit" parameters are
passed around. See

pytest-dev/pytest#6909

for more details.
DougBurke added a commit to DougBurke/sherpa that referenced this issue Mar 13, 2020
The pytest 5.4.0 update changed how "implicit" parameters are
passed around. See

pytest-dev/pytest#6909

for more details.
wmclaugh added a commit that referenced this issue Mar 13, 2020
…ssue #757)

Fix test break due to pytest 5.4.0 update (issue #757)
Marie-Terrell pushed a commit that referenced this issue Apr 29, 2020
…ssue #757)

Fix test break due to pytest 5.4.0 update (issue #757)
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 a pull request may close this issue.

1 participant