Merge pull request #4941 from blueyed/testdir-home
pytester: testdir: set $HOME to tmpdir
This commit is contained in:
@@ -816,16 +816,12 @@ def test_invalid_xml_escape():
|
||||
assert chr(i) == bin_xml_escape(unichr(i)).uniobj
|
||||
|
||||
|
||||
def test_logxml_path_expansion(tmpdir, monkeypatch):
|
||||
def test_logxml_path_expansion(tmpdir):
|
||||
home_tilde = py.path.local(os.path.expanduser("~")).join("test.xml")
|
||||
|
||||
xml_tilde = LogXML("~%stest.xml" % tmpdir.sep, None)
|
||||
assert xml_tilde.logfile == home_tilde
|
||||
|
||||
# this is here for when $HOME is not set correct
|
||||
monkeypatch.setenv("HOME", str(tmpdir))
|
||||
home_var = os.path.normpath(os.path.expandvars("$HOME/test.xml"))
|
||||
|
||||
xml_var = LogXML("$HOME%stest.xml" % tmpdir.sep, None)
|
||||
assert xml_var.logfile == home_var
|
||||
|
||||
|
||||
@@ -470,9 +470,6 @@ class TestPDB(object):
|
||||
'''
|
||||
"""
|
||||
)
|
||||
# Prevent ~/.pdbrc etc to output anything.
|
||||
monkeypatch.setenv("HOME", str(testdir))
|
||||
|
||||
child = testdir.spawn_pytest("--doctest-modules --pdb %s" % p1)
|
||||
child.expect("Pdb")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user