Skip to content

Commit

Permalink
small change for incresed code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Almenon committed Mar 27, 2021
1 parent 1f854f3 commit a5af708
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/test-python-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ describe('PythonShell', function () {
// * inherit - inherit fd from parent process;
// * process.stderr - pass output directly to that stream.
stdio: ['ignore', 'inherit', process.stderr],
args: ["0"]
// @ts-expect-error python-shell technically allows a non-array arg,
// although the user shouldn't be doing this. We are just testing for
// increased code coverage
args: "0"
}, done);

should(pyshell.stdin).be.eql(null);
Expand Down Expand Up @@ -376,7 +379,7 @@ describe('PythonShell', function () {
args: ['hello', 'world'],
mode: 'binary'
});
pyshell.on('message', ()=>{
pyshell.on('message', () => {
done('should not emit messages in binary mode');
return undefined
});
Expand Down Expand Up @@ -418,10 +421,10 @@ describe('PythonShell', function () {
let pyshell = new PythonShell('stderrLogging.py', {
stderrParser: 'binary'
});
pyshell.on('stderr', ()=>{
pyshell.on('stderr', () => {
done('should not emit stderr in binary mode');
});
pyshell.end(()=>{
pyshell.end(() => {
done()
});
});
Expand Down Expand Up @@ -504,7 +507,7 @@ describe('PythonShell', function () {
});
});
it('should work in json mode', function (done) {
let pyshell = new PythonShell('error.py', {mode: 'json'});
let pyshell = new PythonShell('error.py', { mode: 'json' });
pyshell.on('pythonError', function (err) {
err.stack.should.containEql('----- Python Traceback -----');
err.stack.should.containEql('File "test' + sep + 'python' + sep + 'error.py", line 4');
Expand Down

0 comments on commit a5af708

Please sign in to comment.