diff --git a/duecredit/dueswitch.py b/duecredit/dueswitch.py
index 99e9319..63de5ba 100644
--- a/duecredit/dueswitch.py
+++ b/duecredit/dueswitch.py
@@ -22,13 +22,13 @@ def _get_duecredit_enable():
                     "Use 'yes' or 'no', or '0' or '1'")
     return env_enable.lower() in ('1', 'yes', 'true')
 
+
 @never_fail
 def _get_inactive_due():
-    # keeping duplicate but separate so later we could even place it into a separate
-    # submodule to possibly minimize startup time impact even more
-    from .collector import InactiveDueCreditCollector
+    from .stub import InactiveDueCreditCollector
     return InactiveDueCreditCollector()
 
+
 @never_fail
 def _get_active_due():
     from .config import CACHE_DIR, DUECREDIT_FILE
@@ -62,6 +62,11 @@ class DueSwitch(object):
         self.__active = None
         self.__collectors = {False: inactive, True: active}
         self.__activations_done = False
+        if not (inactive and active):
+            raise ValueError(
+                "Both inactive and active collectors should be provided. "
+                "Got active=%r, inactive=%r" % (active, inactive)
+            )
         self.activate(activate)
 
     @property

Internal failure: VerificationError (cryptography)
Hi, 

I'm trying to follow the PyMVPA tutorial (http://www.pymvpa.org/tutorial.html), but the first import already fails due to an internal duecredit error:

`from mvpa2.tutorial_suite import *`

gives:

```
2019-01-18 11:00:43,590 [WARNING] DueCredit internal failure while running <function _get_inactive_due at 0x7f651a76b0c8>: VerificationError("importing '/usr/lib/python2.7/dist-packages/cryptography/_Cryptography_cffi_813c10e0x7adb75f8.x86_64-linux-gnu.so': /usr/lib/python2.7/dist-packages/cryptography/_Cryptography_cffi_813c10e0x7adb75f8.x86_64-linux-gnu.so: symbol SSLv2_client_method, version OPENSSL_1.0.0 not defined in file libssl.so.1.0.0 with link time reference",). Please report to developers at https://github.com/duecredit/duecredit/issues (utils.py:199)
2019-01-18 11:00:44,258 [WARNING] DueCredit internal failure while running <function _get_active_due at 0x7f651a76b1b8>: VerificationError("importing '/usr/lib/python2.7/dist-packages/cryptography/_Cryptography_cffi_813c10e0x7adb75f8.x86_64-linux-gnu.so': /usr/lib/python2.7/dist-packages/cryptography/_Cryptography_cffi_813c10e0x7adb75f8.x86_64-linux-gnu.so: symbol SSLv2_client_method, version OPENSSL_1.0.0 not defined in file libssl.so.1.0.0 with link time reference",). Please report to developers at https://github.com/duecredit/duecredit/issues (utils.py:199)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/mvpa2/__init__.py", line 179, in <module>
    due.cite(
AttributeError: 'DueSwitch' object has no attribute 'cite'
```

It seems to me like this is a problem with duecredit and not PyMVPA, so I'm opening the issue here. I'm running a VirtualBox instance with NeuroDebian 8.0.0 (64-bit) and Python 2.7.9. Not really sure what's the issue, so any help would be appreciated. Thanks!


diff --git a/duecredit/tests/test_api.py b/duecredit/tests/test_api.py
index 63e8926..83259d2 100644
--- a/duecredit/tests/test_api.py
+++ b/duecredit/tests/test_api.py
@@ -163,7 +163,16 @@ def test_noincorrect_import_if_no_lxml_numpy(monkeypatch, kwargs, env, stubbed_e
         monkeypatch.setitem(os.environ, key, fake_env_nolxml_[key])
 
     ret, out, err = run_python_command(**kwargs)
-    assert err == ''
+    direct_duecredit_import = 'import duecredit' in kwargs.get('cmd', '')
+    if direct_duecredit_import and env.get('DUECREDIT_TEST_EARLY_IMPORT_ERROR', ''):
+        # We do fail then upon regular import but stubbed script should be ok
+        # since should use the stub
+        assert 'Both inactive and active collectors should be provided' in err
+        assert ret == 1
+    else:
+        assert err == ''
+        assert ret == 0  # but we must not fail overall regardless
+
     if os.environ.get('DUECREDIT_ENABLE', False) and on_windows:  # TODO this test fails on windows
         pytest.xfail("Fails for some reason on Windows")
     elif os.environ.get('DUECREDIT_ENABLE', False):  # we enabled duecredit
@@ -179,10 +188,12 @@ def test_noincorrect_import_if_no_lxml_numpy(monkeypatch, kwargs, env, stubbed_e
     elif os.environ.get('DUECREDIT_TEST_EARLY_IMPORT_ERROR'):
         assert 'ImportError' in out
         assert 'DUECREDIT_TEST_EARLY_IMPORT_ERROR' in out
-        assert 'done123' in out
+        if direct_duecredit_import:
+            assert 'Please report' in out
+        else:
+            assert 'done123' in out
     else:
         assert 'done123\n' or 'done123\r\n' == out
-    assert ret == 0  # but we must not fail overall regardless
 
 
 if __name__ == '__main__':
diff --git a/duecredit/tests/test_dueswitch.py b/duecredit/tests/test_dueswitch.py
index c1d664d..bcaf135 100644
--- a/duecredit/tests/test_dueswitch.py
+++ b/duecredit/tests/test_dueswitch.py
@@ -11,7 +11,7 @@ import atexit
 import pytest
 
 from ..injections.injector import DueCreditInjector
-from ..dueswitch import due
+from ..dueswitch import DueSwitch, due
 
 
 def test_dueswitch_activate(monkeypatch):
@@ -39,3 +39,10 @@ def test_dueswitch_activate(monkeypatch):
     assert state["activate"] == 1
     assert state["register"] == 1
     assert state["register_func"] == due.dump
+
+
+def test_a_bad_one():
+    # We might get neither of those and should fail
+    # see https://github.com/duecredit/duecredit/issues/142
+    # So let's through ValueError right away
+    pytest.raises(ValueError, DueSwitch, None, None, True)
\ No newline at end of file

pip install -e .[tests]
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y libxml2-dev libxslt1-dev
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
charset-normalizer==2.0.12
citeproc-py==0.6.0
contextlib2==21.6.0
-e git+https://github.com/duecredit/duecredit.git@32e632216a55f2d008cdc21c0eca159b12363df8#egg=duecredit
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
lxml==5.3.1
multidict==5.2.0
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
PyYAML==6.0.1
requests==2.27.1
six==1.17.0
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
vcrpy==4.1.1
wrapt==1.16.0
yarl==1.7.2
zipp==3.6.0

name: duecredit
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - charset-normalizer==2.0.12
      - citeproc-py==0.6.0
      - contextlib2==21.6.0
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - lxml==5.3.1
      - multidict==5.2.0
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pyyaml==6.0.1
      - requests==2.27.1
      - six==1.17.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - vcrpy==4.1.1
      - wrapt==1.16.0
      - yarl==1.7.2
      - zipp==3.6.0
prefix: /opt/conda/envs/duecredit

duecredit/tests/test_dueswitch.py::test_a_bad_one
duecredit/tests/test_api.py::test_api[DueCreditCollector] duecredit/tests/test_api.py::test_api[InactiveDueCreditCollector] duecredit/tests/test_api.py::test_noincorrect_import_if_no_lxml duecredit/tests/test_dueswitch.py::test_dueswitch_activate
duecredit/dueswitch.py
duecredit/dueswitch.py