Skip to content

Commit

Permalink
more review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed May 18, 2022
1 parent 67db245 commit 94ad5ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
import os
import unittest

from ruamel.yaml.constructor import DuplicateKeyError

from opentelemetry.semconv.model.exceptions import ValidationError
from opentelemetry.semconv.model.semantic_convention import (
SemanticConventionSet,
parse_semantic_convention_groups,
)
from ruamel.yaml.constructor import DuplicateKeyError


class TestCorrectErrorDetection(unittest.TestCase):
Expand Down Expand Up @@ -454,16 +455,14 @@ def test_nameless_event(self):
def test_condition_missing_conditionally_required_attribute(self):
with self.assertRaises(ValidationError) as ex:
self.open_yaml("yaml/errors/wrong_conditionally_required_no_condition.yaml")
self.fail()
e = ex.exception
msg = e.message.lower()
self.assertIn("missing message for conditionally required field!", msg)
self.assertEqual(e.line, 11)

def test_multiple_requirement_levels(self):
with self.assertRaises(DuplicateKeyError) as ex:
with self.assertRaises(DuplicateKeyError):
self.open_yaml("yaml/errors/wrong_multiple_requirement_levels.yaml")
self.fail()

def open_yaml(self, path):
with open(self.load_file(path), encoding="utf-8") as file:
Expand Down
2 changes: 1 addition & 1 deletion semantic-conventions/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ member ::= id value [brief] [note]
requirement_level ::= "required"
| "conditionally_required" <condition>
| "recommended" # Default if not specified
| "recommended" [condition] # Default if not specified
| "optional"
# EXPERIMENTAL: Using this is NOT ALLOWED in the specification currently.
Expand Down

0 comments on commit 94ad5ea

Please sign in to comment.