##// END OF EJS Templates
apply pyupgrade
Matthias Bussonnier -
Show More
@@ -1,4 +1,3 b''
1 # encoding: utf-8
2 """
1 """
3 Tests for platutils.py
2 Tests for platutils.py
4 """
3 """
@@ -100,7 +99,7 b' class SubProcessTestCase(tt.TempFileMixin):'
100 self.mktmp('\n'.join(lines))
99 self.mktmp('\n'.join(lines))
101
100
102 def test_system(self):
101 def test_system(self):
103 status = system('%s "%s"' % (python, self.fname))
102 status = system(f'{python} "{self.fname}"')
104 self.assertEqual(status, 0)
103 self.assertEqual(status, 0)
105
104
106 def test_system_quotes(self):
105 def test_system_quotes(self):
@@ -147,11 +146,11 b' class SubProcessTestCase(tt.TempFileMixin):'
147
146
148 status = self.assert_interrupts(command)
147 status = self.assert_interrupts(command)
149 self.assertNotEqual(
148 self.assertNotEqual(
150 status, 0, "The process wasn't interrupted. Status: %s" % (status,)
149 status, 0, f"The process wasn't interrupted. Status: {status}"
151 )
150 )
152
151
153 def test_getoutput(self):
152 def test_getoutput(self):
154 out = getoutput('%s "%s"' % (python, self.fname))
153 out = getoutput(f'{python} "{self.fname}"')
155 # we can't rely on the order the line buffered streams are flushed
154 # we can't rely on the order the line buffered streams are flushed
156 try:
155 try:
157 self.assertEqual(out, 'on stderron stdout')
156 self.assertEqual(out, 'on stderron stdout')
@@ -171,7 +170,7 b' class SubProcessTestCase(tt.TempFileMixin):'
171 self.assertEqual(out.strip(), '1')
170 self.assertEqual(out.strip(), '1')
172
171
173 def test_getoutput_error(self):
172 def test_getoutput_error(self):
174 out, err = getoutputerror('%s "%s"' % (python, self.fname))
173 out, err = getoutputerror(f'{python} "{self.fname}"')
175 self.assertEqual(out, 'on stdout')
174 self.assertEqual(out, 'on stdout')
176 self.assertEqual(err, 'on stderr')
175 self.assertEqual(err, 'on stderr')
177
176
@@ -181,7 +180,7 b' class SubProcessTestCase(tt.TempFileMixin):'
181 self.assertEqual(out, '')
180 self.assertEqual(out, '')
182 self.assertEqual(err, '')
181 self.assertEqual(err, '')
183 self.assertEqual(code, 1)
182 self.assertEqual(code, 1)
184 out, err, code = get_output_error_code('%s "%s"' % (python, self.fname))
183 out, err, code = get_output_error_code(f'{python} "{self.fname}"')
185 self.assertEqual(out, 'on stdout')
184 self.assertEqual(out, 'on stdout')
186 self.assertEqual(err, 'on stderr')
185 self.assertEqual(err, 'on stderr')
187 self.assertEqual(code, 0)
186 self.assertEqual(code, 0)
General Comments 0
You need to be logged in to leave comments. Login now