0

I get this warning:

/app/facelo/extensions.py:36: SAWarning: DELETE statement on table 'trials' expected to delete 1 row(s); 0 were matched. Please set confirm_deleted_rows=False within the mapper configuration to prevent this warning.

I want to ignore it. I tried to use:

@pytest.mark.filterwarnings("ignore::SAWarning")

It gives me:

INTERNALERROR> warnings._OptionError: unknown warning category: 'SAWarning'

So it doesn't work because pytest doesn't know this warning. How can Ignore this warning?

Harm
  • 109
  • 9

1 Answers1

8

In this question, can pytest ignore a specific warning? , they supply the full path to the exception. They are using a configuration file but try that with the SAWarning using mark.

@pytest.mark.filterwarnings("ignore::sqlalchemy.exc.SAWarning")
Ian Wilson
  • 6,223
  • 1
  • 16
  • 24