How to test that class __init__ method raises exception using fixture in pytest (Python)
By : Greenkingwashere
Date : March 29 2020, 07:55 AM
it should still fix some issue I don't see any benefit to the fixture in this situation. I would just create the object in the test method. Having an optional parameter with a default value and then raising an exception when the parameter is missing seems very strange. Unless you really need a custom error message, consider removing the default value.