Skip to content

Instantly share code, notes, and snippets.

@mkg20001
Last active November 3, 2021 04:34
Show Gist options
  • Save mkg20001/43a25003993c265050d4c60e9a94390b to your computer and use it in GitHub Desktop.
Save mkg20001/43a25003993c265050d4c60e9a94390b to your computer and use it in GitHub Desktop.
Ignore pytest failure because of warnings

If you're trying to get pytest running for old packages you may encounter failures due to ResourceWarning or DeperactionWarning errors

Those can be easily resolved by executing pytest as follows:

pytest -v tests -W ignore::ResourceWarning -W ignore::DeprecationWarning

In your nixpkgs package that would be

checkPhase = ''
  pytest -v tests -W ignore::ResourceWarning -W ignore::DeprecationWarning
'';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment