tests/conftest.py
def cli(args=""):
        """
        Calls sonar from Python as though it were called from the command line

        Args:
            args (str, optional): Arguments to pass to sonar. Defaults to "".

        Returns:
            int: Return value from calling sonar
        """
        testargs = ["sonar"]
        testargs.extend(args.split(" "))
        with pytest.raises(SystemExit) as exc:
            with patch.object(sys, "argv", testargs):
                sonar.main.main()
        return exc.value.code

        Calls sonar from Python as though it were called from the command line

        Args:
            args (str, optional): Arguments to pass to sonar. Defaults to "".

        Returns:
            int: Return value from calling sonar
        
Calls sonar from Python as though it were called from the command line
Calls sonar from Python as though it were called from the command line
def cli(args=""):
        testargs = ["sonar"]
        testargs.extend(args.split(" "))
        with pytest.raises(SystemExit) as exc:
            with patch.object(sys, "argv", testargs):
                sonar.main.main()
        return exc.value.code
def cli ( args = "" ) : testargs = [ "sonar" ] testargs . extend ( args . split ( " " ) ) with pytest . raises ( SystemExit ) as exc : with patch . object ( sys , "argv" , testargs ) : sonar . main . main ( ) return exc . value . code
Calls sonar from Python as though it were called from the command line
Calls sonar from Python as though it were called from the command line
"""
        Calls sonar from Python as though it were called from the command line

        Args:
            args (str, optional): Arguments to pass to sonar. Defaults to "".

        Returns:
            int: Return value from calling sonar
        """
Return value from calling sonar
Return value from calling sonar
int
args
Arguments to pass to sonar. Defaults to "".
Arguments to pass to sonar . Defaults to " " .
""