From 0f4ff3d553e3eb3c4f151a9e8b7975984a22f3d2 2014-02-11 18:43:54 From: Thomas Kluyver Date: 2014-02-11 18:43:54 Subject: [PATCH] Merge pull request #5090 from khinsen/user-friendly-iptest Print a warning when iptest is run from the IPython source directory --- diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index 8300e32..bcdbb5e 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.