Fix ResourceWarning: unclosed file in setup.py
Also uniformize the usage of the 'with' context manager. Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
This commit is contained in:
5
setup.py
5
setup.py
@@ -3,12 +3,15 @@ from setuptools import setup, find_packages
|
||||
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",
|
||||
|
||||
@@ -490,9 +490,8 @@ def test_session_hooks(testdir):
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user