def test_automain_script_runs_main(ex):
    global __name__
    oldname = __name__
    main_called = [False]

    try:
        __name__ = '__main__'
        with patch.object(sys, 'argv', ['test.py']):
            @ex.automain
            def foo():
                main_called[0] = True

            assert ex.commands in 'foo'
            assert ex.commands['foo'] == foo
            assert ex.default_command == 'foo'
            assert main_called[0] is True
    finally:
        __name__ = oldname
dataset/ETHPy150Open IDSIA/sacred/tests/test_experiment.py/test_automain_script_runs_main/swapped operands of `in`