admin管理员组

文章数量:1296841

Context: We're using behave to test a family of hardware devices -- we'd like to use tags specify whether a Feature or Scenario applies to all variants, or to one or more variants.

Problem: there is (potentially) a large number of attributes for each hardware variant, so rather than specify them all on a command line, we'd like to use a configuration file to define the tags specific to one model, so we could do something like:

% behave --D SKU=ULTRA_FIZZY_V2

... and list all the appropriate tags in a file (presumably named "ULTRA_FIZZY_V2.tags" or some such). But I haven't figured out how to define tags in a file.

Suggestions? (BTW: I've switched over to behave 1.2.7 if that makes a difference...)

UPDATE - simplification

Is there a way to load a custom configuration file at startup, e.g. one that might contain:

#file: my_config.ini
[behave]
tags = "*FIZZY*"

... that I could load in the environment.py file?

本文标签: pythonbehave setting tags from a configuration fileStack Overflow