def test_double_close():
 with pipeline.get_cat_pipeline(pipeline.PIPE, pipeline.PIPE) as pl:
  assert isinstance(pl.stdin, pipebuf.NonBlockBufferedWriter)
  assert (not pl.stdin.closed)
  pl.stdin.close()
  assert pl.stdin.closed
  pl.stdin.close()
  assert isinstance(pl.stdout, pipebuf.NonBlockBufferedReader)
  assert (not pl.stdout.closed)
  pl.stdout.close()
  assert pl.stdout.closed
  pl.stdout.close()
 pipeline_wait(pl)

def test_double_close ( ) : with pipeline . get_cat_pipeline ( pipeline . PIPE , pipeline . PIPE ) as pl : assert isinstance ( pl . stdin , pipebuf . NonBlockBufferedWriter ) assert ( not pl . stdin . closed ) pl . stdin . close ( ) assert pl . stdin . closed pl . stdin . close ( ) assert isinstance ( pl . stdout , pipebuf . NonBlockBufferedReader ) assert ( not pl . stdout . closed ) pl . stdout . close ( ) assert pl . stdout . closed pl . stdout . close ( ) pipeline_wait ( pl )
a file should is able to be closed twice without raising .