numirias / pytest-json-report

🗒️ A pytest plugin to report test results as JSON
MIT License
147 stars 39 forks source link

pytest-metadata 3.0.0 breaking "Environment" #89

Open hawflau opened 1 year ago

hawflau commented 1 year ago

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.

eskerda commented 1 year ago

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
alexandrul commented 12 months ago

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

andrewsiemer commented 10 months ago

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

alexandrul commented 10 months ago

@andrewsiemer could you provide more info, please?

andrewsiemer commented 10 months ago

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