Skip to content

Commit

Permalink
Merge pull request #403 from BoboTiG/fix-resource-leaks
Browse files Browse the repository at this point in the history
Fix ResourceWarning: unclosed file in setup.py
  • Loading branch information
nicoddemus committed Jan 15, 2019
2 parents 48b7014 + 1dec9dc commit f00f9ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
install_requires = ["execnet>=1.1", "pytest>=3.6.0", "pytest-forked", "six"]


with open("README.rst") as f:
long_description = f.read()

setup(
name="pytest-xdist",
use_scm_version={"write_to": "xdist/_version.py"},
description="pytest xdist plugin for distributed testing"
" and loop-on-failing modes",
long_description=open("README.rst").read(),
long_description=long_description,
license="MIT",
author="holger krekel and contributors",
author_email="pytest-dev@python.org,holger@merlinux.eu",
Expand Down
5 changes: 2 additions & 3 deletions testing/acceptance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,8 @@ def pytest_sessionfinish(session):
name = "worker"
else:
name = "master"
f = open(name, "w")
f.write("xy")
f.close()
with open(name, "w") as f:
f.write("xy")
# let's fail on the worker
if name == "worker":
raise ValueError(42)
Expand Down
1 change: 0 additions & 1 deletion testing/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def test_repr_entry():
for i in range(len(a_entries)):
assert isinstance(rep_entries[i], ReprEntry)
assert rep_entries[i].lines == a_entries[i].lines
assert rep_entries[i].localssep == a_entries[i].localssep
assert rep_entries[i].reprfileloc.lineno == a_entries[i].reprfileloc.lineno
assert (
rep_entries[i].reprfileloc.message == a_entries[i].reprfileloc.message
Expand Down

0 comments on commit f00f9ec

Please sign in to comment.