Azure / pytest-azurepipelines

Plugin for pytest that makes it simple to work with Azure Pipelines
MIT License
112 stars 35 forks source link

Support pytest 7.1.0 #57

Closed stan-sz closed 2 years ago

stan-sz commented 2 years ago

With pytest 7.1.0 we get unknown hook 'pytest_warning_captured'.

simklei commented 2 years ago

Can confirm the issue.

For anyone in a hurry, a temporary solution is pinning the version of pytest used in my Azure Pipelines to 7.0.1. Of course, remembering to undo the temporary solution once this issue is resolved :)

Example from Azure Pipelines YAML file:

- script: |
    pip install pytest==7.0.1 pytest-azurepipelines
    pytest --test-run-title="$(Build.SourceBranchName) - $(Build.SourceVersion) - Test results for Python $(python.version)"
  displayName: 'Run pytest'
lblonk commented 2 years ago

I'm also experiencing this issue. I hope this PR will be merged soon

MOURIK commented 2 years ago

Hi, I have the same issue. thank you for your support. I saw that you already worked on this issue in this commit c2a7e6c26a6ec3a9a91fd64b7157d0f3e7c6520e. (update pytest_warning_captured with pytest_warning_recored but it was too early :) so i'm waiting the update.

error message: INTERNALERROR> pluggy._manager.PluginValidationError: unknown hook 'pytest_warning_captured' in plugin <module 'pytest_azurepipelines' from '/home/vsts/work/1/s/venv/lib/python3.8/site-packages/pytest_azurepipelines.py'>

tonybaloney commented 2 years ago

(maintainer here). I'm on it!

tonybaloney commented 2 years ago

Released patch in 1.0.1

This also uses the NUnit exporter, so the test results are a bit more detailed

tonybaloney commented 2 years ago

Hi, I have the same issue. thank you for your support. I saw that you already worked on this issue in this commit c2a7e6c. (update pytest_warning_captured with pytest_warning_recored but it was too early :) so i'm waiting the update.

error message: INTERNALERROR> pluggy._manager.PluginValidationError: unknown hook 'pytest_warning_captured' in plugin <module 'pytest_azurepipelines' from '/home/vsts/work/1/s/venv/lib/python3.8/site-packages/pytest_azurepipelines.py'>

That package is was marked as a release candidate so it wouldn't have been the default.

atharva-2001 commented 2 years ago

Thank you very much for fixing this issue! I was wondering why is pytest_warning_captured still here? https://github.com/tonybaloney/pytest-azurepipelines/blob/df51df6b8288ae2ee288ca4c14b656f80fe069a2/pytest_azurepipelines.py#L219-L225

tonybaloney commented 2 years ago

Thank you very much for fixing this issue! I was wondering why is pytest_warning_captured still here?

https://github.com/tonybaloney/pytest-azurepipelines/blob/df51df6b8288ae2ee288ca4c14b656f80fe069a2/pytest_azurepipelines.py#L219-L225

Because I still need to support Pytest <6.0.0. This new hook was added in pytest 6, lots of people are using 5 and below