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

Further "unknown marks warning" improvements #5178

Merged
merged 3 commits into from May 11, 2019

Conversation

nicoddemus
Copy link
Member

Fix #5023

@codecov
Copy link

codecov bot commented Apr 27, 2019

Codecov Report

Merging #5178 into features will decrease coverage by 2.47%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##           features    #5178      +/-   ##
============================================
- Coverage     93.14%   90.67%   -2.48%     
============================================
  Files           115      115              
  Lines         26139    26124      -15     
  Branches       2578     2576       -2     
============================================
- Hits          24348    23687     -661     
- Misses         1471     2106     +635     
- Partials        320      331      +11
Impacted Files Coverage Δ
testing/python/integration.py 91.42% <ø> (-0.07%) ⬇️
testing/code/test_source.py 95.5% <ø> (-0.04%) ⬇️
testing/test_unittest.py 99.09% <ø> (-0.01%) ⬇️
testing/test_tmpdir.py 98.92% <ø> (+23.11%) ⬆️
src/_pytest/main.py 92.1% <ø> (-3.95%) ⬇️
testing/python/fixtures.py 88.54% <ø> (-9.98%) ⬇️
testing/test_recwarn.py 97.03% <ø> (ø) ⬆️
testing/test_conftest.py 99.62% <ø> (-0.01%) ⬇️
testing/test_capture.py 99.24% <ø> (ø) ⬆️
testing/python/metafunc.py 91.72% <ø> (+1.43%) ⬆️
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ceca35b...0594dba. Read the comment docs.

@@ -0,0 +1 @@
``--strict`` is now called ``--strict-markers`` as it is more explicit about what it does. The old name still works for backward compatibility.
Copy link
Contributor

Choose a reason for hiding this comment

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

With regard to --strict I would keep it anyway, being able to select also other strict modes later..

Copy link
Contributor

Choose a reason for hiding this comment

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

And therefore it could still be used in default config (when the intention here is to enforce strict checkings in general).

Copy link
Member Author

Choose a reason for hiding this comment

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

With regard to --strict I would keep it anyway, being able to select also other strict modes later..

It has not been removed, I only added --strict-markers as the now preferred name, --strict is still present and works as before.

Copy link
Contributor

Choose a reason for hiding this comment

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

I know.. it just sounded like it would be only kept for backward compatibility, while I think it makes sense to keep it in general.

Copy link
Contributor

Choose a reason for hiding this comment

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

And --strict should be used in some test probably still.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, I thought the same thing, please see test_strict_prohibits_unregistered_markers

I know.. it just sounded like it would be only kept for backward compatibility, while I think it makes sense to keep it in general.

Not sure if we should ever change the meaning of --strict in the future as well. I mean, suppose we decide to turn "cannot collect classes with __init__" into an error using --strict. If we do that, then test suites which used --strict to turn marks into errors will now break.

In the future we probably should grow another option for that kind of check and leave this option alone?

Copy link
Member Author

Choose a reason for hiding this comment

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

@blueyed any thoughts on this? If you feel strongly about changing the meaning of --strict and wording, I don't mind changing it back.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we do that, then test suites which used --strict to turn marks into errors will now break.

I'd argue that this is OK - and easy to fix then.
It is easier to have --strict for CI etc, than having to add multiple --strict-* variants then.
New strictness checks could still get their own option, of course (if it makes sense).

markers =
slow
serial

**Note**: This option was previously called ``--strict``, which is now an
alias preserved for backward compatibility.
Copy link
Contributor

Choose a reason for hiding this comment

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

I.e. this could be rephrased.

@nicoddemus nicoddemus added this to the 4.5 milestone May 3, 2019
@nicoddemus
Copy link
Member Author

@blueyed gentle ping. 😁

@nicoddemus nicoddemus requested a review from asottile May 8, 2019 11:15
@blueyed
Copy link
Contributor

blueyed commented May 8, 2019

I'm fine with keeping it like this, but having it clearer would allow problems with deprecations in the future. I.e. if we say now that --strict is an alias, instead of used for strict checking in general we have to adhere to it.

@nicoddemus
Copy link
Member Author

I'm fine with keeping it like this, but having it clearer would allow problems with deprecations in the future.

Makes sense, I don't have strong feelings either way to be honest. Can you suggest the changes you would like to see then (either here as "suggestions" or a commit yourself)?

It doesn't seem to add much value (why would one execute tests
based on that marker?), plus using the docstring for that
encourages one to write a more descriptive message about the test
@nicoddemus
Copy link
Member Author

I'm fine with keeping it like this, but having it clearer would allow problems with deprecations in the future. I.e. if we say now that --strict is an alias, instead of used for strict checking in general we have to adhere to it.

Went ahead and implemented the suggested changes to the docs, please let me know what you think. 👍

@nicoddemus nicoddemus merged commit 465b2d9 into pytest-dev:features May 11, 2019
@nicoddemus nicoddemus deleted the unknown-marks-2 branch May 11, 2019 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants