Fix 2 ResourceWarning: unclosed file, in tests

This commit is contained in:
Mickaël Schoentgen
2018-09-01 15:58:33 +02:00
parent 6ef3b50390
commit 25a4b558cd
2 changed files with 8 additions and 6 deletions
+4 -3
View File
@@ -210,9 +210,10 @@ Requests = "==2.14.0" # Inline comment
c = p.pipenv("install python_DateUtil")
assert c.return_code == 0
assert "python-dateutil" in p.pipfile["packages"]
contents = open(p.pipfile_path).read()
assert "# Pre comment" in contents
assert "# Inline comment" in contents
with open(p.pipfile_path) as f:
contents = f.read()
assert "# Pre comment" in contents
assert "# Inline comment" in contents
@pytest.mark.files
+4 -3
View File
@@ -148,6 +148,7 @@ python_DateUtil = "*" # Inline comment
c = p.pipenv("uninstall python_dateutil")
assert "Requests" in p.pipfile["packages"]
assert "python_DateUtil" not in p.pipfile["packages"]
contents = open(p.pipfile_path).read()
assert "# Pre comment" in contents
assert "# Inline comment" in contents
with open(p.pipfile_path) as f:
contents = f.read()
assert "# Pre comment" in contents
assert "# Inline comment" in contents