From 4058786dcd0de161fe991fc391032646b692f8b2 Mon Sep 17 00:00:00 2001 From: Konrad Hinsen Date: Tue, 11 Feb 2014 12:59:11 +0100 Subject: [PATCH] Print a warning when iptest is run from the IPython source directory --- IPython/testing/iptestcontroller.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index 8300e32c3..bcdbb5e66 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -499,6 +499,14 @@ def default_options(): return options def main(): + # iptest doesn't work correctly if the working directory is the + # root of the IPython source tree. Tell the user to avoid + # frustration. + if os.path.exists(os.path.join(os.getcwd(), + 'IPython', 'testing', '__main__.py')): + print("Don't run iptest from the IPython source directory", + file=sys.stderr) + sys.exit(1) # Arguments after -- should be passed through to nose. Argparse treats # everything after -- as regular positional arguments, so we separate them # first.