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

Prevent deprecation warnings #3877

merged 10 commits into from Jul 16, 2019


Copy link

@elacuesta elacuesta commented Jul 14, 2019

I messed up #3876, had to open a new PR 🤦‍♂️

I left out some Twisted warnings, I believe they are more delicate and deserve their own treatment.

Copy link

@codecov codecov bot commented Jul 14, 2019

Codecov Report

Merging #3877 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #3877      +/-   ##
+ Coverage   85.56%   85.57%   +0.01%     
  Files         164      164              
  Lines        9551     9560       +9     
  Branches     1431     1434       +3     
+ Hits         8172     8181       +9     
  Misses       1132     1132              
  Partials      247      247
Impacted Files Coverage Δ
scrapy/ 98.55% <100%> (+0.06%) ⬆️
scrapy/core/downloader/handlers/ 92.53% <100%> (ø) ⬆️
scrapy/utils/ 60.84% <100%> (+0.63%) ⬆️
scrapy/ 57.14% <100%> (ø) ⬆️
scrapy/utils/ 89.39% <100%> (ø) ⬆️
scrapy/utils/ 100% <100%> (ø) ⬆️
scrapy/settings/ 93.1% <100%> (+0.12%) ⬆️
scrapy/core/downloader/handlers/ 98.24% <100%> (ø) ⬆️

scrapy/ Outdated Show resolved Hide resolved
scrapy/ Show resolved Hide resolved

# FIXME: delete after dropping py2 support
# Monkey patch the unittest module to prevent the
# DeprecationWarning about assertRaisesRegexp -> assertRaisesRegex
Copy link

@kmike kmike Jul 15, 2019

can we solve it without a monkey patch, e.g. by having a subclass - or is it too much, given that we're going to drop Python 2.x soon-ish?

Copy link
Member Author

@elacuesta elacuesta Jul 15, 2019

Right, according to #3846 it's "planned for Q4 2019 or Q1 2020" (🎉) given that this is only used in the tests it should be fine IMHO

tests/ Outdated Show resolved Hide resolved
scrapy/ Outdated Show resolved Hide resolved
tests/ Outdated Show resolved Hide resolved
@kmike kmike merged commit 377d8a7 into scrapy:master Jul 16, 2019
3 checks passed
Copy link

@kmike kmike commented Jul 16, 2019

Thanks @elacuesta! I still feel uncomfortable with merging a monkey-patch to stdlib module, but as it only happens when Scrapy tests are executed (not when Scrapy itself is imported), this should be fine.

@kmike kmike added this to the v1.7 milestone Jul 16, 2019
@elacuesta elacuesta deleted the tests_deprecation_warnings branch Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants