From 892aa457be971fa091fddf27d0b9591b2fe92670 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Wed, 26 Mar 2014 07:15:54 +0100 Subject: [PATCH] fix issue472: clarify that ``pytest.config.getvalue()`` cannot work if it's triggered ahead of command line parsing. --- CHANGELOG | 3 +++ doc/en/skipping.txt | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 0cbb05441..3bd2f3ae8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -18,6 +18,9 @@ NEXT (2.6) - fix issue490: include pytest_load_initial_conftests in documentation and improve docstring. +- fix issue472: clarify that ``pytest.config.getvalue()`` cannot work + if it's triggered ahead of command line parsing. + 2.5.2 ----------------------------------- diff --git a/doc/en/skipping.txt b/doc/en/skipping.txt index 7d6573f56..22e024c0c 100644 --- a/doc/en/skipping.txt +++ b/doc/en/skipping.txt @@ -286,4 +286,9 @@ The equivalent with "boolean conditions" is:: def test_function(...): pass +.. note:: + You cannot use ``pytest.config.getvalue()`` in code + imported before py.test's argument parsing takes place. For example, + ``conftest.py`` files are imported before command line parsing and thus + ``config.getvalue()`` will not execute correctly.