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

    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

          Container Issues

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Planned End:

                    Summary Panel