<s> import logging <EOL> import pytest <EOL> from shapely . geometry import LineString <EOL> from shapely . geos import ReadingError <EOL> from shapely . wkt import loads <EOL> def test_error_handler ( tmpdir ) : <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> logger . setLevel ( logging . DEBUG ) <EOL> logfile = str ( tmpdir . join ( '<STR_LIT>' ) ) <EOL> fh = logging . FileHandler ( logfile ) <EOL> logger . addHandler ( fh ) <EOL> LineString ( [ ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:2> , <NUM_LIT:2> ) ] ) . project ( LineString ( [ ( <NUM_LIT:1> , <NUM_LIT:1> ) , ( <NUM_LIT> , <NUM_LIT> ) ] ) ) <EOL> with pytest . raises ( ReadingError ) : <EOL> loads ( '<STR_LIT>' ) <EOL> g = loads ( '<STR_LIT>' ) <EOL> assert g . is_valid == False <EOL> log = open ( logfile ) . read ( ) <EOL> assert "<STR_LIT>" in log <EOL> assert "<STR_LIT>" in log <EOL> assert "<STR_LIT>" in log </s>
