Skip to content

Commit 08434f7

Browse files
authored
tests: fix for pytest 4 (#675)
1 parent 75e01bb commit 08434f7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pytest_django/fixtures.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
from __future__ import with_statement
44

55
import os
6+
import warnings
7+
from contextlib import contextmanager
68
from functools import partial
79

810
import pytest
911

10-
from contextlib import contextmanager
11-
1212
from . import live_server_helper
13-
1413
from .django_compat import is_django_unittest
15-
1614
from .lazy_django import skip_if_no_django
1715

1816
__all__ = [
@@ -362,8 +360,7 @@ def live_server(request):
362360
if django.VERSION >= (1, 11):
363361
ports = addr.split(":")[1]
364362
if "-" in ports or "," in ports:
365-
request.config.warn(
366-
"D001",
363+
warnings.warn(
367364
"Specifying multiple live server ports is not supported "
368365
"in Django 1.11. This will be an error in a future "
369366
"pytest-django release.",

0 commit comments

Comments
 (0)