Skip to content

Commit

Permalink
Updating plugin to support older versions of pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin J. Dugan committed Oct 17, 2018
1 parent 5df2d65 commit 4bbfb0b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pytest_remotedata/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
import pytest
from .disable_internet import turn_off_internet, turn_on_internet
from distutils.version import StrictVersion


def pytest_addoption(parser):
Expand Down Expand Up @@ -61,8 +62,12 @@ def pytest_unconfigure():

def pytest_runtest_setup(item):

remote_data = item.get_closest_marker('remote_data')
internet_off = item.get_closest_marker('internet_off')
if StrictVersion(pytest.__version__) < StrictVersion("3.6"):
remote_data = item.get_marker('remote_data')
internet_off = item.get_marker('internet_off')
else:
remote_data = item.get_closest_marker('remote_data')
internet_off = item.get_closest_marker('internet_off')

remote_data_config = item.config.getvalue("remote_data")

Expand Down

0 comments on commit 4bbfb0b

Please sign in to comment.