From 4e21d1d77b5fc42cc9e9477190d4b1bf29223d25 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 8 Aug 2015 15:25:10 +0200 Subject: [PATCH] Move enum import and adjust comments. --- _pytest/python.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/_pytest/python.py b/_pytest/python.py index b7c102a69..cdd51a810 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -9,6 +9,12 @@ import pytest from _pytest.mark import MarkDecorator, MarkerError from py._code.code import TerminalRepr +try: + import enum +except ImportError: # pragma: no cover + # Only available in Python 3.4+ or as a backport + enum = None + import _pytest import pluggy @@ -980,12 +986,6 @@ def _idval(val, argname, idx, idfn): except Exception: pass - try: - import enum - except ImportError: - # Only available in Python 3.4+ - enum = None - if isinstance(val, (float, int, str, bool, NoneType)): return str(val) elif isinstance(val, REGEX_TYPE):