Skip to content

Commit

Permalink
Look in the tests root dir for jira.cfg and not only in the current …
Browse files Browse the repository at this point in the history
…dir (#100)

* Look in the tests root dir for jira.cfg and not only in the current dir

* Make use of os.path.join

* Convert paths to str

* Convert rootdir info from parser to str

* Removed explicit conversion PathLike -> str
  • Loading branch information
Horstage authored and lukas-bednar committed Feb 20, 2019
1 parent d833245 commit de59516
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Usage
* /etc/jira.cfg
* ~/jira.cfg
* tests\_root\_dir/jira.cfg
* tests\_test\_dir/jira.cfg

The configuration file is loaded in that order mentioned above.
That means that first options from global configuration are loaded,
Expand Down
5 changes: 3 additions & 2 deletions pytest_jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,9 @@ def pytest_addoption(parser):
# FIXME - Change to a credentials.yaml ?
config = six.moves.configparser.ConfigParser()
config.read([
'/etc/jira.cfg',
os.path.expanduser('~/jira.cfg'),
os.path.join('/', 'etc', 'jira.cfg'),
os.path.join(str(parser.extra_info['rootdir']), 'jira.cfg'),
os.path.expanduser(os.path.join('~', 'jira.cfg')),
'jira.cfg',
])

Expand Down

0 comments on commit de59516

Please sign in to comment.