~crunch.io/ubuntu/precise/codespeak-lib/unstable

« back to all changes in this revision

Viewing changes to testing/plugin/conftest.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2010-08-01 16:24:01 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100801162401-g37v49d1p148alpm
Tags: 1.3.3-1
* New upstream release.
* Bump Standards-Version to 3.9.1.
* Fix typo in py.test manpage.
* Prefer Breaks: over Conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
        return mod
12
12
 
13
13
# for plugin test we try to automatically make sure that
14
 
# the according plugin is loaded 
 
14
# the according plugin is loaded
15
15
def pytest_funcarg__testdir(request):
16
16
    testdir = request.getfuncargvalue("testdir")
17
17
    #for obj in (request.cls, request.module):
18
 
    #    if hasattr(obj, 'testplugin'): 
 
18
    #    if hasattr(obj, 'testplugin'):
19
19
    #        testdir.plugins.append(obj.testplugin)
20
20
    #        break
21
21
    #else:
22
 
    modname = request.module.__name__.split(".")[-1] 
 
22
    modname = request.module.__name__.split(".")[-1]
23
23
    if modname.startswith("test_pytest_"):
24
24
        modname = modname[5:]
25
25
        if plugindir.join("%s.py" % modname).check():
26
26
            if modname[7:] not in default_plugins:
27
27
                testdir.plugins.append(vars(request.module))
28
 
                testdir.plugins.append(modname) 
 
28
                testdir.plugins.append(modname)
29
29
    #elif modname.startswith("test_pytest"):
30
30
    #    pname = modname[5:]
31
31
    #    assert pname not in testdir.plugins
32
 
    #    testdir.plugins.append(pname) 
 
32
    #    testdir.plugins.append(pname)
33
33
    #    #testdir.plugins.append(vars(request.module))
34
34
    else:
35
35
        pass # raise ValueError("need better support code")