File: test_jpype_pyinstaller.py

package info (click to toggle)
python-jpype 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,984 kB
  • sloc: python: 18,767; cpp: 17,931; java: 8,448; xml: 1,305; makefile: 154; sh: 35
file content (31 lines) | stat: -rw-r--r-- 620 bytes parent folder | download | duplicates (3)
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
import os
from pathlib import Path
from subprocess import run

import jpype
import PyInstaller.__main__


fspath = getattr(os, 'fspath', str)


example_path = Path(__file__).parent.joinpath('example.py')


def test_start_and_stop(tmp_path):
    name = 'e'
    dist = tmp_path.joinpath('dist')
    work = tmp_path.joinpath('build')
    result = dist.joinpath(name, name)

    PyInstaller.__main__.run([
        '--name',
        name,
        '--distpath',
        fspath(dist),
        '--workpath',
        fspath(work),
        fspath(example_path),
    ])

    run([fspath(result)], check=True, cwd=fspath(tmp_path))