summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/node-gyp/test/test-find-python.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/node-gyp/test/test-find-python.js')
-rw-r--r--deps/npm/node_modules/node-gyp/test/test-find-python.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/deps/npm/node_modules/node-gyp/test/test-find-python.js b/deps/npm/node_modules/node-gyp/test/test-find-python.js
index c52a579666..1c86f45b73 100644
--- a/deps/npm/node_modules/node-gyp/test/test-find-python.js
+++ b/deps/npm/node_modules/node-gyp/test/test-find-python.js
@@ -1,13 +1,12 @@
'use strict'
+delete process.env.PYTHON
+
const test = require('tap').test
const findPython = require('../lib/find-python')
const execFile = require('child_process').execFile
const PythonFinder = findPython.test.PythonFinder
-delete process.env.PYTHON
-delete process.env.NODE_GYP_FORCE_PYTHON
-
require('npmlog').level = 'warn'
test('find python', function (t) {
@@ -17,8 +16,13 @@ test('find python', function (t) {
t.strictEqual(err, null)
var proc = execFile(found, ['-V'], function (err, stdout, stderr) {
t.strictEqual(err, null)
- t.strictEqual(stdout, '')
- t.ok(/Python 2/.test(stderr))
+ if (/Python 2/.test(stderr)) {
+ t.strictEqual(stdout, '')
+ t.ok(/Python 2/.test(stderr))
+ } else {
+ t.ok(/Python 3/.test(stdout))
+ t.strictEqual(stderr, '')
+ }
})
proc.stdout.setEncoding('utf-8')
proc.stderr.setEncoding('utf-8')
@@ -51,6 +55,7 @@ TestPythonFinder.prototype.log = {
warn: () => {},
error: () => {}
}
+delete TestPythonFinder.prototype.env.NODE_GYP_FORCE_PYTHON
test('find python - python', function (t) {
t.plan(6)