Force "bad" (not 0) return code of terminal command?

I have a framework written in python, and for testing purposes I basically want to do a subprocess (aka shell call) ... that should simply come back with a RC != 0. I tried to invoke some non-existing executable; or to run "exit 1"; but those are for some reason translated to a FileNotFoundError.

So, what else could I do to trigger a return code != 0 (in a "reliable" way; meaning the command should not suddenly return 0 at a future point in time).

I thought to "search" for a binary called exit, but well:

> /usr/bin/env exit
/usr/bin/env: exit: No such file or directory

If you're looking for a system command that always returns a non-zero exit code, then /bin/false seems like it should work for you. From man false:

NAME
       false - do nothing, unsuccessfully

SYNOPSIS
       false [ignored command line arguments]
       false OPTION

DESCRIPTION
       Exit with a status code indicating failure.

You can create a new return code with the command bash -c "exit RETURNCODE", replacing "RETURNCODE" with any number. Note that it will be trimmed to an 8bit unsigned integer (0...255) by (RETURNCODE mod 256)

You can check the return code of the last shell command inside the terminal(!) with executing echo $?. The "$?" variable contains the most recent return code and "echo" prints it to the standard output.