add pytest decorator for skipping py3 test (#21151)
* add pytest decorator for skipping py3 test * quality
This commit is contained in:
@@ -6,6 +6,7 @@ import sys
|
||||
from contextlib import contextmanager
|
||||
|
||||
import moto
|
||||
import pytest
|
||||
from django.dispatch import Signal
|
||||
from markupsafe import escape
|
||||
from mock import Mock, patch
|
||||
@@ -153,3 +154,13 @@ def normalize_repr(func):
|
||||
between worker processes.
|
||||
"""
|
||||
return reprwrapper(func)
|
||||
|
||||
|
||||
# Decorator for skipping tests that are not ready to be run with Python 3.x.
|
||||
# While we expect many tests to fail with Python 3.x as we transition, this
|
||||
# is specifically for tests that rely on external or large scale fixes. It can
|
||||
# be added to individual tests or test classes.
|
||||
py2_only = pytest.mark.skipif(
|
||||
sys.version_info > (3, 0),
|
||||
reason="This test can only be run with Python 2.7, currently"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user