Changes between Version 9 and Version 10 of pyrunner


Ignore:
Timestamp:
12/04/23 11:51:13 (12 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pyrunner

    v9 v10  
    3434
    3535
     36=== Running python unit tests
     37PythonVenv also has support to run unit tests with discovery.
     38Your java code is assumed to have ...Test.java files that are compiled into your PythonVenv, eg using java2python like this
     39{{{
     40                PyProgram tests = PyProgram.fromDirectories(Arrays.asList(src, test));
     41}}}
     42
     43The src and test dir can have overlapping modules as usual in java (eg, you have {{{geniuswebsrc/issuevalue/Bid.java}}} and a matching {{{geniuswebtest/issuevalue/BidTest.java}}}. This results in the tests in the same directory in the compiled code, while being separate in the sources. Having it all in a single zip file allows for all dependencies, both for the code and for the testing, to be installed in one go.
     44
     45Then you run the test using
     46
     47{{{
     48PythonVenv py = new PythonVenv(tests.getZip(), logger);
     49TestResult res = py.test("geniusweb", 60000);
     50}}}
     51