PyContracts *probably* still enabled when running celery workers and management commands

Description

It might be helpful to enable environment level overrides to turn contracts on or off, so that we can easily turn it on for tests (both django, running through manage.py, and nosetests).

Steps to Reproduce

None

Current Behavior

None

Expected Behavior

None

Reason for Variance

None

Release Notes

None

User Impact Summary

None

Activity

Show:
Calen Pennington
October 9, 2014, 1:33 PM

That sounds like nice gravy to add.

Adam Palay
October 9, 2014, 1:27 PM

Sure. Should you be able to specify it with some sort of flag, like --contracts?

Calen Pennington
October 9, 2014, 1:09 PM

I added contracts about 2 weeks ago, more or less. Again, only in Split.

I'd want to add the disable_all() call to manage.py so that it happens before any code using contracts gets imported (because that's the only way to completely eliminate the performance hit). I've also been thinking that pushing something upstream that checks for environment variables when contracts is imported, so that it's easy to globally enable/disable them without making any code changes.

Adam Palay
October 9, 2014, 12:41 PM

Also, for how long would have this been the case?

Adam Palay
October 8, 2014, 8:45 PM

So should that be added to startup.py? hidden behind a feature flag?

Fixed

Assignee

Adam Palay

Reporter

Calen Pennington

Labels

Reach

None

Impact

None

Platform Area

None

Customer

None

Partner Manager

None

URL

None

Contributor Name

None

Groups with Read-Only Access

None

Actual Points

None

Category of Work

None

Platform Map Area (Levels 1 & 2)

None

Platform Map Area (Levels 3 & 4)

None

Priority

CAT-2