summaryrefslogtreecommitdiff
path: root/noxfile.py
blob: 7d51a948a2faf38e70840edaf586a880e16ce2f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import nox


@nox.session(python=['3.7'])
def docs(session):
    session.install('sphinx',
                    'sphinx-rtd-theme',
                    '.',
                    )
    session.chdir('docs')
    tmpdir = session.create_tmp()

    session.run('sphinx-build', '-a', '-W', '-T', '-b', 'html',
                '-d', '{}/doctrees'.format(tmpdir), '.', '{}/html'.format(tmpdir))


@nox.session(python=['3.5.2', '3.5.3', '3.5', '3.6', '3.7', '3.8', '3.9'])
@nox.parametrize('plugin', [None,
                            'ext_test',
                            'template',
                            'coverage'])
def tests(session, plugin):
    if plugin is None:
        session.install('invoke', './[test]')
        session.run('invoke', 'pytest', '--junit', '--no-pty', '--base')
        session.install('./plugins/ext_test/')
        session.run('invoke', 'pytest', '--junit', '--no-pty', '--isolated')
    elif plugin == 'coverage':
        session.install('invoke', 'codecov', 'coverage')
        session.run('codecov')
    else:
        session.install('invoke', './', 'plugins/{}[test]'.format(plugin))

        # cd into test directory to run other unit test
        session.run('invoke',
                    'plugin.{}.pytest'.format(plugin.replace('_', '-')),
                    '--junit',
                    '--no-pty',
                    '--append-cov',
                    )