File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # Executes the pytest framework through JEP via jgo, so that
4+ # the surrounding JVM includes scijava-table on the classpath.
5+ #
6+ # Arguments to this shell script are translated into an argument
7+ # list to the pytest.main function. A weak attempt at handling
8+ # special characters, e.g. single quotation marks and backslashes,
9+ # is made, but there are surely other non-working cases.
10+ #
11+ # Usage examples:
12+ # bin/jep-test.sh
13+ # bin/jep-test.sh tests/test_basics.py
14+ # bin/jep-test.sh tests/test_convert.py::TestConvert::test2DStringArray
15+
16+ if [ $# -gt 0 ]
17+ then
18+ a=$( echo " $@ " | sed ' s/\\/\\\\/g' ) # escape backslashes
19+ a=$( echo " $a " | sed ' s/' \' ' /\\' \' ' /g' ) # escape single quotes
20+ a=$( echo " $a " | sed ' s/ /' \' ' ,' \' ' /g' ) # replace space with ','
21+ argString=" ['$a ']"
22+ else
23+ argString=" "
24+ fi
25+ echo " import pytest; import sys; pytest.main($argString )" > jep_test.py
26+ jgo -Djava.library.path=" $CONDA_PREFIX /lib/python3.10/site-packages/jep" black.ninia:jep:jep.Run+org.scijava:scijava-table jep_test.py
27+ rm jep_test.py
You can’t perform that action at this time.
0 commit comments