<s> import os <EOL> import logbook <EOL> import pytest <EOL> import pyshark <EOL> @ pytest . fixture <EOL> def caps_directory ( ) : <EOL> return os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) <EOL> @ pytest . fixture <EOL> def lazy_simple_capture ( request , caps_directory ) : <EOL> """<STR_LIT>""" <EOL> cap_path = os . path . join ( caps_directory , '<STR_LIT>' ) <EOL> cap = pyshark . FileCapture ( cap_path ) <EOL> cap . log . level = logbook . DEBUG <EOL> def finalizer ( ) : <EOL> cap . close ( ) <EOL> cap . eventloop . stop ( ) <EOL> request . addfinalizer ( finalizer ) <EOL> return cap <EOL> @ pytest . fixture <EOL> def simple_capture ( lazy_simple_capture ) : <EOL> """<STR_LIT>""" <EOL> lazy_simple_capture . load_packets ( ) <EOL> return lazy_simple_capture </s>
