Skip to content

Commit

Permalink
test: reject Python 2 in test-find-python
Browse files Browse the repository at this point in the history
  • Loading branch information
DeeDeeG committed Feb 15, 2021
1 parent 9c0d980 commit 3c48f70
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions test/test-find-python.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@ const PythonFinder = findPython.test.PythonFinder
require('npmlog').level = 'warn'

test('find python', function (t) {
t.plan(4)
t.plan(5)

findPython.test.findPython(null, function (err, found) {
t.strictEqual(err, null)
var proc = execFile(found, ['-V'], function (err, stdout, stderr) {
t.strictEqual(err, null)
if (/Python 2/.test(stderr)) {
t.strictEqual(stdout, '')
t.ok(/Python 2/.test(stderr))
} else {
t.ok(/Python 3/.test(stdout))
t.strictEqual(stderr, '')
}
t.notOk(/Python 2/.test(stderr))
t.ok(/Python 3/.test(stdout))
t.strictEqual(stderr, '')
})
proc.stdout.setEncoding('utf-8')
proc.stderr.setEncoding('utf-8')
Expand Down

0 comments on commit 3c48f70

Please sign in to comment.