Skip to content

Commit

Permalink
Merge pull request #86 from MarcoGorelli/fix-version
Browse files Browse the repository at this point in the history
BUG fix version
  • Loading branch information
MarcoGorelli committed Jul 21, 2020
2 parents 64c6199 + 0408754 commit ed2b870
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 7 additions & 5 deletions nbqa/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ def _parse_args(raw_args):
try:
args, kwargs = parser.parse_known_args(raw_args)
except SystemExit as e:
msg = (
"Please specify both a command and a notebook/directory, e.g.\n"
"nbqa flake8 my_notebook.ipynb"
)
raise ValueError(msg) from e
if e.code != 0:
msg = (
"Please specify both a command and a notebook/directory, e.g.\n"
"nbqa flake8 my_notebook.ipynb"
)
raise ValueError(msg) from e
sys.exit(0)
command = args.command
root_dir = args.root_dir
return command, root_dir, kwargs
Expand Down
6 changes: 6 additions & 0 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import subprocess


def test_version():
output = subprocess.run(["python", "-m", "nbqa", "--version"])
assert output.returncode == 0

0 comments on commit ed2b870

Please sign in to comment.