Uploaded image for project: 'Request For Comments'
  1. Request For Comments
  2. RFC-215

Disallow executable tests due to "#!/usr/bin/env python" problems on OSX


    • Type: RFC
    • Status: Adopted
    • Resolution: Done
    • Component/s: DM
    • Labels:


      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.


          Issue Links



              • Assignee:
                Parejkoj John Parejko
                Parejkoj John Parejko
                Colin Slater, Jim Bosch, John Parejko, John Swinbank, Jonathan Sick, Robert Lupton, Russell Owen, Tim Jenness
              • Votes:
                0 Vote for this issue
                8 Start watching this issue


                • Created:
                  Planned End:

                  Summary Panel