code: def test_photonics_error() -> None:
      # check error
      photo = core.Photonics("bragg", 16)
      np.testing.assert_raises(AssertionError, photo, np.zeros(12))
      with warnings.catch_warnings(record=True) as ws:
          output = photo(np.zeros(16))
          # one warning on Ubuntu, two warnings with Windows
          assert any(isinstance(w.message, RuntimeWarning) for w in ws)
      np.testing.assert_almost_equal(output, float("inf"))
  
imports: import os
  from unittest import SkipTest
  import warnings
  import typing
  import pytest
  import numpy
  from nevergrad.common import testing
  from .None import core
  from .None import photonics
label_desc: Use image node_id 6 for calling a global function with example usage: test_photonics_error() without return types