Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3260 fix pytest section #3267

Merged
merged 6 commits into from
Feb 27, 2018
Merged

#3260 fix pytest section #3267

merged 6 commits into from
Feb 27, 2018

Conversation

feuillemorte
Copy link
Contributor

Fixes #3260

Bugfix: When you pass option "-c custom_config.cfg" section [tool:pytest] is now parses. And print warning if there is [pytest] section.

@feuillemorte feuillemorte added type: bug problem that needs to be addressed topic: config related to config handling, argument parsing and config file labels Feb 27, 2018
sections = ['tool:pytest', 'pytest'] if is_cfg_file else ['pytest']
for section in sections:
try:
inicfg = iniconfig[section]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we never deprecated [pytest] in custom configs, i believe we should either support both or target the features branch

Copy link
Contributor Author

@feuillemorte feuillemorte Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RonnyPfannschmidt fixed

I thought that #3086 deprecates [pytest] section in custom configs too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@feuillemorte it is deprecated, but we will remove it only in 4.0. We should start issuing warnings here as well if users are using [pytest] in setup.cfg files, see:

pytest/_pytest/config.py

Lines 1266 to 1267 in 2008554

if inibasename == 'setup.cfg' and warnfunc:
warnfunc('C1', SETUP_CFG_PYTEST)

But we don't introduce new warnings in bug-fixes (we've broken test suites in the past because of that) so the introduction of this warning should be done in features, in a separate task.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #3268 with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicoddemus I see, thanks!

@coveralls
Copy link

coveralls commented Feb 27, 2018

Coverage Status

Coverage increased (+0.06%) to 92.597% when pulling 1fb2457 on feuillemorte:3260-fix-pytest-section into 2008554 on pytest-dev:master.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work @feuillemorte! 👍

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nicoddemus nicoddemus merged commit 9fcbf57 into pytest-dev:master Feb 27, 2018
@feuillemorte feuillemorte deleted the 3260-fix-pytest-section branch February 27, 2018 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: config related to config handling, argument parsing and config file type: bug problem that needs to be addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache not respecting cache_dir config option
4 participants