Please sign in to comment.
Fix nightly cron ctypes enum failure (pantsbuild#7249)
### Problem Resolves pantsbuild#7247. `ToolchainVariant('gnu')` does not in fact `== 'gnu'`. ### Solution - Use `.resolve_for_enum_variant()` instead of comparing with equality in that one failing test (I missed this in pantsbuild#7226, I fixed the instance earlier in the file though). - Raise an error when trying to use `==` on an enum to avoid this from happening again. - Note that in Python 3 it appears that `__hash__` must be explicitly implemented whenever `__eq__` is overridden, and this appears undocumented. ### Result The nightly cron job should be fixed, and enums are now a little more difficult to screw up. # Open Questions It's a little unclear why this didn't fail in CI -- either the test was cached, or some but not all travis osx images are provisioned with the correct dylib, causing a nondeterministic error, or something else?
- Loading branch information...
Showing with 42 additions and 2 deletions.