add a test for loc method; check if a warning raise when replacing a …
…subframe

- [x] closes #36424
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Hello @samilAyoub! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2020-09-22 11:20:12 UTC @arw2019 I need a help here, why Linting step fail here? So I don't think this is actually testable with the current setup. Apparently code run in tests is configured to raise an error instead of a warning on chained assignment (hence all the test failures):

https://github.com/pandas-dev/pandas/blob/d38dc0652fd97b2ea56cff6696261bd628eb2f96/pandas/conftest.py#L151 @dsaxton So we can modify the test to capture raising instead of warning when chained assignment is used. > @dsaxton So we can modify the test to capture raising instead of warning when chained assignment is used.

That seems reasonable Also if you can now merge master that should fix the CI @dsaxton did you mean merging master branch into this branch (add_test_subframe)? > @dsaxton did you mean merging master branch into this branch (add_test_subframe)?

Yes, actually it seems CI is fine so not really necessary @dsaxton Thank you for your review ! thanks @samilAyoub 