Plugin not registered

I believe that I have a working plugin now. Now I’m trying to build some unittests for it.

Using the q2_types plugin as inspirations, I have made some tests to sanity check the types and the formats. However, when I run these tests (which can be found in test_regression.py) I get the following error

tests-MacBook-Pro-4:tests mortonjt$ python test_regression.py
FF
======================================================================
FAIL: test_regression_linear_lme_to_regression_fmt_registration (__main__.TestTypes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mortonjt/miniconda3/envs/gneiss/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/plugin/testing.py", line 36, in setUp
    self.fail('%s is not a registered QIIME 2 plugin.' % package)
AssertionError: gneiss is not a registered QIIME 2 plugin.

======================================================================
FAIL: test_regression_type_registration (__main__.TestTypes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mortonjt/miniconda3/envs/gneiss/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/plugin/testing.py", line 36, in setUp
    self.fail('%s is not a registered QIIME 2 plugin.' % package)
AssertionError: gneiss is not a registered QIIME 2 plugin.

----------------------------------------------------------------------
Ran 2 tests in 0.001s

This is a little confusing, since the qiime command shows that my plugin is installed

(gneiss) tests-MacBook-Pro-4:tests mortonjt$ qiime
Usage: qiime [OPTIONS] COMMAND [ARGS]...

  QIIME 2 command-line interface (q2cli)
  --------------------------------------

  To get help with QIIME 2, visit https://qiime2.org.

  To enable tab completion in Bash, run the following command or add it to
  your .bashrc/.bash_profile:

      source tab-qiime

  To enable tab completion in ZSH, run the following commands or add them to
  your .zshrc:

      autoload bashcompinit && bashcompinit && source tab-qiime

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  info         Display information about current deployment.
  tools        Tools for working with QIIME 2 files.
  dev          Utilities for developers and advanced users.
  composition
  gneiss

Are there additional steps required for registering a plugin? Thanks!

It looks like you are in a different environment (root?) when you are running the tests. So you probably don’t have gneiss installed which is why you are getting those errors. The TestPluginBase instance will search the entry-points and use the PluginManager object to try and interact with your plugin in the same way QIIME 2 does.

Turned out that there were references to the old qiime install. Thanks @ebolyen for helping me resolve this!