BEHAVE(1)
π BEHAVE π
okay bestie, listen β this is the manual page for behave, a User Command, and it's genuinely iconic. we're gonna go through the whole thing together, no skips, no shortcuts, because you deserve the full picture. π«Ά
πΈ NAME πΈ
behave β run a number of feature tests with behave. that's it. that's the vibe. β¨
π DESCRIPTION π
the usage line, in all its glory:
usage: behave [options] [DIRECTORY|FILE|FILE:LINE|AT_FILE]*
Run a number of feature tests with behave. lowkey the whole point of the program, fr fr. π
β¨ EXAMPLES β¨
here's how people actually invoke it, look at these:
behave features/ behave features/one.feature features/two.feature
behave features/one.feature:10 behave @features.txt
yes bestie, you can point it at a whole directory, at individual feature files, at a specific line in a feature file, or at an @-file. main character energy across the board. π
π positional arguments π
pathsβ Feature directory, file or file-location (FILE:LINE). so you can hand it a folder, a file, or a file plus a line number. whatever your heart desires. π¦
π options π
strap in, this list is long and every single one of these matters:
-h,--helpβ show this help message and exit. the classic. the legend. π-C,--no-colorβ Disable colored mode. no pretty colors for you, sad but valid. π--color [{auto,on,off,always,never}]β Use colored mode or not (default:auto). pick your fighter from the list, or just let it decide for itself. β¨-d,--dry-runβ Invokes formatters without executing the steps. like a rehearsal, but nothing actually happens. π-D,--define NAME=VALUEβ Define user-specific data for theconfig.userdatadictionary. Example:-D foo=barto store it inconfig.userdata["foo"]. literally your own little stash of custom data. π-e,--exclude PATTERNβ Don't run feature files matching regular expression PATTERN. yeet those files out of the run. π-i,--include PATTERNβ Only run feature files matching regular expression PATTERN. picky and i respect it. π--no-junitβ Don't output JUnit-compatible reports.--junitβ Output JUnit-compatible reports. When junit is enabled, allstdoutandstderrwill be redirected and dumped to the junit report, regardless of the"-- capture"and"--no-capture"options. so heads up: junit mode does NOT care what capture settings you picked. π--junit-directory PATHβ Directory in which to store JUnit reports.-j,--jobs,--parallel NUMBERβ Number of concurrent jobs to use (default:1). Only supported by test runners that support parallel execution. so if your runner doesn't do parallel, this does nothing for you, no cap. π₯-f,--format FORMATTERβ Specify a formatter. If none is specified the default formatter is used. Pass"--format help"to get a list of available formatters. go window shopping, bestie. π--steps-catalogβ Show a catalog of all available step definitions. SAME AS:"--format=steps.catalog --dry-run --no-summary -q". a shortcut, a blessing. β¨--no-skippedβ Don't print skipped steps (due to tags).--show-skippedβ Print skipped steps. This is the default behaviour. This switch is used to override a configuration file setting. so if your config file said otherwise, this says "actually, no." π--no-snippetsβ Don't print snippets for unimplemented steps.--snippetsβ Print snippets for unimplemented steps. This is the default behaviour. This switch is used to override a configuration file setting.--no-multilineβ Don't print multiline strings and tables under steps.--multilineβ Print multiline strings and tables under steps. This is the default behaviour. This switch is used to override a configuration file setting.-n,--name NAME_PATTERNβ Select feature elements (scenarios, ...) to run which match part of the given name (regex pattern). If this option is given more than once, it will match against all the given names. stack 'em up, it'll match all of them. π¦--captureβ Enable capture mode (stdout/stderr/log-output). Any capture output will be printed on a failure/error. quiet while things go right, loud the second they don't. π₯--no-captureβ Disable capture mode (stdout/stderr/log-output).--capture-stdoutβ Enable capture ofstdout.--no-capture-stdoutβ Disable capture ofstdout.--capture-stderrβ Enable capture ofstderr.--no-capture-stderrβ Disable capture ofstderr.--capture-log,--logcaptureβ Enable capture of logging output.--no-capture-log,--no-logcaptureβ Disable capture of logging output.--capture-hooksβ Enable capture of hooks (except:before_all). note the exception, bestie βbefore_allis NOT captured. π--no-capture-hooksβ Disable capture of hooks.--logging-level LOG_LEVELβ Specify a level to capture logging at. The default isINFO- capturing everything. everything, all of it, the whole log. π--logging-format LOG_FORMATβ Specify custom format to print statements. Uses the same format as used by standard logging handlers. The default is"%(levelname)s:%(name)s:%(message)s".--logging-datefmt LOG_DATE_FORMATβ Specify custom date/time format to print statements. Uses the same format as used by standard logging handlers.--logging-filter LOG_FILTERβ Specify which statements to filter in/out. By default, everything is captured. If the output is too verbose, use this option to filter out needless output. Example:--logging-filter=foowill capture statements issued ONLY tofooorfoo.what.ever.subbut notfoobaror other logger. Specify multiple loggers with comma:filter=foo,bar,baz. If any logger name is prefixed with a minus, egfilter=-foo, it will be excluded rather than included. so-means "not you, bestie." π--logging-clear-handlersβ Clear existing logging handlers (duringcapture-log).--no-logging-clear-handlersβ Keep existing logging handlers (duringcapture-log).--no-summaryβ Don't display the summary at the end of the run.--summaryβ Display the summary at the end of the run.-o,--outfile FILENAMEβ Write formatter output to output-file (default:stdout). redirect that glow-up to a file. β¨-q,--quietβ Alias for--no-snippets --no-source. two-for-one deal, we love a shortcut. π-r,--runner RUNNER_CLASSβ Use own runner class, like:"behave.runner:Runner". bring your own runner, be your own boss. π--no-sourceβ Don't print the file and line of the step definition with the steps.--show-sourceβ Print the file and line of the step definition with the steps. This is the default behaviour. This switch is used to override a configuration file setting.--stage STAGEβ Defines the current test stage. The test stage name is used as name prefix for the environment file and the steps directory (instead of default path names). naming things is a superpower fr. π¦--stopβ Stop running tests at the first failure. one strike and we're out. π-t,--tags TAG_EXPRESSIONβ Only execute features or scenarios with tags matching TAG_EXPRESSION. Use:option:`--tags-help`option for more information. (yes that's the literal text, we keep it, no editing the lore.)-T,--no-timingsβ Don't print the time taken for each step.--show-timingsβ Print the time taken, in seconds, of each step after the step has completed. This is the default behaviour. This switch is used to override a configuration file setting.-v,--verboseβ Show the files and features loaded. tell me everything, i want the tea. β-w,--wipβ Only run scenarios tagged with"wip". Additionally: use the"plain"formatter, do not capturestdoutor logging output and stop at the first failure. it's a whole bundle, a combo meal, and honestly? iconic. π₯--lang LANGβ Use keywords for a language other than English. multilingual queen. π--lang-listβ List the languages available for--lang.--lang-help LANGβ List the translations accepted for one language.--tags-helpβ Show help for tag expressions.--versionβ Show version.
ngl, that's a LOT of flags, but you ate that. every single one is here, nothing skipped, periodt. π
this is behave 1.3.3, dated January 2026, and it lives in the User Commands section of the manual β so go forth, run your feature tests, and slay. bye bestie, mwah πβ¨
π¦ where this page comes from
- fedora 44: python3-behave 1.3.3-2.fc44 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms