title: How to run Python tests against multiple Python conda environments?
body: <p>I have a few carefully configured <code>conda</code> environments created using Anaconda. I have written a Python package that uses some of the packages and libraries installed in these environments. Now I would like to run the tests with each test file being executed for each environment to make sure the package can handle working with different Python versions and different set of 3rd party packages available.</p>
  
  <p>Using a <code>tox</code> did not work for me because it tries to recreate those environments locally to run tests against. This is how my <code>tox.ini</code> file looks:</p>
  
  <pre><code>[tox]
  envlist = py36, py27
  skipsdist = True
  
  [testenv]
  basepython = 
      py36: C:\Users\user\AppData\Local\Continuum\Anaconda2\envs\Env1\python.exe
      py27: C:\Users\user\AppData\Local\Continuum\Anaconda2\envs\Env2\python.exe
  
  commands = 
      {envpython} -m unittest discover
  </code></pre>
  
  <p>However, it is not possible to do just plain <code>pip install</code> into the environments <code>tox</code> creates on each run mainly because there are some compiled libraries and workarounds involved (which are solved in a <code>conda</code> environment - so I have to use those as they are).</p>
  
  <p>I currently have a dummy <code>.bat</code> file with the following content:</p>
  
  <pre><code>"C:\Users\user\AppData\Local\Continuum\Anaconda2\envs\Env1\python.exe" -m unittest discover
  "C:\Users\user\AppData\Local\Continuum\Anaconda2\envs\Env2\python.exe" -m unittest discover
  </code></pre>
  
  <p>which I execute in a Windows <code>cmd</code> to see the results. It does work, but I wonder whether there is any more Pythonic way to run these tests such using <code>py.test</code> or <code>tox</code>. I do not want to recreate the <code>conda</code> environments I already have; I just want to use different Python interpreters accessed at different locations to run my tests.</p>