Open brettdh opened 3 years ago
From my investigation, the problem appears to be that wantClass
is not called if only a class is specified on the nosetests
command line. This seems a bit odd, but perhaps it's because the user's command overrides what the plugins say.
For my use case, it might be sufficient to also override wantMethod
and look up the class from the method, and set the snapshot_should_update
class variable there - but perhaps the snapshot_should_update
flag should be set and looked up in a more global context than individual test classes? Even if I take the wantMethod
approach, I expect wantMethod
won't be called if I specify a specific method on the command line.
When running nosetests with a test class name, snapshots are not updated when
--snapshot-update
is provided on the command line:Minimal repro project here: https://github.com/brettdh/demo-snapshottest-update-bug