diff --git a/tests/test_traceback.py b/tests/test_traceback.py
index 2830e26aa..03705f99c 100644
--- a/tests/test_traceback.py
+++ b/tests/test_traceback.py
@@ -277,7 +277,7 @@ def test_guess_lexer_yaml_j2():
     something: {{ raiser() }}
     else: {{ 5 + 5 }}
     """
-    assert Traceback._guess_lexer("test.yaml.j2", code) == "text"
+    assert Traceback._guess_lexer("test.yaml.j2", code) in ("text", "YAML+Jinja")
 
 
 def test_recursive():