code: def test_error_when_missing_comma_in_extras(self) -> None:
      # GIVEN
      to_parse = "name[bar baz]"
  
      # WHEN
      with pytest.raises(InvalidRequirement) as ctx:
          Requirement(to_parse)
  
      # THEN
      assert ctx.exconly() == (
          "packaging.requirements.InvalidRequirement: "
          "Expected comma between extra names\n"
          "    name[bar baz]\n"
          "             ^"
      )
  
imports: from typing import Optional, Set
  import pytest
  from packaging.markers import Marker
  from packaging.requirements import InvalidRequirement, Requirement
  from packaging.specifiers import SpecifierSet
label_desc: Use image node_id 7 for calling the TestRequirementParsing obj's underlying member method code with example usage: obj.test_error_when_missing_comma_in_extras() without return types