item_attribute_accessor
This module contains the ItemAttributeAccessor class which is used to access various attributes of a pytest item.
It includes methods and properties to get the scenario, check if the item is a scenario, get the tags, get the node ID, get the name, and get all properties.
ItemAttributeAccessor
A class that accesses various attributes of a pytest item.
Attributes:
Name | Type | Description |
---|---|---|
item |
Item
|
The pytest item object. |
properties_names |
set
|
A set of property names. |
Properties
scenario: Returns the scenario attribute of the item. is_scenario: Returns a boolean indicating if the item is a scenario. tags: Returns a list of tags of the scenario. node_id: Returns the node ID of the item. name: Returns the name of the item.
Methods:
Name | Description |
---|---|
__init__ |
Initializes the ItemAttributeAccessor class. |
get_properties |
Returns a dictionary of all properties. |
Source code in libs\cafex_core\src\cafex_core\utils\item_attribute_accessor.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
extended_properties
property
Returns additional test metadata.
is_scenario
property
Returns a boolean indicating if the item is a scenario.
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the item is a scenario, False otherwise. |
name
property
Returns the name of the item.
Returns:
Name | Type | Description |
---|---|---|
str |
The name of the item. |
node_id
property
Returns the node ID of the item.
Returns:
Name | Type | Description |
---|---|---|
str |
The node ID of the item. |
scenario
property
Returns the scenario attribute of the item.
Returns:
Name | Type | Description |
---|---|---|
Scenario |
The scenario attribute of the item. |
tags
property
Returns a list of tags of the scenario.
test_type
property
Returns the type of the test.
__init__(item)
Initialize the ItemAttributeAccessor class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item
|
The pytest item object. |
required |
Source code in libs\cafex_core\src\cafex_core\utils\item_attribute_accessor.py
31 32 33 34 35 36 37 38 |
|
get_properties()
Returns a dictionary of all properties.
Returns:
Name | Type | Description |
---|---|---|
dict |
A dictionary of all properties. |
Source code in libs\cafex_core\src\cafex_core\utils\item_attribute_accessor.py
98 99 100 101 102 103 104 105 106 107 108 109 110 |
|