title: How to append different pytest tests to the same junit xml file instead of overriding it?
body: <p>I have the following function in a shell script:</p>
  <pre><code>test_handler(){
    FOLDER_NAME=$1
    echo &quot;running tests in: ${FOLDER_NAME} package&quot;
    cd ${SOURCE_CODE_FOLDER}/${FOLDER_NAME}
    pipenv install --dev
    #need to run this with pipenv run to get the install dependencies.
    pipenv run run-tests
    EXIT_CODE=$?
  
    if [ ${EXIT_CODE} != 0 ];then
      echo &quot;error, Exit code=${EXIT_CODE} in ${FOLDER_NAME}'s tests.&quot; &gt;&gt; /home/logs.txt;
      exit 1;
    fi;
  
    echo &quot;${FOLDER_NAME}'s tests succeeded.&quot; &gt;&gt; /home/logs.txt;
  }
  </code></pre>
  <p>The function is working fine. It is called twice in the script with two different folder names, such that each of them has a &quot;test&quot; package with pytests inside.</p>
  <p>The line <code>pipenv run run-tests</code> is running the following script:</p>
  <pre><code>#!/bin/bash
  python3.7 -m pytest -s --cov-append --junitxml=/home/algobot-packer/tests.xml $PWD/tests/
  EXIT_CODE=$?
  
  exit ${EXIT_CODE}
  </code></pre>
  <p>Eventually it generates a <code>tests.xml</code> file. The only problem is that the second function call is overriding the first one.</p>
  <p>Is there a way to generate one xml file that holds the results of running the tests script twice (appending the results instead of rewriting the file)?</p>
  <p>I've tried looking at the docs and <code>pytest --help</code> but couldn't find my answer.</p>