code: def test_encoder_invalid_layer_type():
      pytest.importorskip("longformer")
      with pytest.raises(ValueError):
          LongformerEncoder(20, pos_enc_layer_type="abc_pos")
      with pytest.raises(ValueError):
          LongformerEncoder(20, pos_enc_layer_type="dummy")
      with pytest.raises(ValueError):
          LongformerEncoder(
              20,
              pos_enc_layer_type="abc_pos",
              selfattention_layer_type="dummy",
          )
  
imports: import pytest
  import torch
  from espnet2.asr.encoder.longformer_encoder import LongformerEncoder
label_desc: Use image node_id 2 for calling a global function with example usage: test_encoder_invalid_layer_type() without return types