pytest-json-report icon indicating copy to clipboard operation
pytest-json-report copied to clipboard

pytest-metadata 3.0.0 breaking "Environment"

Open hawflau opened this issue 1 year ago • 5 comments

https://github.com/pytest-dev/pytest-metadata/issues/70

We use pytest-json-report and recently found that the "Environement" section of the json reports are always empty.

From release note of pytest-metadata 3.0.0:

Use pytest.stash internally instead of _metadata

It seems pytest-json-report needs to be updated to cope with pytest-metadata's breaking change.

hawflau avatar Jun 05 '23 18:06 hawflau

Note to anyone stumbling on this issue and waiting for https://github.com/numirias/pytest-json-report/pull/90 getting merged, you can pin pytest-metadata to the last compatible version on your requirements.txt.

pytest-metadata==2.0.4
pytest-json-report

eskerda avatar Oct 12 '23 17:10 eskerda

I don't have a private pypi server yet, so I've merged the #90 and #91 PRs in my fork and published a temporary package on pypi.

You can use it in requirements.txt after removing/commenting the original package:

pytest-json-report-wip==1.5.1

alexandrul avatar Nov 11 '23 22:11 alexandrul

Hi @alexandrul, your fix seems to work for Linux + MacOS but not for Windows. I get an empty environment section still.

andrewsiemer avatar Dec 23 '23 21:12 andrewsiemer

@andrewsiemer could you provide more info, please?

  • OS
  • python version (from https://www.python.org/downloads/windows/, I hope)
  • the output of pip freeze

alexandrul avatar Dec 26 '23 16:12 alexandrul

Hi @alexandrul, sorry for the ping, I seemed fix it by updating pytest-metadata.

andrewsiemer avatar Dec 26 '23 19:12 andrewsiemer