[py-svn] commit/pytest: hol... at merlinux.eu: Fix test for windows

Bitbucket commits-noreply at bitbucket.org
Mon Oct 8 13:48:54 CEST 2012


1 new commit in pytest:


https://bitbucket.org/hpk42/pytest/changeset/6fda63e086f5/
changeset:   6fda63e086f5
user:        hol... at merlinux.eu
date:        2012-10-08 13:42:31
summary:     Fix test for windows
affected #:  1 file

diff -r 025c93a014e79f83e9f06091656df3c1652e9bef -r 6fda63e086f55c3f60e617b89670cdd0c6fa1bcd testing/test_junitxml.py
--- a/testing/test_junitxml.py
+++ b/testing/test_junitxml.py
@@ -383,16 +383,18 @@
     for i in valid:
         assert chr(i) == bin_xml_escape(unichr(i)).uniobj
 
-def test_logxml_path_expansion():
+def test_logxml_path_expansion(tmpdir, monkeypatch):
     from _pytest.junitxml import LogXML
 
     home_tilde = os.path.normpath(os.path.expanduser('~/test.xml'))
-    # this is here for when $HOME is not set correct
-    home_var = os.path.normpath(os.path.expandvars('$HOME/test.xml'))
 
     xml_tilde = LogXML('~/test.xml', None)
     assert xml_tilde.logfile == home_tilde
 
+    # this is here for when $HOME is not set correct
+    monkeypatch.setenv("HOME", tmpdir)
+    home_var = os.path.normpath(os.path.expandvars('$HOME/test.xml'))
+
     xml_var = LogXML('$HOME/test.xml', None)
     assert xml_var.logfile == home_var

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

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the pytest-commit mailing list