Details
-
Type:
RFC
-
Status: Adopted
-
Resolution: Done
-
Component/s: DM
-
Labels:None
Description
This topic came up during the pytest hacking session at the All Hands Meeting, but was not resolved there. Discussion about a recent code review brought it up again and Colin Slater reminded me that it was more dangerous than I'd thought.
Because of the interaction between SIP and environment variables on macOS, making our tests executable with #!/usr/bin/env python and running them directly (./testBlah.py) will fail. Although some of our developers do use executable tests on Linux, I think we're better off disabling that entirely to prevent people trying to execute them on macOS. Also, that way everyone is executing the tests in the same manner and getting the same output via py.test.
This will also help us in the future when we eventually start using py.test features (e..g fixtures and marks), directly, since then we'll have to run with py.test.
We do have a lot of executable tests currently which would have to be changed and have their sha-bangs removed, but that's easily automated.
Attachments
Issue Links
- is triggering
-
DM-20855 Remove shebangs from remaining test files and remove execute bit
- To Do
-
DM-7450 Update coding standard to reflect non-executable tests (RFC-215)
- Done
- relates to
-
RFC-229 Python tests should be named test_*.py for pytest support
- Implemented
-
DM-3200 Base package fails to build under OS X El Capitan
- Done
- mentioned in
-
Page Loading...
As a curmudgeonly objector who missed my chance earlier, I feel I should point out that you can't adopt an RFC without creating the implementation tickets. In this case, I reckon that should at least include updating the Developer Guide (and I don't think you can legitimately attempt to enforce it until that's been done). I'd be sympathetic to the idea that updating all of the existing tests was outside scope.