From 00e7ee532e1f692d508a2cb9241f4b78921f6f4c Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 15 May 2017 20:25:53 -0300 Subject: [PATCH] Fix minor regendoc issues --- doc/en/Makefile | 2 +- doc/en/unittest.rst | 3 ++- doc/en/warnings.rst | 2 +- tox.ini | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/en/Makefile b/doc/en/Makefile index 5b534da09..286bbd8e7 100644 --- a/doc/en/Makefile +++ b/doc/en/Makefile @@ -41,7 +41,7 @@ clean: -rm -rf $(BUILDDIR)/* regen: - PYTHONDONTWRITEBYTECODE=1 PYTEST_ADDOPT=-p\ no:hypothesis COLUMNS=76 regendoc --update *.rst */*.rst ${REGENDOC_ARGS} + PYTHONDONTWRITEBYTECODE=1 PYTEST_ADDOPT=-pno:hypothesis COLUMNS=76 regendoc --update *.rst */*.rst ${REGENDOC_ARGS} html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html diff --git a/doc/en/unittest.rst b/doc/en/unittest.rst index 6ee7d505e..436e64e07 100644 --- a/doc/en/unittest.rst +++ b/doc/en/unittest.rst @@ -171,7 +171,8 @@ creation of a per-test temporary directory:: tmpdir.join("samplefile.ini").write("# testdata") def test_method(self): - s = open("samplefile.ini").read() + with open("samplefile.ini") as f: + s = f.read() assert "testdata" in s Due to the ``autouse`` flag the ``initdir`` fixture function will be diff --git a/doc/en/warnings.rst b/doc/en/warnings.rst index fb18c4a2f..64316cf6b 100644 --- a/doc/en/warnings.rst +++ b/doc/en/warnings.rst @@ -39,7 +39,7 @@ Running pytest now produces this output:: The ``-W`` flag can be passed to control which warnings will be displayed or even turn them into errors:: - $ pytest -q test_show_warning.py -W error::DeprecationWarning + $ pytest -q test_show_warnings.py -W error::DeprecationWarning no tests ran in 0.12 seconds ERROR: file not found: test_show_warning.py diff --git a/tox.ini b/tox.ini index 52bd471c4..a2d4af9ed 100644 --- a/tox.ini +++ b/tox.ini @@ -134,6 +134,7 @@ commands= [testenv:regen] changedir=doc/en +skipsdist=True basepython = python3.5 deps=sphinx PyYAML