Skip to content

Fix missing default during pytest_configure - #5435

Closed
josePhoenix wants to merge 2 commits into
astropy:masterfrom
josePhoenix:patch-1
Closed

josePhoenix wants to merge 2 commits into
astropy:masterfrom
josePhoenix:patch-1

Conversation

@josePhoenix

Copy link
Copy Markdown
Contributor

Addresses #5402.

@pllim pllim added this to the v1.2.2 milestone Oct 26, 2016
@josePhoenix josePhoenix changed the title Fix missing default in during pytest_configure Fix missing default during pytest_configure Oct 26, 2016
@MSeifert04

Copy link
Copy Markdown
Contributor

@josePhoenix From what I've seen are the test failures not because of this PR. So you don't need to worry (yet) about these.

I think someone (just semi-randomly pinging @pllim) will restart those tests soon.

@pllim

pllim commented Oct 28, 2016

Copy link
Copy Markdown
Member

Restarted.

@pllim

pllim commented Oct 28, 2016

Copy link
Copy Markdown
Member

Travis passed but coverage decreased 0.4% (probably unrelated to this PR but due to #5418).

@pllim

pllim commented Oct 28, 2016

Copy link
Copy Markdown
Member

It is kinda a bug fix but not a very visible one. Does this need change log?

@eteq

eteq commented Oct 28, 2016

Copy link
Copy Markdown
Member

👍 from me too - thanks @josePhoenix!

I think it should get a changelog entry, though, as @josePhoenix's case is not necessarily that unique. @josePhoenix, can you add this to the 1.2.2 section of CHANGES.rst under "Other Changes and Additions"?

(aside: @pllim or maybe @astrofrog - do you know if there's any way I can add files with github's new "edit a PR branch" feature? If there was I could just add the changelog entry myself... I thought someone mentioned this on the astropy-dev thread but don't see a way to do it?)

@pllim

pllim commented Oct 28, 2016

Copy link
Copy Markdown
Member

@eteq apparently you can now commit directly to this PR branch. So that's how you add the entry. I tried that feature only once but it failed miserably because i had to rebase and it won't let me push forcefully.

@josePhoenix

Copy link
Copy Markdown
Contributor Author

Cheers! I'd forgotten I needed to do that.

@eteq

eteq commented Oct 31, 2016

Copy link
Copy Markdown
Member

Oh, whoa, that did work! Of course now the changelog conflicts... but still. Neat!

@josePhoenix - one other question before I try to merge this fixing the conflicts: can you confirm making this change get py.test working in your package? Or is there something else that needs changing? (Which it would make sense to bundle in with this).

@josePhoenix

josePhoenix commented Nov 1, 2016 •

Copy link
Copy Markdown
Contributor Author

Turns out, there are a bunch more unchecked exception cases in this plugin. This PR needs more attention than I can give it at the moment, I'm afraid. There are also calls to deprecated methods in pytest that need to be updated.

@pllim

pllim commented Nov 1, 2016

Copy link
Copy Markdown
Member

Yes, these other exceptions are a known issue (see #5277). I was under the impression that you only needed this one-liner change to make your own package using Astropy template work.

@josePhoenix

Copy link
Copy Markdown
Contributor Author

By "unchecked exception cases" I mean cases where the code could raise an exception and the exception is not checked. For example, the one I fixed in the first commit in this PR. It turns out that there are a lot more of these in pytest_plugins.py, which seems more or less orthogonal to the issue you linked to.

@josePhoenix

Copy link
Copy Markdown
Contributor Author

I've opened #5446 instead, as the docs are currently misleading. Fixing pytest-command support seems to be more involved than anticipated. (Once I fixed one missing default, another appeared. And when I fixed that one, another.)

@josePhoenix josePhoenix closed this Nov 1, 2016
@eteq eteq reopened this Nov 2, 2016
@eteq eteq closed this Nov 2, 2016
@eteq

eteq commented Nov 2, 2016

Copy link
Copy Markdown
Member

Addendum: in an offline chat w/ @josePhoenix it looks like this might actually be due to a change to how options are set as defaults. So this might be a new aspect of #5277 after all: options now may have to specify defaults, which would be why this change was needed if you try to invoke it from py.test 3.x ...

@pllim

pllim commented Nov 2, 2016

Copy link
Copy Markdown
Member

Why, pytest? Why?! 😱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants