Repository: tox-dev/tox-travis

Issue:
master branch fails with tox master
```
[7931] /home/vsts/work/1/s/upstream/tox-travis$ /home/vsts/work/1/s/upstream/tox-travis/.tox/py37/bin/py.test
============================= test session starts ==============================
platform linux -- Python 3.7.2, pytest-4.5.0, py-1.8.0, pluggy-0.11.0
cachedir: .tox/py37/.pytest_cache
rootdir: /home/vsts/work/1/s/upstream/tox-travis
plugins: mock-1.10.4
collected 57 items

tests/test_after.py .................                                    [ 29%]
tests/test_envlist.py .FFFFFFFFFFFFFFFFFFFFFFFFFFFF.....                 [ 89%]
tests/test_hacks.py .                                                    [ 91%]
tests/test_hooks.py ..                                                   [ 94%]
tests/test_utils.py ...                                                  [100%]

=================================== FAILURES ===================================
____________________ TestToxEnv.test_travis_config_filename ____________________

self = <test_envlist.TestToxEnv object at 0x7f9bb2f7ed30>
tmpdir = local('/tmp/pytest-of-vsts/pytest-1/test_travis_config_filename0')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f9bb2f7ee80>

    def test_travis_config_filename(self, tmpdir, monkeypatch):
        """Give the correct env for manual filename."""
        with self.configure(tmpdir, monkeypatch, tox_ini, 'CPython', 3, 6,
                            ini_filename='spam.ini'):
>           assert self.tox_envs(ini_filename='spam.ini') == ['py36']
E           AssertionError: assert ['py26', 'py2...ypy3', 'docs'] == ['py36']
E             At index 0 diff: 'py26' != 'py36'
E             Left contains 5 more items, first extra item: 'py27'
E             Use -v to get the full diff

```

Discussion:
codecov-io: # [Codecov](https://codecov.io/gh/tox-dev/tox-travis/pull/137?src=pr&el=h1) Report
> Merging [#137](https://codecov.io/gh/tox-dev/tox-travis/pull/137?src=pr&el=desc) into [master](https://codecov.io/gh/tox-dev/tox-travis/commit/9778c244b3328614a59a7847d39ccff2ba819f4d?src=pr&el=desc) will **decrease** coverage by `2.34%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/tox-dev/tox-travis/pull/137/graphs/tree.svg?width=650&token=CBMEkiKkWy&height=150&src=pr)](https://codecov.io/gh/tox-dev/tox-travis/pull/137?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #137      +/-   ##
==========================================
- Coverage   88.26%   85.91%   -2.35%     
==========================================
  Files           5        5              
  Lines         213      213              
  Branches       48       48              
==========================================
- Hits          188      183       -5     
- Misses         21       23       +2     
- Partials        4        7       +3
```


| [Impacted Files](https://codecov.io/gh/tox-dev/tox-travis/pull/137?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/tox\_travis/hooks.py](https://codecov.io/gh/tox-dev/tox-travis/pull/137/diff?src=pr&el=tree#diff-c3JjL3RveF90cmF2aXMvaG9va3MucHk=) | `87.09% <100%> (-12.91%)` | :arrow_down: |
| [src/tox\_travis/envlist.py](https://codecov.io/gh/tox-dev/tox-travis/pull/137/diff?src=pr&el=tree#diff-c3JjL3RveF90cmF2aXMvZW52bGlzdC5weQ==) | `91.56% <0%> (-1.21%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/tox-dev/tox-travis/pull/137?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/tox-dev/tox-travis/pull/137?src=pr&el=footer). Last update [9778c24...217d43e](https://codecov.io/gh/tox-dev/tox-travis/pull/137?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/.appveyor.yml b/.appveyor.yml
index 458ea72..ce0aeee 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -5,10 +5,11 @@ environment:
     - TOXENV: py35
     - TOXENV: py36
 install:
-  - pip install tox
+  - C:\Python37\python -m pip install -U pip virtualenv setuptools wheel six
+  - C:\Python37\python -m pip install -U tox
 build: false
 test_script:
-  - tox
+  - C:\Python37\scripts\tox
 matrix:
   fast_finish: true
 skip_branch_with_pr: true
diff --git a/src/tox_travis/hooks.py b/src/tox_travis/hooks.py
index 9b84632..e4661dd 100644
--- a/src/tox_travis/hooks.py
+++ b/src/tox_travis/hooks.py
@@ -44,7 +44,9 @@ def tox_configure(config):
                   'envs that Tox should run are declared in the tox config.',
                   file=sys.stderr)
             autogen_envconfigs(config, undeclared)
-        config.envlist = envlist
+        # Also set envlist_default to allow us to inspect outcomes
+        # via tox -l in the tests, until a better solution arrives.
+        config.envlist_default = config.envlist = envlist
 
     # Override ignore_outcomes
     if override_ignore_outcome(ini):


Test patch:
diff --git a/tests/test_envlist.py b/tests/test_envlist.py
index 3de3cf3..4a3b167 100644
--- a/tests/test_envlist.py
+++ b/tests/test_envlist.py
@@ -2,6 +2,7 @@
 import py
 import re
 import subprocess
+import pytest
 from contextlib import contextmanager
 
 
@@ -293,6 +294,13 @@ class TestToxEnv:
         with self.configure(tmpdir, monkeypatch, tox_ini, 'CPython', 2, 7):
             assert self.tox_envs() == ['py27', 'docs']
 
+    # XFAIL because of changes to tox -l to make it show declared envs
+    # rather than the envs that will actually run, which is what we
+    # need to test. When a better option is available, we can get this
+    # test working again.
+    #
+    # # https://github.com/tox-dev/tox/pull/1284#issuecomment-488411553
+    @pytest.mark.xfail
     def test_respect_overridden_toxenv(self, tmpdir, monkeypatch):
         """Ensure that TOXENV if given is not changed."""
         with self.configure(tmpdir, monkeypatch, tox_ini, 'CPython', 2, 7):