Пример #1
0
 def test_after_config_matches_unconfigured(self):
     """Skip quickly when after section is unconfigured."""
     inistr = (
         '[tox]\n'
         'envlist = py36\n'
     )
     ini = py.iniconfig.IniConfig('', data=inistr)
     assert not after_config_matches(ini, ['py36'])
Пример #2
0
 def test_after_config_matches_unconfigured(self):
     """Skip quickly when after section is unconfigured."""
     inistr = (
         '[tox]\n'
         'envlist = py36\n'
     )
     ini = py.iniconfig.IniConfig('', data=inistr)
     assert not after_config_matches(ini, ['py36'])
Пример #3
0
 def test_after_config_matches_envlist_nomatch(self):
     """Test that it doesn't work."""
     inistr = ('[tox]\n'
               'envlist = py36\n'
               '\n'
               '[travis:after]\n'
               'envlist = py36\n')
     ini = py.iniconfig.IniConfig('', data=inistr)
     assert not after_config_matches(ini, ['py35'])
Пример #4
0
 def test_after_config_matches_envlist_nomatch(self):
     """Test that it doesn't work."""
     inistr = (
         '[tox]\n'
         'envlist = py36\n'
         '\n'
         '[travis:after]\n'
         'envlist = py36\n'
     )
     ini = py.iniconfig.IniConfig('', data=inistr)
     assert not after_config_matches(ini, ['py35'])
Пример #5
0
 def test_after_config_matches_env_nomatch(self, monkeypatch):
     """Test that it doesn't work."""
     monkeypatch.setenv('TRAVIS_PYTHON_VERSION', '3.5')
     monkeypatch.setenv('DJANGO', '1.11')
     inistr = ('[tox]\n'
               'envlist = py36\n'
               '\n'
               '[travis:after]\n'
               'travis =\n'
               '    python: 3.6\n'
               'env =\n'
               '    DJANGO: 1.11\n')
     ini = py.iniconfig.IniConfig('', data=inistr)
     assert not after_config_matches(ini, ['py35'])
Пример #6
0
    def test_after_config_matches_toxenv_nomatch(self, capsys):
        """Test that it doesn't work using the legacy toxenv setting.

        It should also give a warning message.
        """
        inistr = ('[tox]\n'
                  'envlist = py36\n'
                  '\n'
                  '[travis:after]\n'
                  'toxenv = py36\n')
        ini = py.iniconfig.IniConfig('', data=inistr)
        assert not after_config_matches(ini, ['py35'])
        out, err = capsys.readouterr()
        msg = 'The "toxenv" key of the [travis:after] section is deprecated'
        assert msg in err
Пример #7
0
 def test_after_config_matches_env_nomatch(self, monkeypatch):
     """Test that it doesn't work."""
     monkeypatch.setenv('TRAVIS_PYTHON_VERSION', '3.5')
     monkeypatch.setenv('DJANGO', '1.11')
     inistr = (
         '[tox]\n'
         'envlist = py36\n'
         '\n'
         '[travis:after]\n'
         'travis =\n'
         '    python: 3.6\n'
         'env =\n'
         '    DJANGO: 1.11\n'
     )
     ini = py.iniconfig.IniConfig('', data=inistr)
     assert not after_config_matches(ini, ['py35'])
Пример #8
0
    def test_after_config_matches_toxenv_nomatch(self, capsys):
        """Test that it doesn't work using the legacy toxenv setting.

        It should also give a warning message.
        """
        inistr = (
            '[tox]\n'
            'envlist = py36\n'
            '\n'
            '[travis:after]\n'
            'toxenv = py36\n'
        )
        ini = py.iniconfig.IniConfig('', data=inistr)
        assert not after_config_matches(ini, ['py35'])
        out, err = capsys.readouterr()
        msg = 'The "toxenv" key of the [travis:after] section is deprecated'
        assert msg in err