2 new commits in tox:

https://bitbucket.org/hpk42/tox/commits/b0e448bae10b/
Changeset:   b0e448bae10b
User:        leinz
Date:        2014-12-02 08:03:48+00:00
Summary:     Determine Jenkins environment as described in docs
HUDSON_URL is still checked for backward compatibility.
Affected #:  1 file

diff -r cc3723fe6680f49ec11995d8df7f37b533fc5f33 -r 
b0e448bae10bcf28dd717d10010658bda138e4d5 tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -802,7 +802,7 @@
         return ps.yield_words
 
 def getcontextname():
-    if 'HUDSON_URL' in os.environ:
+    if any(env in os.environ for env in ['JENKINS_URL', 'HUDSON_URL']):
         return 'jenkins'
     return None
 


https://bitbucket.org/hpk42/tox/commits/361530d6b080/
Changeset:   361530d6b080
User:        leinz
Date:        2014-12-10 21:37:30+00:00
Summary:     Add test for getcontextname()
Affected #:  1 file

diff -r b0e448bae10bcf28dd717d10010658bda138e4d5 -r 
361530d6b08048d678cf8a585bac67553eddaba7 tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -148,6 +148,20 @@
     assert get_homedir() == "123"
 
 
+class TestGetcontextname:
+    def test_blank(self, monkeypatch):
+        monkeypatch.setattr(os, "environ", {})
+        assert getcontextname() is None
+
+    def test_jenkins(self, monkeypatch):
+        monkeypatch.setattr(os, "environ", {"JENKINS_URL": "xyz"})
+        assert getcontextname() == "jenkins"
+
+    def test_hudson_legacy(self, monkeypatch):
+        monkeypatch.setattr(os, "environ", {"HUDSON_URL": "xyz"})
+        assert getcontextname() == "jenkins"
+
+
 class TestIniParser:
     def test_getdefault_single(self, tmpdir, newconfig):
         config = newconfig("""

Repository URL: https://bitbucket.org/hpk42/tox/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit

Reply via email to