From 82dc1b8e59891a7ca0f1a5e67a3db952b918561c Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 11 Sep 2019 16:47:42 -0400 Subject: Upgrade pylint (#2917) depot_tools is removing pylint from its distribution so we must maintain our own copy. --- tools/setup_test.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'tools/setup_test.py') diff --git a/tools/setup_test.py b/tools/setup_test.py index 69e1ea349..275c53e30 100644 --- a/tools/setup_test.py +++ b/tools/setup_test.py @@ -1,27 +1,25 @@ # Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import os import sys - -from setup import gn_string, read_gn_args, write_gn_args from shutil import rmtree from tempfile import mktemp - +from setup import gn_string, read_gn_args, write_gn_args from test_util import DenoTestCase, run_tests class TestSetup(DenoTestCase): def test_gn_string(self): - assert '"abc"' == gn_string('abc') - assert '"foo\\$bar\\"baz"' == gn_string('foo$bar"baz') - assert '"do\\not\\escape"' == gn_string('do\\not\\escape') - assert '"so\\\\\\very\\\\\\"fun\\"' == gn_string('so\\\\very\\"fun\\') + assert gn_string('abc') == '"abc"' + assert gn_string('foo$bar"baz') == '"foo\\$bar\\"baz"' + assert gn_string('do\\not\\escape') == '"do\\not\\escape"' + assert gn_string('so\\\\very\\"fun\\') == '"so\\\\\\very\\\\\\"fun\\"' def test_read_gn_args(self): # Args file doesn't exist. (args, hand_edited) = read_gn_args("/baddir/hopefully/nonexistent/args.gn") assert args is None - assert hand_edited == False + assert not hand_edited # Handwritten empty args file. filename = mktemp() @@ -30,7 +28,7 @@ class TestSetup(DenoTestCase): (args, hand_edited) = read_gn_args(filename) os.remove(filename) assert args == [] - assert hand_edited == True + assert hand_edited # Handwritten non-empty args file. expect_args = ['some_number=2', 'another_string="ran/dom#yes"'] @@ -40,7 +38,7 @@ class TestSetup(DenoTestCase): (args, hand_edited) = read_gn_args(filename) os.remove(filename) assert args == expect_args - assert hand_edited == True + assert hand_edited def test_write_gn_args(self): # Build a nonexistent path; write_gn_args() should call mkdir as needed. @@ -57,7 +55,7 @@ class TestSetup(DenoTestCase): # Validate that the right contents were written. (check_args, hand_edited) = read_gn_args(filename) assert check_args == args - assert hand_edited == False + assert not hand_edited # Clean up. rmtree(d) -- cgit v1.2.3