Skip to content

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Jan 28, 2015

Fixes #16.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.98%) to 71.13% when pulling 1562d1c on blueyed:handle-urlerror-in-make_screenshot_on_failure into eae87cc on pytest-dev:master.

Copy link
Member

Choose a reason for hiding this comment

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

not sure if you need logging, and if you do, then it definitely should be not info but debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It won't / should not affect production systems / logs, but is used only during tests - and in that case it's a good/useful information.

Copy link
Member

Choose a reason for hiding this comment

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

agreed, then modernize it - use .format

@blueyed
Copy link
Contributor Author

blueyed commented Jan 29, 2015

I've pushed a new commit, and added a test.

Is it possible for the test to not spawn a browser window, like with the other tests in tests/test_screenshot.py?
I had to use testdir.runpytest to get the actual output from py.test.
Could this be achieved using testdir.inline_runsource, too?

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.47%) to 71.65% when pulling 4e688ef on blueyed:handle-urlerror-in-make_screenshot_on_failure into eae87cc on pytest-dev:master.

@blueyed blueyed force-pushed the handle-urlerror-in-make_screenshot_on_failure branch from 4e688ef to c5cb90d Compare January 29, 2015 17:17
@blueyed
Copy link
Contributor Author

blueyed commented Jan 29, 2015

i think if you'll patch .warn on pytest it should be good enough

That wasn't trivial - I hope I got it right?!

Let me know if this is good, and I'll squash-merge it as a single commit into master.

Copy link
Member

Choose a reason for hiding this comment

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

assertion should be moved out inside of the 'root' test, then it will be ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've tried that first, but it did not work - the warning gets done in the inner test.

I've committed it in 008728f, and added an sentence to the doc.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.47%) to 71.65% when pulling c5cb90d on blueyed:handle-urlerror-in-make_screenshot_on_failure into 1e058c8 on pytest-dev:master.

@blueyed blueyed closed this Jan 29, 2015
@blueyed blueyed deleted the handle-urlerror-in-make_screenshot_on_failure branch January 29, 2015 18:48
Copy link
Member

Choose a reason for hiding this comment

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

please change back, it decreases the coverage, also the readability - those multiple returns in a single function

@bubenkoff
Copy link
Member

what's your username on pypi?

@bubenkoff
Copy link
Member

actually i've just found out that test is a complete false-positive thing
when you use mock as decorator, you should receive it as argument as well, instead your testdir is the mock so it just accepts everything :)

@bubenkoff
Copy link
Member

i think i'll fix it myself

@bubenkoff bubenkoff mentioned this pull request Jan 30, 2015
@bubenkoff
Copy link
Member

ok i fixed it
please give a bit more love to the code next time

@bubenkoff
Copy link
Member

1.2.10 is out

@blueyed
Copy link
Contributor Author

blueyed commented Jan 30, 2015

Thanks for fixing (and releasing) it, and sorry for my oversights.

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.

make_screenshot_on_failure: handle "URLError: Connection refused"

3 participants