From e13a5017ee9af3817d5764aa75b7c1fd68b0a31a Mon Sep 17 00:00:00 2001
From: Martijn Vermaat <martijn@vermaat.name>
Date: Mon, 26 Oct 2015 14:43:45 +0100
Subject: [PATCH] Never load MUTALYZER_SETTINGS in tests

---
 tests/conftest.py | 6 ++++++
 tests/fixtures.py | 2 --
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/conftest.py b/tests/conftest.py
index c59580d0..a555bb1e 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -5,6 +5,8 @@ Test configuration.
 
 from __future__ import unicode_literals
 
+import mutalyzer.config
+
 from disable_network import turn_off_network, turn_on_network
 from fixtures import *  # noqa
 
@@ -36,6 +38,10 @@ def pytest_generate_tests(metafunc):
 
 
 def pytest_configure(config):
+    # Make sure we cannot accidentally load configuration from the
+    # `MUTALYZER_SETTINGS` environment variable.
+    mutalyzer.config.ENVIRONMENT_VARIABLE = None
+
     if not config.getoption('allow_network'):
         turn_off_network(verbose=config.option.verbose)
 
diff --git a/tests/fixtures.py b/tests/fixtures.py
index 870331f8..f96a9c3a 100644
--- a/tests/fixtures.py
+++ b/tests/fixtures.py
@@ -21,8 +21,6 @@ from mutalyzer import db as _db
 
 @pytest.fixture(autouse=True)
 def settings(request, tmpdir):
-    # This fixture should always be loaded, otherwise we have the risk that
-    # `MUTALYZER_SETTINGS` will be used.
     cache_dir = unicode(tmpdir.mkdir('cache'))
     log_file = unicode(tmpdir.join('log').ensure())
 
-- 
GitLab