title: How can Python's `assert False` prevent pytest from working?
body: <p>I've added an <code>assert False</code> statement in <a href="https://github.com/pallets/flask/blob/master/flask/helpers.py#L866" rel="nofollow noreferrer">flask/helpers.py</a> in the following class's <code>__init__</code> method:</p>
  
  <pre><code>class locked_cached_property(object):
      """A decorator that converts a function into a lazy property.  The
      function wrapped is called the first time to retrieve the result
      and then that calculated result is used the next time you access
      the value.  Works like the one in Werkzeug but has a lock for
      thread safety.
      """
  
      def __init__(self, func, name=None, doc=None):
  
          assert False
          # ^ this is the problem
  
          self.__name__ = name or func.__name__
          self.__module__ = func.__module__
          self.__doc__ = doc or func.__doc__
          self.func = func
          self.lock = RLock()
  
      def __get__(self, obj, type=None):
          if obj is None:
              return self
          with self.lock:
              value = obj.__dict__.get(self.__name__, _missing)
              if value is _missing:
                  value = self.func(obj)
                  obj.__dict__[self.__name__] = value
              return value
  </code></pre>
  
  <p>and now when I'm running <code>pytest</code> I get the following traceback:</p>
  
  <pre><code>
  Traceback (most recent call last):
    File "~/code/virtualenv/project_a/lib/python3.6/site-packages/_pytest/config/__init__.py", line 381, in _getconftestmodules
      return self._path2confmods[path]
  KeyError: local('~/code/flask/tests')
  
  During handling of the above exception, another exception occurred:
  Traceback (most recent call last):
    File "~/code/virtualenv/project_a/lib/python3.6/site-packages/_pytest/config/__init__.py", line 412, in _importconftest
      return self._conftestpath2mod[conftestpath]
  KeyError: local('~/code/flask/tests/conftest.py')
  
  During handling of the above exception, another exception occurred:
  Traceback (most recent call last):
    File "~/code/virtualenv/project_a/lib/python3.6/site-packages/_pytest/config/__init__.py", line 418, in _importconftest
      mod = conftestpath.pyimport()
    File "~/code/virtualenv/project_a/lib/python3.6/site-packages/py/_path/local.py", line 668, in pyimport
      __import__(modname)
    File "&lt;frozen importlib._bootstrap&gt;", line 971, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 955, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 656, in _load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 626, in _load_backward_compatible
    File "~/code/virtualenv/project_a/lib/python3.6/site-packages/_pytest/assertion/rewrite.py", line 290, in load_module
      six.exec_(co, mod.__dict__)
    File "~/code/flask/tests/conftest.py", line 19, in &lt;module&gt;
      import flask
    File "~/code/flask/flask/__init__.py", line 21, in &lt;module&gt;
      from .app import Flask, Request, Response
    File "~/code/flask/flask/app.py", line 26, in &lt;module&gt;
      from . import cli, json
    File "~/code/flask/flask/cli.py", line 32, in &lt;module&gt;
      from .helpers import get_debug_flag, get_env, get_load_dotenv
    File "~/code/flask/flask/helpers.py", line 894, in &lt;module&gt;
      class _PackageBoundObject(object):
    File "~/code/flask/flask/helpers.py", line 956, in _PackageBoundObject
      @locked_cached_property
    File "~/code/flask/flask/helpers.py", line 876, in __init__
      assert False
  AssertionError
  ERROR: could not load ~/code/flask/tests/conftest.py
  </code></pre>
  
  <p>I'm curious how an <code>assert False</code> statement can seem to cause an import failure when in the <code>__init__</code> function.  If the <code>assert False</code> was in the <code>__get__</code> function I am still able to import the module.  </p>
  
  <p>This occurs for pytest 3.8.1 and 4.0.2.</p>
  
  <p>Does this mean that a decorator's <code>__init__</code> is called during the importing of the module?</p>