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
merged 10 commits into from Jul 16, 2019
Merged

Conversation

@elacuesta
Copy link
Member

@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.

@codecov
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/item.py 98.55% <100%> (+0.06%) ⬆️
scrapy/core/downloader/handlers/http11.py 92.53% <100%> (ø) ⬆️
scrapy/utils/datatypes.py 60.84% <100%> (+0.63%) ⬆️
scrapy/_monkeypatches.py 57.14% <100%> (ø) ⬆️
scrapy/utils/conf.py 89.39% <100%> (ø) ⬆️
scrapy/utils/template.py 100% <100%> (ø) ⬆️
scrapy/settings/__init__.py 93.1% <100%> (+0.12%) ⬆️
scrapy/core/downloader/handlers/ftp.py 98.24% <100%> (ø) ⬆️

scrapy/_monkeypatches.py Outdated Show resolved Hide resolved
scrapy/item.py Show resolved Hide resolved

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

@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/__init__.py Outdated Show resolved Hide resolved
scrapy/item.py Outdated Show resolved Hide resolved
tests/test_utils_datatypes.py Outdated Show resolved Hide resolved
@kmike kmike merged commit 377d8a7 into scrapy:master Jul 16, 2019
3 checks passed
@kmike
Copy link
Member

@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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants