Skip to content

Commit

Permalink
Get the INI file path from pytest < 2.7.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyespo committed Mar 4, 2016
1 parent 7d9516f commit 7f1508d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pytest_watch/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ def __init__(self):
self.path = None

def pytest_cmdline_main(self, config):
if getattr(config, 'inifile', None):
self.path = str(config.inifile)
if hasattr(config, 'inifile'):
# pytest >= 2.7.0
inifile = config.inifile
else:
# pytest < 2.7.0
inifile = config.inicfg.config.path
if inifile:
self.path = str(inifile)


def merge_config(args, directories):
Expand Down

0 comments on commit 7f1508d

Please sign in to comment.