Skip to content

Commit bd2780d

Browse files
committed
Add a custom flag to behave clear_screen=true
1 parent 5de2a4e commit bd2780d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ boto3-stubs = { extras = [
5656
], version = "^1.34.37" }
5757
pytest-timeout = "^2.2.0"
5858
lz4 = "^4.3.3"
59+
click = "^8.1.7"
5960

6061
[tool.poetry.group.local]
6162
optional = true

src/api/tests/feature_tests/environment.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import time
12
from contextlib import nullcontext
23
from pathlib import Path
34

5+
import click
46
from behave import use_fixture
57
from behave.model import Feature, Scenario, Step
68
from event.aws.client import dynamodb_client
@@ -30,6 +32,8 @@
3032

3133

3234
def before_all(context: Context):
35+
clear_screen = context.config.userdata.get("clear_screen", "false")
36+
context.clear_screen = clear_screen.lower() == "true"
3337
context.postman_collection = PostmanCollection()
3438
context.test_mode = TestMode.parse(config=context.config)
3539
context.table_name = LOCAL_TABLE_NAME
@@ -114,6 +118,9 @@ def after_scenario(context: Context, scenario: Scenario):
114118
def after_feature(context: Context, feature: Feature):
115119
if context.postman_feature:
116120
context.postman_collection.item.append(context.postman_feature)
121+
if context.clear_screen:
122+
click.clear()
123+
time.sleep(0.5)
117124

118125

119126
def after_all(context: Context):

0 commit comments

Comments
 (0)