Skip to content

Upgrade to PyTest 7.0 #89

Closed
Closed
@BethanyG

Description

@BethanyG

To Do List:

  • Figure out why using Pytest 7.0 causes the CI/test runs to fail.
    Pytest uses tomli instead of toml. The plugin we define (and the data.py file we use as a helper) needed to change to import and use tomli.
  • Fix any issues with test generation and test running linked to the failures.
    These were fixed as part of fixing the CI for the content repo. See this PR for the fixes that went into the Python content repo CI.
  • Test that exercise tests & exercise code are all ok when used with the new version
    There don't appear to be errors..but we should probably be more formal with the testing.
  • Test to make sure that upgrading doesn't cause issues with any Python version 3.6 - 3.9 (since our CI tests against those versions)
    This was done as part of the fix to the content repo CI. We'll need to pin version 7.0.1 to make sure that Python 3.6 compatibility is maintained.
  • Change/update test files where needed
    This has effectively happened with the upgrade on the content repo CI. The runner code doesn't explicitly import tomli, but generate_exercises.py does, as does the code that tests exercises - so those dependancies were upgraded, as was Pytest for the CI.
  • Check requirements and dependancies for the test runner, and make sure everything is compatible (update where needed)
  • Repin the PyTest version in requirements.txt
    Pin Pytest Version to 7.0 #96 re-pins at the latest version to support Python 3.6, which is 7.0.1
  • Regenerate golden files for the test runner tests where needed
    See [Golden Tests]: Fix Failures with example-syntax-error #97 -- there is a subtle problem with the example-syntax-error golden test suite.

This also might include possible changes to the data.py code in this repo (because of toml vs tomli) and in the Python repo (for the same reasons)

Suspect it's the use of tomli in PyTest 7.0 that is causing issues. Currently, we are using the toml module, and our runner is implemented as a PyTest plugin. So the plugin cannot find or access the tomli, because it's looking for the toml.

See Issue 2892 in the Python repo for some troubleshooting context.
See also Issue 88 in this repo for troubleshooting context.

But that's only theory right now.

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