1. fanstatic
  2. fanstatic
  3. fanstatic
  4. Issues
Issue #71 resolved

test_serf fails

Arfrever Frehtes Taifersar Arahesis
created an issue

test_serf fails. I use fanstatic 0.11.3.

{{{ $ py.test-2.7 ==================================================================== test session starts ==================================================================== platform linux2 -- Python 2.7.3 -- pytest-2.1.3 collected 122 items

fanstatic/test_bundle.py .. fanstatic/test_checksum.py ....... fanstatic/test_codegen.py ... fanstatic/test_config.py .... fanstatic/test_core.py ........................................................................ fanstatic/test_injector.py ....... fanstatic/test_publisher.py ........... fanstatic/test_registry.py s fanstatic/test_slot.py .......... fanstatic/test_wsgi.py ...F.

========================================================================= FAILURES ========================================================================== __________ test_serf __________

def test_serf():
    # also test serf config
    d = {
        'resource': 'py:mypackage.style'
        }
  serf = make_serf({}, **d)

fanstatic/test_wsgi.py:64:


global_config = {}

def make_serf(global_config, **local_config):
    resource_identifier = local_config['resource']
    # only accept 'py:' library identifiers at this point
    if resource_identifier.startswith('py:'):
        dotted_name = resource_identifier[3:]
      resource = resolve(dotted_name)

fanstatic/wsgi.py:64:


name = ['style'], module = None

def resolve(name, module=None):
    name = name.split('.')
    if not name[0]:
        if module is None:
            raise ValueError("relative name without base module")
        module = module.split('.')
        name.pop(0)
        while not name[0]:
            module.pop()
            name.pop(0)
        name = module + name

    used = name.pop(0)
  found = __import__(used)

E ImportError: No module named mypackage

fanstatic/wsgi.py:83: ImportError ====================================================== 1 failed, 120 passed, 1 skipped in 4.90 seconds ====================================================== }}}

Comments (4)

  1. Jan-Jaap Driessen

    I can't reproduce the error you report on my machine. Did you run the tests from the environment as built using buildout.cfg ? The 'py.test' part includes the 'mypackage' test dependency.

  2. Log in to comment