Sorry, I didn't notice the tests are below. I'm really confused by those tests, and the problem is that, as you're using a Python template, it won't count at the code coverage. I'm also not sure if this will break with the Sphinx docs generation.

So I think that passing the reference files as arguments to it is a much cleaner way to deal with this problem, and you can keep the part that reads sys.argv inside the `if __name__ == '__main__':` condition.