|
10:00:18.504 |
DEBUG |
plugin.py:833 |
setup fixture event_loop_policy() -> <_UnixDefaultEventLoopPolicy>
|
|
|
|
10:00:18.506 |
DEBUG |
plugin.py:9 |
setup fixture base_url() -> ''
|
|
|
|
10:00:18.507 |
DEBUG |
plugin.py:18 |
setup fixture _verify_url() -> None
|
|
|
|
10:00:18.508 |
DEBUG |
fixtures.py:1424 |
setup fixture pytestconfig() -> <Config>
|
|
|
|
10:00:18.509 |
DEBUG |
pytest_playwright.py:68 |
setup fixture delete_output_dir() -> None
|
|
|
|
10:00:18.510 |
DEBUG |
tmpdir.py:239 |
setup fixture tmp_path_factory() -> TempPathFactory(
_given_basetemp=None,
_trace=<pluggy._tracing.TagTracerSub object at 0x108b732b0>,
_basetemp=PosixPath('/private/var/folders/vh/2xf8thqd3572vjfgnnzvx1_m0000gn/T/pytest-of-dan.ilan/pytest-117'),
_retention_count=3,
_retention_policy='all'
)
|
|
|
|
10:00:18.511 |
DEBUG |
fixtures.py:9 |
setup fixture _human_log_only_to_html() -> True
|
|
|
|
|
|
10:00:18.512 |
DEBUG |
plugin.py:302 |
setup fixture _extract_human_object() -> None
|
|
|
|
10:00:18.513 |
DEBUG |
tmpdir.py:254 |
setup fixture tmp_path() -> PosixPath('/private/var/folders/vh/2xf8thqd3572vjfgnnzvx1_m0000gn/T/pytest-of-dan.ilan/pytest-117/test_full_pizza_order_workflow0')
|
|
|
|
10:00:18.514 |
DEBUG |
plugin.py:308 |
setup fixture _relocate_test_log() -> None
|
|
|
|
10:00:18.516 |
WARNING |
tracing.py:310 |
Target Page.screenshot is already patched for logging. |
|
|
10:00:18.516 |
WARNING |
tracing.py:310 |
Target SyncBase.remove_listener is already patched for logging. |
|
|
10:00:18.517 |
WARNING |
tracing.py:310 |
Target SyncBase.on is already patched for logging. |
|
|
10:00:18.517 |
WARNING |
tracing.py:310 |
Target SyncBase.once is already patched for logging. |
|
|
10:00:18.517 |
WARNING |
tracing.py:310 |
Target SyncBase.remove_listener is already patched for logging. |
|
|
10:00:18.517 |
DEBUG |
conftest.py:15 |
setup fixture _log_3rdparty_methods() -> None
|
|
|
|
10:00:18.518 |
DEBUG |
test_pizza.py:64 |
setup fixture _trace_delivery_service() -> None
|
|
|
|
|
|
10:00:18.519 |
DEBUG |
test_pizza.py:80 |
setup fixture expected_toppings() -> ['pepperoni', 'mushrooms', 'onions']
|
|
|
|
|
10:00:18.519 |
INFO |
test_pizza.py:92 |
Starting new pizza order: 'The Works' |
|
|
10:00:18.519 |
DEBUG |
test_pizza.py:100 |
Order details: {'customer': 'Jane Doe', 'size': 'large', 'toppings': ['pepperoni', 'mushrooms', 'onions'], 'address': '123 Main St'}
|
|
|
|
|
10:00:18.572 |
INFO |
test_pizza.py:28 |
Adding tomato sauce and mozzarella cheese. |
|
|
10:00:18.593 |
DEBUG |
test_pizza.py:104 |
test_pizza.add_sauce_and_cheese(dough='large_dough', sauce='tomato', cheese='mozzarella') -> 'large_dough_with_tomato_and_mozzarella'
|
|
|
|
|
|
10:00:18.594 |
INFO |
test_pizza.py:113 |
Preparation complete. Ready for oven. |
|
|
|
10:00:18.595 |
INFO |
test_pizza.py:50 |
Oven preheated. Baking pizza with ['pepperoni', 'mushrooms', 'onions'] |
|
|
10:00:18.700 |
WARNING |
test_pizza.py:52 |
Onions topping running low, substituting with olives. |
|
|
10:00:18.701 |
DEBUG |
test_pizza.py:116 |
test_pizza.bake_pizza(pizza_details={
'base': 'large_dough_with_tomato_and_mozzarella',
'toppings': ['pepperoni', 'mushrooms', 'onions'],
'preparation_time': 0.1
}) -> 'baked_pizza_with_pepperoni_mushrooms_olives'
|
|
|
|
|
10:00:18.701 |
DEBUG |
test_pizza.py:122 |
Contacting delivery partner for 123 Main St |
|
|
|
|
|
|
10:00:18.759 |
DEBUG |
test_pizza.py:127 |
ExternalDeliveryService.get_delivery_status() -> 'out_for_delivery'
|
|
|
|
10:00:18.759 |
INFO |
test_pizza.py:129 |
Dispatch info: {'driver_id': 'dave-007', 'eta_minutes': 15}
|
|
|
10:00:18.760 |
INFO |
test_pizza.py:130 |
Verifying final order on pickup... |
|
|
10:00:18.760 |
INFO |
test_pizza.py:60 |
Getting current topping on the pizza |
|
|
10:00:18.761 |
DEBUG |
test_pizza.py:131 |
test_pizza.get_current_topping(pizza={
'base': 'large_dough_with_tomato_and_mozzarella',
'toppings': ['pepperoni', 'mushrooms', 'olives'],
'preparation_time': 0.1
}) -> ['pepperoni', 'mushrooms', 'olives']
|
|
|
|
10:00:18.761 |
ERROR |
plugin.py:448 |
assert {'olives', 'pepperoni', 'mushrooms'} == {'pepperoni', 'mushrooms', 'onions'}
|
|
|
|
10:00:18.791 |
ERROR |
plugin.py:391 |
traceback: human = <pytest_human.human.Human object at 0x109b6ee90>, expected_toppings = ['pepperoni', 'mushrooms', 'onions']
def test_full_pizza_order_workflow(human, expected_toppings):
"""
Tests the full workflow from ordering a pizza to delivery,
showcasing all major pytest-human features.
"""
human.log.info("Starting new pizza order: 'The Works'")
order_details = {
"customer": "Jane Doe",
"size": "large",
"toppings": ["pepperoni", "mushrooms", "onions"],
"address": "123 Main St",
}
# Use highlight=True to syntax highlight the order details
human.log.debug(f"Order details: {order_details}", highlight=True)
with human.span.info("Phase 1: Preparing Pizza"):
dough = prepare_dough(order_details["size"])
pizza_base = add_sauce_and_cheese(dough, "tomato", "mozzarella")
# Simulate an internal kitchen log being added as an artifact
kitchen_ticket = f"ORDER 123\n{order_details['size'].upper()} - {order_details['toppings']}"
human.artifacts.add_log_text(kitchen_ticket, "kitchen_ticket.log", "Kitchen Printer Log")
with human.span.debug("Adding toppings"):
pizza_in_progress = add_toppings(pizza_base, order_details["toppings"])
human.log.info("Preparation complete. Ready for oven.")
with human.span.info("Phase 2: Baking Pizza"):
baked_pizza = bake_pizza(pizza_in_progress)
# This print statement will be captured as stdout
print(f"KITCHEN_ALARM: Pizza {baked_pizza} is ready!")
with human.span.info("Phase 3: Delivery"):
human.log.debug(f"Contacting delivery partner for {order_details['address']}")
# These methods will be automatically traced by our fixture
service = ExternalDeliveryService(order_details["address"])
dispatch_info = service.dispatch_driver(priority=True)
status = service.get_delivery_status()
human.log.info(f"Dispatch info: {dispatch_info}", highlight=True)
human.log.info("Verifying final order on pickup...")
current_toppings = get_current_topping(pizza_in_progress)
> assert set(current_toppings) == set(expected_toppings), "Toppings mismatch at pickup!"
E AssertionError: Toppings mismatch at pickup!
E assert {'mushrooms',..., 'pepperoni'} == {'mushrooms',..., 'pepperoni'}
E
E Extra items in the left set:
E 'olives'
E Extra items in the right set:
E 'onions'
E Use -v to get more diff
tests/examples/test_pizza.py:133: AssertionError
|
|
|
|
10:00:18.794 |
DEBUG |
test_pizza.py:80 |
Clean fixture function expected_toppings()
|
|
|
10:00:18.794 |
DEBUG |
test_pizza.py:74 |
Clean fixture function should_fail_test()
|
|
|
10:00:18.795 |
DEBUG |
test_pizza.py:64 |
Clean fixture function autouse _trace_delivery_service()
|
|
|
10:00:18.795 |
DEBUG |
conftest.py:15 |
Clean fixture function autouse _log_3rdparty_methods()
|
|
|
10:00:18.796 |
DEBUG |
plugin.py:308 |
Clean fixture function autouse _relocate_test_log()
|
|
|
10:00:18.796 |
DEBUG |
tmpdir.py:254 |
Clean fixture function tmp_path()
|
|
|
10:00:18.796 |
DEBUG |
plugin.py:302 |
Clean fixture function autouse _extract_human_object()
|
|
|
10:00:18.797 |
DEBUG |
fixtures.py:19 |
Clean fixture function human()
|
|
|
10:00:18.797 |
DEBUG |
fixtures.py:9 |
Clean fixture function _human_log_only_to_html()
|
|
|
10:00:18.797 |
DEBUG |
tmpdir.py:239 |
Clean fixture session tmp_path_factory()
|
|
|
10:00:18.798 |
DEBUG |
pytest_playwright.py:68 |
Clean fixture session autouse delete_output_dir()
|
|
|
10:00:18.798 |
DEBUG |
fixtures.py:1424 |
Clean fixture session pytestconfig()
|
|
|
10:00:18.798 |
DEBUG |
plugin.py:18 |
Clean fixture session autouse _verify_url()
|
|
|
10:00:18.799 |
DEBUG |
plugin.py:9 |
Clean fixture session base_url()
|
|
|
10:00:18.799 |
DEBUG |
plugin.py:833 |
Clean fixture session autouse event_loop_policy()
|
|
|
|
10:00:18.800 |
INFO |
plugin.py:437 |
KITCHEN_ALARM: Pizza baked_pizza_with_pepperoni_mushrooms_olives is ready!
|
|
|
|
10:00:18.800 |
INFO |
plugin.py:418 |
# Kitchen Printer Log
|
|
|
10:00:18.800 |
INFO |
plugin.py:420 |
ORDER 123
LARGE - ['pepperoni', 'mushrooms', 'onions']
|
|
|
|