Skip to content

Tests failing with pytest 5.1.0 #2329

@IAlibay

Description

@IAlibay

Expected behavior

Issue with pytest 5.1.0 (released 15th August 2019)
pytest test_util.py in /lib should not fail.

Actual behavior

When using pytest 5.1.0, test_deprecate fails due to the match_expr keyword. This can be seen in https://travis-ci.com/MDAnalysis/mdanalysis/jobs/226110046

Conda currently provides pytest 5.0.1, so all the non-MacOS builds are not failing. But the py3.6 MacOS build installs pytest via pip, which picks up 5.1.0. I have tested 5.1.0 locally on a linux machine and the failures happen too.

Possible fix

It looks like the match_expr keyword was removed in: pytest-dev/pytest@683b263 (and pytest-dev/pytest#5529)
If match_expr is replaced with match the tests will run normally.

I'm not 100% sure when match_expr first got deprecated though. It looks like it was ~ 2 years ago, so somewhere around pytest 3.X?

Iterating through older versions of pytest, it looks like the minimum version where the match keyword will work is 3.3.0. I should note that in pytest versions prior to that, changing the value of match_expr to something that should fail doesn't actually cause test failures either (tested 3.1, 3.2.0 and 3.2.5).

If it's ok I'll create a PR switching match_expr to match and bump up the minimum version of pytest to 3.3.0?

Currently version of MDAnalysis

  • Which version are you using? (run python -c "import MDAnalysis as mda; print(mda.__version__)")
    0.19.3-dev
  • Which version of Python (python -V)?
    Python 3.7.3
  • Which operating system?
    Ubuntu 18.04 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions