]> granicus.if.org Git - graphviz/commitdiff
tests: rename 'dot' variables in test_regression.py
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 7 Dec 2021 02:31:05 +0000 (18:31 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 12 Dec 2021 01:28:51 +0000 (17:28 -0800)
An upcoming change will introduce a `dot` function, which these variables will
then shadow, causing warnings. This is a pre-emptive change to avoid this.

rtest/test_regression.py

index 0a29050a51f6f41d0b4663e1ecb6791d8b4bce99..631aedf59cd298d2018a356142173623acf426d7 100644 (file)
@@ -279,16 +279,16 @@ def test_517():
   # translate this back to Dot
   p = subprocess.Popen(["gxl2gv"], stdin=subprocess.PIPE,
     stdout=subprocess.PIPE, universal_newlines=True)
-  dot, _ = p.communicate(gxl)
+  dot_output, _ = p.communicate(gxl)
   assert p.returncode == 0
 
   # the result should have both expected labels somewhere
   assert \
-    "label=<<TABLE><TR><TD>(</TD><TD>A</TD><TD>)</TD></TR></TABLE>>" in dot, \
-    "HTML label missing"
+    "label=<<TABLE><TR><TD>(</TD><TD>A</TD><TD>)</TD></TR></TABLE>>" in \
+    dot_output, "HTML label missing"
   assert \
-    'label="<TABLE><TR><TD>(</TD><TD>B</TD><TD>)</TD></TR></TABLE>"' in dot, \
-    "regular label missing"
+    'label="<TABLE><TR><TD>(</TD><TD>B</TD><TD>)</TD></TR></TABLE>"' in \
+    dot_output, "regular label missing"
 
 def test_793():
   """
@@ -353,14 +353,14 @@ def test_1276():
   """
 
   # DOT input containing a label with quotes
-  dot = 'digraph test {\n' \
+  src = 'digraph test {\n' \
         '  x[label=<"Label">];\n' \
         '}'
 
   # process this to GML
   p = subprocess.Popen(["gv2gml"], stdin=subprocess.PIPE,
                        stdout=subprocess.PIPE, universal_newlines=True)
-  gml, _ = p.communicate(dot)
+  gml, _ = p.communicate(src)
 
   assert p.returncode == 0, "gv2gml failed"
 
@@ -576,10 +576,10 @@ def test_1767():
   assert c_src.exists(), "missing test case"
 
   # find our co-located dot input
-  dot = (Path(__file__).parent / "1767.dot").resolve()
-  assert dot.exists(), "missing test case"
+  src = (Path(__file__).parent / "1767.dot").resolve()
+  assert src.exists(), "missing test case"
 
-  ret, _, _ = run_c(c_src, [dot], link=["cgraph", "gvc"])
+  ret, _, _ = run_c(c_src, [src], link=["cgraph", "gvc"])
   assert ret == 0
 
   # FIXME: uncomment this when #1767 is fixed