@@ -45,7 +45,7 @@ def transform(tree, *, quotelevel, set_ctx, stop, **kw):
4545 view = UnexpandedLetView (tree )
4646 for binding in view .bindings :
4747 if type (binding ) is not Tuple :
48- assert False , "prefix: expected a tuple in let binding position"
48+ assert False , "prefix: expected a tuple in let binding position" # pragma: no cover
4949 _ , value = binding .elts # leave name alone, recurse into value
5050 binding .elts [1 ] = transform .recurse (value , quotelevel = quotelevel )
5151 if view .body :
@@ -61,7 +61,7 @@ def transform(tree, *, quotelevel, set_ctx, stop, **kw):
6161 if isunexpandedtestmacro (tree ):
6262 stop ()
6363 if type (tree .slice ) is not Index :
64- assert False , "prefix: Slice and ExtSlice not implemented in analysis of testing macro arguments"
64+ assert False , "prefix: Slice and ExtSlice not implemented in analysis of testing macro arguments" # pragma: no cover
6565 body = tree .slice .value
6666 if type (body ) is Tuple :
6767 # skip the transformation of the argument tuple itself, but transform its elements
@@ -78,31 +78,31 @@ def transform(tree, *, quotelevel, set_ctx, stop, **kw):
7878 while True :
7979 if isunquote (op ):
8080 if quotelevel < 1 :
81- assert False , "unquote while not in quote"
81+ assert False , "unquote while not in quote" # pragma: no cover
8282 quotelevel -= 1
8383 elif isquote (op ):
8484 quotelevel += 1
8585 else :
8686 break
8787 set_ctx (quotelevel = quotelevel )
8888 if not len (data ):
89- assert False , "a prefix tuple cannot contain only quote/unquote operators"
89+ assert False , "a prefix tuple cannot contain only quote/unquote operators" # pragma: no cover
9090 op , * data = data
9191 if quotelevel > 0 :
9292 quoted = [op ] + data
9393 if any (iskwargs (x ) for x in quoted ):
94- assert False , "kw(...) may only appear in a prefix tuple representing a function call"
94+ assert False , "kw(...) may only appear in a prefix tuple representing a function call" # pragma: no cover
9595 return q [(ast_literal [quoted ],)]
9696 # (f, a1, ..., an) --> f(a1, ..., an)
9797 posargs = [x for x in data if not iskwargs (x )]
9898 # TODO: tag *args and **kwargs in a kw() as invalid, too (currently just ignored)
9999 invalids = list (flatmap (lambda x : x .args , filter (iskwargs , data )))
100100 if invalids :
101- assert False , "kw(...) may only specify named args"
101+ assert False , "kw(...) may only specify named args" # pragma: no cover
102102 kwargs = flatmap (lambda x : x .keywords , filter (iskwargs , data ))
103103 kwargs = list (rev (uniqify (rev (kwargs ), key = lambda x : x .arg ))) # latest wins, but keep original ordering
104104 thecall = Call (func = op , args = posargs , keywords = list (kwargs ))
105- if PYTHON34 : # Python 3.4 only
105+ if PYTHON34 : # pragma: no cover, Python 3.4 only
106106 thecall .starargs = None
107107 thecall .kwargs = None
108108 return thecall
@@ -115,17 +115,17 @@ def transform(tree, *, quotelevel, set_ctx, stop, **kw):
115115# namely the stubs for the "q" and "u" markers used within a `prefix` block.
116116class q : # noqa: F811
117117 """[syntax] Quote operator. Only meaningful in a tuple in a prefix block."""
118- def __repr__ (self ): # in case one of these ends up somewhere at runtime
118+ def __repr__ (self ): # in case one of these ends up somewhere at runtime # pragma: no cover
119119 return "<quote>"
120120q = q ()
121121
122122class u : # noqa: F811
123123 """[syntax] Unquote operator. Only meaningful in a tuple in a prefix block."""
124- def __repr__ (self ): # in case one of these ends up somewhere at runtime
124+ def __repr__ (self ): # in case one of these ends up somewhere at runtime # pragma: no cover
125125 return "<unquote>"
126126u = u ()
127127
128128# not a @macro_stub; it only raises a run-time error on foo[...], not foo(...)
129129def kw (** kwargs ):
130130 """[syntax] Pass-named-args operator. Only meaningful in a tuple in a prefix block."""
131- raise RuntimeError ("kw only meaningful inside a tuple in a prefix block" )
131+ raise RuntimeError ("kw only meaningful inside a tuple in a prefix block" ) # pragma: no cover
0 commit comments