From 341d998eaabc2805963ea2e32421a6e971642594 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 15 May 2018 20:40:27 -0700 Subject: [PATCH] Minor updates --- .gitignore | 2 +- .pre-commit-config.yaml | 13 +++++++------ tests/conftest.py | 12 ++++++------ tox.ini | 1 - 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index d746dd6..5f2930c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ *.gc* *.o *.py[cod] -.cache +.pytest_cache .tox __pycache__/ build/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aab52b9..d430e8d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,6 @@ -- repo: https://github.com/pre-commit/pre-commit-hooks.git - sha: v0.9.1 +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v1.2.3 hooks: - id: autopep8-wrapper - id: check-added-large-files @@ -15,11 +16,11 @@ - id: name-tests-test - id: requirements-txt-fixer - id: trailing-whitespace -- repo: https://github.com/asottile/reorder_python_imports.git - sha: v0.3.5 +- repo: https://github.com/asottile/reorder_python_imports + rev: v1.0.1 hooks: - id: reorder-python-imports -- repo: https://github.com/Lucas-C/pre-commit-hooks.git - sha: v1.0.1 +- repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.1.5 hooks: - id: remove-tabs diff --git a/tests/conftest.py b/tests/conftest.py index 2f10460..aa18323 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4,7 +4,7 @@ import mock import pytest -@pytest.yield_fixture(autouse=True, scope='function') +@pytest.fixture(autouse=True, scope='function') def clean_environment(): """Ensure all tests start with a clean environment. @@ -18,31 +18,31 @@ def clean_environment(): yield -@pytest.yield_fixture(params=['1', '0']) +@pytest.fixture(params=['1', '0']) def both_debug_modes(request): with mock.patch.dict(os.environ, {'DUMB_INIT_DEBUG': request.param}): yield -@pytest.yield_fixture +@pytest.fixture def debug_disabled(): with mock.patch.dict(os.environ, {'DUMB_INIT_DEBUG': '0'}): yield -@pytest.yield_fixture(params=['1', '0']) +@pytest.fixture(params=['1', '0']) def both_setsid_modes(request): with mock.patch.dict(os.environ, {'DUMB_INIT_SETSID': request.param}): yield -@pytest.yield_fixture +@pytest.fixture def setsid_enabled(): with mock.patch.dict(os.environ, {'DUMB_INIT_SETSID': '1'}): yield -@pytest.yield_fixture +@pytest.fixture def setsid_disabled(): with mock.patch.dict(os.environ, {'DUMB_INIT_SETSID': '0'}): yield diff --git a/tox.ini b/tox.ini index af78ff0..682e643 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,6 @@ envlist = py27,py36,gcov [testenv] deps = -r{toxinidir}/requirements-dev.txt -passenv = SSH_AUTH_SOCK commands = python -m pytest