Use of paver and nose along with atypical directory structure

I am trying to write a task for Paverthat will run nosetestsin my files.

My directory structure looks like this:

project/
   file1.py
   file2.py
   file3.py
   build/
      pavement.py
   subproject/
      file4.py
   test/
      file5.py
      file6.py

Doctests (using the parameter --with_doctest) should be run on all * .py files, while only the files under project/test(in this example, file5.pyand file6.py) should be found for test procedures.

I can’t understand how to do this - I can write my own plugin for nose, which includes the correct files, but I can’t get Paverto build and install it before the task is called nosetests. I also can not find a way to get Paverto transfer the list of files to check on noseteststhe command line.

?

+3
1

, ?

from paver.easy import sh, path
__path__ = path(__file__).abspath().dirname()

@task
def setup_nose_plugin():
    # ... do your plugin setup here.

@task
@needs('setup_nose_plugin')
def nosetests():
    nose_options = '--with-doctest' # Put your command-line options in there
    sh('nosetests %s' % nose_options, 
       # Your pavement.py is in a weird place, so you need to specify the working dir:
       cwd=__path__.parent)

, , , .

--where , " ". sh('nosetests').

+2

Source: https://habr.com/ru/post/1705999/


All Articles