]> granicus.if.org Git - graphviz/commitdiff
tests: avoid a manual open of /dev/null
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 7 Dec 2021 01:31:02 +0000 (17:31 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 12 Dec 2021 01:28:52 +0000 (17:28 -0800)
rtest/test_examples.py

index ef2b7439ddef973785b288b8a15e1552e302d88c..ac8bb9dad1552b9e393d86b8880795cd9f236062 100644 (file)
@@ -68,8 +68,7 @@ def test_gvpr_example(src):
   wd = Path(__file__).parent.parent.resolve()
 
   # run GVPR with the given script
-  with open(os.devnull, "rt") as nul:
-    subprocess.check_call(["gvpr", "-f", path], stdin=nul, cwd=wd)
+  subprocess.check_call(["gvpr", "-f", path], stdin=subprocess.DEVNULL, cwd=wd)
 
 @pytest.mark.skipif(shutil.which("gvpr") is None, reason="GVPR not available")
 # FIXME: Remove skip when